GridView rowspan in asp.net

Posted by Senthilmcatyr under ASP.NET on 3/15/2012 | Points: 10 | Views : 5952 | Status : [Member] | Replies : 2
I have used rowspan in gridview asp.net. I have used this code.

For rowIndex As Integer = gvViewallOsId.Rows.Count - 2 To 0 Step -1
Dim gvRow As GridViewRow = gvViewallOsId.Rows(rowIndex)
Dim gvPreviousRow As GridViewRow = gvViewallOsId.Rows(rowIndex + 1)
For cellCount As Integer = 0 To gvRow.Cells.Count - 1
If gvRow.Cells(cellCount).Text = gvPreviousRow.Cells(cellCount).Text Then
If gvPreviousRow.Cells(cellCount).RowSpan < 2 Then
gvRow.Cells(cellCount).RowSpan = 2
Else
gvRow.Cells(cellCount).RowSpan = gvPreviousRow.Cells(cellCount).RowSpan + 1
End If
gvPreviousRow.Cells(cellCount).Visible = False
End If
Next
Next

I have attached excel files and i dispaly my gridview rowspan result. I want 3rd colomns user name datas display in single times. anybody if know pls help me.




Responses

Posted by: Hmanjarawala on: 3/15/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi,
you can do this either using Repeater control or in Gridview use NestedGridview....

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Senthilmcatyr, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 3/15/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi refer this also:

http://wiki.asp.net/page.aspx/815/rowspan-with-gridview/
http://www.kodyaz.com/articles/asp-net-gridview-rowspan-using-rowCreated-event.aspx
http://www.codeproject.com/Articles/34337/How-to-merge-cells-with-equal-values-in-a-GridView


Mark this as answer, if it helps you....................

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Senthilmcatyr, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response