Bind values to GridViewColumnGroup HeaderTemplate programmatically

5 posts, 0 answers
  1. Vinay
    Vinay avatar
    36 posts
    Member since:
    Mar 2010

    Posted 12 Jun 2012 Link to this post

    Hi,
    How can i bind values to GridViewColumnGroup HeaderTemplate pro grammatically.

    <DataTemplate x:Key="GroupeHeaderScoresTemplate">
                <StackPanel DataContext="{Binding AssignmentHeaders}">
                    <TextBox Text="{Binding AssignmentShortName}" Height="25" TextWrapping="Wrap"/>
                    <TextBox Text="{Binding AssignmentDescription}" Height="25" TextWrapping="Wrap"/>
                    <TextBox Text="{Binding AssignmentMarkingPeriod}" Height="25" TextWrapping="Wrap"/>
                    <TextBox Text="{Binding AssignmentCategory}" Height="25" TextWrapping="Wrap"/>
                    <telerik:RadDatePicker SelectedDate="{Binding AssignmentDate}" Height="25"></telerik:RadDatePicker>
                    <TextBox Text="{Binding AssignmentWeight}" Height="25" TextWrapping="Wrap"/>
                    <TextBox Text="{Binding AssignmentPossiblePoints}" Height="25" TextWrapping="Wrap"/>                               
                </StackPanel>
            </DataTemplate>

    I have datatemplate as above and i am adding the template programitically,
    var gridViewColumnScoreGroup = new GridViewColumnGroup { Name = "ColumnScoresGroup" + i, HeaderTemplate = CreateTemplate(i) };
                GridGradeView.ColumnGroups.Add(gridViewColumnScoreGroup);

    Now how can i bind values to DataTemplate???


  2. Gary
    Gary avatar
    2 posts
    Member since:
    Jan 2012

    Posted 07 Nov 2012 Link to this post

    I'm trying to do something similar for the WPF RadTreeListView - did you get any solution for this?
  3. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 08 Nov 2012 Link to this post

    Hi Gary ,

    Please give some details on what exactly you are trying to achieve with column group headers.

    All the best,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  4. Gary
    Gary avatar
    2 posts
    Member since:
    Jan 2012

    Posted 08 Nov 2012 Link to this post

    Hi Pavel,

    We're trying to have collapsible and expandable headers, similar to the PivotGrid - I've got this working, apart from the column header '+' and '-' switching depending on whether the column group is expanded or collapsed.

    I wanted to set a view model on the header so the template can simply bind through.

    We're evaluating whether the Telerik control can let us do the column group expand and collapse - I've got the expand/collapsing working, but we have additional questions. If you see the attached screenshot, we needed to insert the "Colour Total" column group above the "Column" group to match the dimensionality of the Region column groups. We'd prefer the Colour column to span the two header rows.

    Also, you can click and drag column headers to reorder columns, but not column group headers - is there a way to do this?

    Do you have an email address I could maybe send our prototype project to, or if you'd like us to discuss our more-specific requirements?

    Thanks,

    Gary
  5. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 08 Nov 2012 Link to this post

    Hi Gary,

    To be able to attach a project you will just need to open a support ticket form your account .
    Please mention the ID of this thread (553508) so we can continue
    the thread there.

    All the best,
    Pavel Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top