Last post Feb 19, 2013 11:03 PM by ToughMan
Feb 18, 2013 09:24 AM|muthu_pblr|LINK
We have a gridview control which was bind by a datatable. This datatable retrieve data, based on the part availability from the stockist location by ascending order. The part number passing as a parameter during runtime. I want to get one of the particular
stockist row details from the gridview and move that entire row on top of the row of the gridview. I got the row values and I can hide that particular stockist row.
I want to insert an empty row and add the stockist row data on top of the row in the gridview control.
Feb 19, 2013 02:09 AM|Pengzhen Song - MSFT|LINK
You can try adding an empty row like this
TableCellCollection fields = e.Row.Cells;
TableCell headerCell = new TableCell();
headerCell.ColumnSpan = fields.Count;
headerCell.Text = "Header";//You can also add controls
headerCell.HorizontalAlign = HorizontalAlign.Center;
GridViewRow rowHeader = new GridViewRow(0, 0, DataControlRowType.Header, DataControlRowState.Normal);
rowHeader.Visible = true;
GridView1.Controls.Controls.AddAt(0,rowHeader); //Change index
Please refer here
Hope it can help you.
Feb 19, 2013 11:03 PM|ToughMan|LINK
Insert empty row on top of the gridview and add values
Use GridView's FooterRow.