Multiple Heading Rows

4 posts, 0 answers
  1. Eduan Marais
    Eduan Marais avatar
    18 posts
    Member since:
    Feb 2010

    Posted 18 May 2010 Link to this post

    Hi.

    I would like to have more than 1 row as a heading to my grid.
    I would like to have a heading that is applicable to a couple of columns, with each underlying column still having its own heading.

    It should be simular to the formatting that you can do in excel, when you merge a couple of columns into 1 column, and still have columns underneath it, example
    ------------------------------------
    |            Data Group             |
    ------------------------------------
    |Column1|Column2|Column3|
    ------------------------------------

    I have a project where I need to add columns to my radgrid in code, so please help with a WPF C# example.

    Thanks.
  2. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 19 May 2010 Link to this post

    Hi Eduan Marais,

     Please check out this blog post: http://blogs.telerik.com/pavelpavlov/posts/09-12-04/adding_additional_power_to_radgridview_for_silverlight_with_attached_behaviors.aspx

    Kind regards,
    Yavor Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Eduan Marais
    Eduan Marais avatar
    18 posts
    Member since:
    Feb 2010

    Posted 19 May 2010 Link to this post

    HI.

    Thank you, I will look into it.
    I was hoping to something where everyting is done in code. In my situation, I do not know how many columns or column groupings will be needed, so I can not hard code it in xaml. I am generating logsheets for plant environments, to each plant is different. The details on how many columns and column groups is passed to me during runtime, so I need to build these headings dynamically, based on the information given to me.

    Regards

    Eduan
  5. Yavor Georgiev
    Admin
    Yavor Georgiev avatar
    982 posts

    Posted 19 May 2010 Link to this post

    Hello Eduan Marais,

     You can create this behavior in code like so:

    var behaviour = new ColumnGroupsBehavior
    {
        CommonHeaders = new ObservableCollection<CommonHeader>
        {
            new CommonHeader { StartColumnIndex = 0, Caption = "Vehicle info", ColumnSpan = 2 },
            new CommonHeader { StartColumnIndex = 2, Caption = "Dimensions (mm)", ColumnSpan = 3 },
            new CommonHeader { StartColumnIndex = 5, Caption = "Total Price", ColumnSpan = 1 }
        }
    };
    behaviour.Attach(this.RadGridView1);

    You can modify the ColumnHeaders collection as you like.

    Best wishes,
    Yavor Georgiev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top