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

how to add Column Group for code behigh vb.net

3 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cholticha
Top achievements
Rank 1
Cholticha asked on 08 May 2019, 10:01 AM

Hello.....

how to add Column Group for code behigh vb.net

- I Can  pic1.png
 - I want pic2.png

 

 

3 Answers, 1 is accepted

Sort by
0
Accepted
Vessy
Telerik team
answered on 10 May 2019, 08:08 AM
Hi,

You can see how to create Column groups dynamically in the following forum thread:
https://www.telerik.com/forums/adding-column-groups-dynamically-giving-invalid-column-error

In VB, this will look in a similar way (you can use this converter in order to translate any c# code to VB):
'in Page_Init
    Dim CycleGroup1 As GridColumnGroup = New GridColumnGroup()
    CycleGroup1.HeaderText = "Final Status"
    CycleGroup1.Name = "Final_Status"
    RadGridResults.MasterTableView.ColumnGroups.Add(CycleGroup1)


Regards,
Vessy
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.
0
Cholticha
Top achievements
Rank 1
answered on 13 May 2019, 04:57 AM

Hi

Thank you for answer me

I have another question.  I want you to help.

how to  add Column DetailTables in RadGrid  for code behigh vb.net

- I Can  pic1.png

- I want pic2.png

 

Thank.

0
Vessy
Telerik team
answered on 14 May 2019, 12:46 PM
Hi Cholticha,

You can add dynamic columns to the detailed table of the Grid like follows, just make sure that the columns is added to the columns collection before configuring them:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
    If Not IsPostBack Then
        Dim col1 As GridBoundColumn = New GridBoundColumn()
        RadGrid1.MasterTableView.DetailTables(0).Columns.Add(col1)
        col1.UniqueName = "colFromServer1"
        col1.HeaderText = "Col 1 from server"
        col1.DataField = "OrderDate"
 
        Dim col2 As GridBoundColumn = New GridBoundColumn()
        RadGrid1.MasterTableView.DetailTables(0).Columns.Add(col2)
        col2.UniqueName = "colFromServer2"
        col2.HeaderText = "Col 2 from server"
        col2.DataField = "ShipName"
    End If
End Sub


Regards,
Vessy
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
Cholticha
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Cholticha
Top achievements
Rank 1
Share this question
or