gridview

Indent first column in GridView of ListView

痞子三分冷 提交于 2019-12-13 04:23:45
问题 I have created a gridview by using list view. There is 2 level of nodes and I would like to indent the child node. Therefore, I have set the margin in the <ItemPresenter> . The result looks pretty good but the second and the third column also been indent and not align according to its header column. Any idea to indent only the first column but not the rest column? xaml <ListView Name="listViewResult" Margin="10,231,0,-299" BorderBrush="#FF000000" BorderThickness="1" > <ListView.View>

How to add header columns based on data fetch from the database in gridview

笑着哭i 提交于 2019-12-13 04:22:41
问题 I have a GridView and want to make headers dynamically based on the some SQL query like... select question from quiz where quizid is 123. This query will return * number of questions based on the quizid . How to create headers with the data that's been selected from database? 回答1: You can use DataTable to help with this. I don't know which technologies you used for database management, but I used LinQ to SQL . And the following is my sample: DataClassesDataContext db = new

Bulk Editing of A GridView in ASP.Net

与世无争的帅哥 提交于 2019-12-13 04:14:45
问题 What is the best way to achieve bulk editing of a grid view in ASP.net? I don't want the user to have to click edit on each individual row to change it. It would be much better if they could make all the changes and then submit them in one go. What I want is something like Item1 x x x x Item2 x x x x Item3 x x x x Submit Where x a check box. Is a grid view even a good way to go about achieving this? 回答1: Try this: In you gridview create a template column with textboxs next fill all with

ASP.Net GridView UpdatePanel Paging Gives Error On Second Click

北慕城南 提交于 2019-12-13 04:09:07
问题 I'm trying to implement a GridView with paging inside a UpdatePanel. Everything works great when I do my first click. The paging kicks in and the next set of data is loaded quickly. However, when I then try to click a link for another page of data, I get the following error: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 12030 aspx code <asp:UpdatePanel ID="UpdatePanel1"

Gridview RowCommand not working

夙愿已清 提交于 2019-12-13 04:07:56
问题 I am having problems trying to get a rowcommand event to fire in a gridview. I followed the code example from MSDNet but I cannot figure out why it is not working. The code is below. Thank you. <asp:GridView ID="GridViewProducts" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px" CellPadding="5" CellSpacing="1" DataKeyNames="Pkey" DataSourceID="SqlDataSourceProducts" ForeColor="Black" GridLines="Vertical"> <FooterStyle

Deleting records from GridView and DB using (Check-box and delete button)

ぃ、小莉子 提交于 2019-12-13 04:05:12
问题 I have a GridView1 declared as: <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" GridLines="None" DataKeyNames="Case_ID"> <Columns> <asp:TemplateField> <ItemTemplate><asp:CheckBox ID="cb" runat="server" /></ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="No."> <ItemTemplate><%# Container.DataItemIndex + 1 %></ItemTemplate> </asp:TemplateField> <asp:BoundField HeaderText="Case Title" DataField="caseTitle"/> <asp:BoundField HeaderText="Age" DataField=

Accessing the data or dataItem used to bind a gridview

空扰寡人 提交于 2019-12-13 04:04:14
问题 I have a gridview for which I programmatically set the datasource and databind it to a collection of objects. For each row that is created I then use different methods in the fields to extract the relevant information from the object like this one: <asp:TemplateField HeaderText="Aliases"> <ItemTemplate> <%# ( (MyItem)Container.DataItem).Aliases.ToString() %> </ItemTemplate> </asp:TemplateField> My problem is that in the OnRowDeleting method I would preferably like to be able to access that

How to add a progress bar column inside the asp.net gridview

耗尽温柔 提交于 2019-12-13 04:03:25
问题 I have asp.net grid for which i have a column called status in each of the gridcolumn for status i want to place a progress bar which gives the status. please can give me some implementation idea on this. 回答1: Not sure why you want to put progress bar there? Is each row in grid has a status (such as % complete) that is keep changing? Is your grid keep refreshing periodically? Said all that, I will probably go with jquery UI progress bar. Its a client side plug-in so you can easily initialize

changing css of controls in gridview separately for each row

隐身守侯 提交于 2019-12-13 03:55:55
问题 i have four button in my templatefield of gridview. i need to change the css of clicked button in every row separately. for example in row one, first button is clicked. then it have to be yellow. and in row 3, second button is clicked. then it have to be yellow and so on. here is my gridview <asp:GridView OnRowCommand="SelectedPollGridView_RowCommand" ID="SelectedPollGridView" runat="server" AutoGenerateColumns="False" DataKeyNames="PollID" DataSourceID="SelectedPollSqlDataSource"> <Columns>

How to Add an Empty, Unbound, Comment Column to a GridView?

做~自己de王妃 提交于 2019-12-13 03:50:14
问题 I've put together a GridView table in ASP.net that allows users to approve a series of records. As part of this approval process, I'd like to provide an empty column for the user to provide comments where necessary. The only records showing up will be records that haven't been approved yet, thus, no comments will need to be loaded. Once they are approved, users will not be able to view these records again. How do I go about adding this empty column to my GridView? Again, there's no data to