Wai Chiu Lau
Top achievements
Rank 1
Wai Chiu Lau
asked on 10 Mar 2008, 11:25 AM
Hi,
I have a problem when sorting template columns containing fields that are objects.
I have custom collection ContactList with ContactInfo objects. One of the property of ContactInfo is Owner which is an object of type OwnerType. This object has ToString() method so the column is filled with the data, so that is no problem. When I sort this column the grid just goes blank!
I would really appreciate help.
Tahir
I have a problem when sorting template columns containing fields that are objects.
I have custom collection ContactList with ContactInfo objects. One of the property of ContactInfo is Owner which is an object of type OwnerType. This object has ToString() method so the column is filled with the data, so that is no problem. When I sort this column the grid just goes blank!
I would really appreciate help.
Tahir
5 Answers, 1 is accepted
0
Hi Tahir
,
How the grid is bound in your case? Do you use NeedDataSource or ObjectDataSource?
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
How the grid is bound in your case? Do you use NeedDataSource or ObjectDataSource?
Kind regards,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Wai Chiu Lau
Top achievements
Rank 1
answered on 10 Mar 2008, 10:31 PM
Hi,
Thanks for your reply. I am not using either. I use something like:
gvw.DataSource = ContactList.Load().List
gvw.DataBind()
Tahir
Thanks for your reply. I am not using either. I use something like:
gvw.DataSource = ContactList.Load().List
gvw.DataBind()
Tahir
0
Hello Tahir,
Automatic sorting can be achieved only with advanced data-binding otherwise you should handle SortCommand, provide DataSource and DataBind() the grid again exaclty in the same way as with MS DataGrid or MS GridView. More info you can find here:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/SimpleBinding/DefaultCS.aspx
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/NeedDataSource/DefaultCS.aspx
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Automatic sorting can be achieved only with advanced data-binding otherwise you should handle SortCommand, provide DataSource and DataBind() the grid again exaclty in the same way as with MS DataGrid or MS GridView. More info you can find here:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/SimpleBinding/DefaultCS.aspx
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/NeedDataSource/DefaultCS.aspx
Greetings,
Vlad
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
0
Wai Chiu Lau
Top achievements
Rank 1
answered on 11 Mar 2008, 09:41 AM
Hello Vlad,
Yes I am doing exactly that, handling the SortCommand event and providing DataSource and calling DataBind(). For simple columns it works fine however for a column (property of object) that is a custom object/class, then it fails.
Tahir
Yes I am doing exactly that, handling the SortCommand event and providing DataSource and calling DataBind(). For simple columns it works fine however for a column (property of object) that is a custom object/class, then it fails.
Tahir
0
Hi Wai Chiu Lau,
You can switch to Advanced Databinding. Please, find an example of RadGrid bound to sub-objects here.
Kind regards,
Ves
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
You can switch to Advanced Databinding. Please, find an example of RadGrid bound to sub-objects here.
Kind regards,
Ves
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
