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

Sorting Problem in CellTemplate Column

4 Answers 80 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Nirmal
Top achievements
Rank 1
Nirmal asked on 06 Apr 2010, 02:25 PM
Hai,
    I am using RadGridView. In that i have CellTemplate and CellEditTemplate(TextBlock is inside) in a Column. On that column sorting is not working. But in the Grid Properties i used CanUserSortColumns="True". How can i sort that Column.

Thanks in Advance.

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Apr 2010, 02:29 PM
Hi Nirmal,

Do you have DataMemberBinding set for this column?

Best wishes,
Vlad
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.
0
Nirmal
Top achievements
Rank 1
answered on 06 Apr 2010, 02:33 PM
No,
   using,       

<

 

telGrid:GridViewDataColumn x:Name="Name" IsReadOnly="False" Width="285" Header="Name">

 

 

 

<telGrid:GridViewDataColumn.CellTemplate>

 

 

 

<DataTemplate>

 

 

 

<TextBlock Margin="2,0" Visibility="Visible"

 

 

 

Text="{Binding Name, Mode=TwoWay, NotifyOnValidationError=true,ValidatesOnExceptions=true}" Width="285"></TextBlock>

 

</DataTemplate>

 

 

 

</telGrid:GridViewDataColumn.CellTemplate>

 

 

 

<telGrid:GridViewDataColumn.CellEditTemplate>

 

 

 

<DataTemplate>

 

 

 

<TextBox Margin="2,0" Visibility="Visible"

 

 

 

Text="{Binding Name, Mode=TwoWay, NotifyOnValidationError=true,ValidatesOnExceptions=true}" Width="280" MaxLength="50"></TextBox>

 

</DataTemplate>

 

 

 

</telGrid:GridViewDataColumn.CellEditTemplate>

 

 

 

</telGrid:GridViewDataColumn>

like this....

 

 

 

 

 

0
Jerry Kurata
Top achievements
Rank 1
answered on 02 Jun 2010, 11:20 PM
I am having a similar issue with my grid.  All of my columns have data templates defined and no DataMemberBinding.    Both default and custom sorting are not available.

Is there a solution?

Jerry

0
Accepted
Vlad
Telerik team
answered on 03 Jun 2010, 06:51 AM
Hello Jerry,

Yes! You can set DataMemberBinding to desired property and you will able to sort. This will not mess your templates in any way.

Best wishes,
Vlad
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.
Tags
GridView
Asked by
Nirmal
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Nirmal
Top achievements
Rank 1
Jerry Kurata
Top achievements
Rank 1
Share this question
or