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

Can't Sort, Group or Filter the grid

6 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 1
Patrick asked on 21 Apr 2009, 02:28 PM
Since I could have varying columns with each request, I am creating the columns for my GridView on the fly, based on the data returned from my service.  For the same reason, I am using the ValueConverter to access the data:

      for (int i = 0; i < e.Result.ResultTable.Columns.Count; i++)
            {
                GridViewDataColumn newcol = new GridViewDataColumn();
                newcol.HeaderText = e.Result.ResultTable.Columns[i].ToString();

                newcol.IsFilterable = true;
                newcol.IsGroupable = true;
                newcol.IsSortable = true;
                newcol.IsReadOnly = true;
                
                newcol.DataMemberBinding= new System.Windows.Data.Binding();
                newcol.DataMemberBinding.Converter = new IndexConverter();
                newcol.DataMemberBinding.ConverterParameter = i.ToString(); ;
                theDataGrid.Columns.Add(newcol);
            }
            
Data returns fine, column headers are correct, but I can't sort, group or filter the grid.  Clicking on a column does nothing, there is no filter indicator, and if I drag a column to the group area, I get a "You can't do that" icon.

Is this somehow related to the ValueConverter?

Thanks

Patrick Connelly

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Apr 2009, 03:47 PM
Hello Patrick,

Unfortunately (and similar to MS DataGrid) RadGridView will not work fully in such scenario.

Best wishes,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Patrick
Top achievements
Rank 1
answered on 21 Apr 2009, 09:59 PM
Does this mean that the Sort/Group/Filter functions will only work on a predefined set of columns?

What specifically is the limitation?

Are there any other workarounds to allow binding to a flexible dataset?

Thanks

Patrick
0
Vlad
Telerik team
answered on 22 Apr 2009, 05:38 AM
Hi Patrick,

This limitation comes directly from Silverlight Binding class - you cannot use it with indexed properties (you cannot specify  Path).

Kind regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mike Gold
Top achievements
Rank 1
answered on 18 Mar 2011, 09:38 PM
I ran into the same problem, and i'm hoping there is a workaround.  Sorting you can work around with custom sorting.  How about grouping?  If I have a dynamic value converter i also get the cannot group thing.  any ideas on make this work?  is there a custom grouping solution?

-Mike
0
Vlad
Telerik team
answered on 21 Mar 2011, 08:02 AM
Hi,

 If you want full support for sorting, grouping, filtering, etc. you can use our DataTable

Best wishes,
Vlad
the Telerik team
0
Scott
Top achievements
Rank 1
answered on 04 Apr 2011, 05:54 PM
Is there a plan to correct this?

I am trying to bind to a SharePoint List/View.

Frozen Columns, Sort, Group, Filter are all requirements.

Any ideas?
Tags
GridView
Asked by
Patrick
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Patrick
Top achievements
Rank 1
Mike Gold
Top achievements
Rank 1
Scott
Top achievements
Rank 1
Share this question
or