Hi,
I have a grid with template columns. In the grid, the rows are merged when the data are same. Since the number of columns in the grid are exceeding the grid's view, it is set to be scrollable. The problem is, when the grid is scrolled, there control in the column went missing.
This is the code that I use to merge the row
Protected Sub gvMain_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles gvMain.PreRender
For Each dataItem As GridDataItem In gvMain.MasterTableView.Items
If (dataItem.OwnerTableView.Name = "gvMain") Then
Dim gtv As GridTableView = CType(dataItem.OwnerTableView, GridTableView)
For rowIndex As Integer = gtv.Items.Count - 2 To 0 Step -1
Dim row As GridDataItem = gtv.Items(rowIndex)
Dim previousRow As GridDataItem = gtv.Items(rowIndex + 1)
If row("Name").Text = previousRow("Name").Text Then
For col As Integer = gtv.Columns.Count - 1 To 0 Step -1
Dim gbcCol As String = CType(gvMain.MasterTableView.Columns(col).UniqueName, String)
If Not (gbcCol.Equals("inclTrx") Or gbcCol.Equals("inclKYC") Or _
gbcCol.Equals("ShareholdingID") Or gbcCol.Equals("Shareholding") Or gbcCol.Equals("Remark")) Then
row(gbcCol).RowSpan = If(previousRow(gbcCol).RowSpan < 2, 2, previousRow(gbcCol).RowSpan + 1)
previousRow(gbcCol).Visible = False
previousRow(gbcCol).Text = " "
End If
Next
End If
Next
End If
Next
End Sub
Any thoughts?