This is a migrated thread and some comments may be shown as answers.

column is missing when scrolling the grid with merged row

1 Answer 15 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nzsr
Top achievements
Rank 1
nzsr asked on 05 Apr 2019, 04:07 AM

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?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 09 Apr 2019, 01:34 PM
Hi,

I am afraid merging cells or rows is not supported with RadGrid. Instead of changing the Row/ColSpan of the cells, you can use their properties or CSS to hide their borders.

Regards,
Eyup
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
nzsr
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or