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

Dynamic binding and grouping

2 Answers 76 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dirk
Top achievements
Rank 1
Iron
Dirk asked on 19 Mar 2012, 10:27 AM
I'm using this example to create a dynamic gridview:
http://blogs.telerik.com/vladimirenchev/posts/11-09-28/dynamic-binding-for-your-silverlight-applications.aspx


In my application the first 3 columns always have the same column header.
Is it possible to group these 3 columns directly after loading and hide the grouped header?
I've tried to use
<telerik:RadGridView.Columns>
 <telerik:GridViewDataColumn DataMemberBinding="{Binding Location}" Header="Location" IsFilterable="True" 
    IsGroupable="True" IsReadOnly="True" IsReorderable="False" IsResizable="True" IsSortable="False" UniqueName="Location" 
   ShowColumnWhenGrouped="False" />
</telerik:RadGridView.Columns>
  
<telerik:RadGridView.GroupDescriptors>
       <telerik:GroupDescriptor Member="Location"
                              SortDirection="Ascending" />
 </telerik:RadGridView.GroupDescriptors>
and
private void Grid_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e)
{
    if (e.Column.UniqueName == "Location")
    {
        e.Cancel = true;
    }
}

But this is not working in combination with
AutoGenerateColumns="True" 

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 20 Mar 2012, 08:26 AM
Hi,

 I've attached small example project to illustrate you how to achieve your goal. 

Regards,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Rikin
Top achievements
Rank 1
answered on 20 Jul 2012, 10:27 AM
hi,
 i am using telerik gridview to display data.. it works really great.. 
but i when i am using grouping that makes some problem to me...

i have created approximate 8 groups(a->b->c so on.. ) in gridview. now suppose in my first group there are only one sub group. But it show me all the 8 sub group in it.. 
i am attaching the screen shot of the grid.. 

so if it is possible to reduce some unnecessary sub groups.. 

with regards
Rikin
Tags
GridView
Asked by
Dirk
Top achievements
Rank 1
Iron
Answers by
Vlad
Telerik team
Rikin
Top achievements
Rank 1
Share this question
or