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
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.
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....
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.