How to Merge a particular column in gridview using asp.net ?
-
Please somebody post reply to this. I am a new developer, and am searching for merging rows of particular column alone.
Thanks, Sharmi
-
Please somebody post reply to this. I am a new developer, and am searching for merging rows of particular column alone.
Thanks, Sharmi
-
Merge column of table (data source). you have select statement like
Select A, B, C from tableName
so modify it like
Select A = A+B, C from tableName
If you can't access select statement, then you have to modify datasource object prior setting to grid !
Sorry Let me clearly ask the question again. I am binding the data from stored procedure. I must not touch the SP now. I just need to write a code in rowbound function for merging. I find only the below code in all blogs. It is merging rows of all columns in grid, i need it for only 1 column. for (int rowIndex = REGrid.Rows.Count - 2; rowIndex >= 0; rowIndex--) { GridViewRow gvRow = REGrid.Rows[rowIndex]; GridViewRow gvPreviousRow = REGrid.Rows[rowIndex + 1]; for (int cellCount = 0; cellCount < gvRow.Cells.Count; cellCount++) { if (gvRow.Cells[cellCount].Text == gvPreviousRow.Cells[cellCount].Text) { if (gvPreviousRow.Cells[cellCount].RowSpan < 2) { gvRow.Cells[cellCount].RowSpan = 2; } else { gvRow.Cells[cellCount].RowSpan = gvPreviousRow.Cells[cellCount].RowSpan + 1; } gvPreviousRow.Cells[cellCount].Visible = false; } } } This is the code. Could you please help me in this, how to re frame this loop for just 1 column. Lets assume for the first column in grid. thanks in advance
Thanks, Sharmi
-
Please somebody post reply to this. I am a new developer, and am searching for merging rows of particular column alone.
Thanks, Sharmi
-
Visit this link http://marss.co.ua/MergingCellsInGridView.aspx[^]
Hi , I already saw that link, It is merging all columns right. I need to merge just for 1 column. I dint get it properly,the code. If possible could u pls explain each line.
:confused:
Thanks, Sharmi
-
Please somebody post reply to this. I am a new developer, and am searching for merging rows of particular column alone.
Thanks, Sharmi
Friends, Please help me with this as soon as possible. By monday i need to show a demo to my Manager. Kinldy do the needful
Thanks, Sharmi
-
Hi , I already saw that link, It is merging all columns right. I need to merge just for 1 column. I dint get it properly,the code. If possible could u pls explain each line.
:confused:
Thanks, Sharmi
-
Friends, Please help me with this as soon as possible. By monday i need to show a demo to my Manager. Kinldy do the needful
Thanks, Sharmi
:-D I got it done myself. It is working fine now.
Thanks, Sharmi
-
Please somebody post reply to this. I am a new developer, and am searching for merging rows of particular column alone.
Thanks, Sharmi