Silverlight DataGrid Control - How to stop sorting by column?

Continuing my problem from yesterday, the Silverlight datagrid from this problem now causes errors when sorting a column with a lot of data (for example, a text column containing a where clause for an SQL statement). When you sort, it will fire the SelectedIndexChanged event for the datagrid, and then try to stop anyway. If you click the title again, the stack will overflow.

Does anyone have an idea on how to stop the sorting of this control for a column? All other columns are sorted in order (but still getting ready for darn SelectedIndexChanged), but if I could turn off the whereClause column, that would be great.

Does anyone have a better idea on how to make this work?

+3
source share
3 answers

I am only familiar with the WPF version of this data file, but I will try:

<data:DataGridTextColumn CanUserSort="False" Header="First Name" Binding="{Binding FirstName}" />

Add the CanUserSort = "False" attribute for each column that you do not want to sort.

+2
source

Take a picture:

dataGridView1.Columns[*Numberofthecolumnyoudontwantsorted*].SortMode
= DataGridViewColumnSortMode.NotSortable;
0
source

@BKimmel - , silverlight , , . XAML sortmode , , - , silverlight.

, . - ?

0

Source: https://habr.com/ru/post/1697076/


All Articles