how to add Column Group for code behigh vb.net

4 posts, 1 answers
  1. Cholticha
    Cholticha avatar
    11 posts
    Member since:
    Nov 2017

    Posted 08 May 2019 Link to this post

    Hello.....

    how to add Column Group for code behigh vb.net

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

     

     

  2. Answer
    Vessy
    Admin
    Vessy avatar
    2214 posts

    Posted 10 May 2019 Link to this post

    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.
  3. Cholticha
    Cholticha avatar
    11 posts
    Member since:
    Nov 2017

    Posted 12 May 2019 in reply to Vessy Link to this post

    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.

  4. Vessy
    Admin
    Vessy avatar
    2214 posts

    Posted 14 May 2019 Link to this post

    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.
Back to Top