i am binding a dictionary to radgridview at runtime using a converter sort shoul happen when i click on header columns.I attached sortdescriptor and column
descriptor but its not working any help highly appreciable and even i attached a event still result is same
CodeBehind(xaml.cs)
==========
public UserControl1()
{
InitializeComponent();
Dictionary<string, string> dict = new Dictionary<string, string>();
dict.Add(
"Name", "Muneer");
dict.Add(
"Age", "23");
dict.Add(
"Address", "Ameerpet");
Dictionary<string, string> dict1 = new Dictionary<string, string>();
dict1.Add(
"Name", "Nag Srinivas");
dict1.Add(
"Age", "24");
dict1.Add(
"Address", "Yousufguda");
lstDict1.Add(dict);
lstDict1.Add(dict1);
foreach (var dictionary in lstDict1)
{
foreach (KeyValuePair<string, string> pair in dictionary)
{
GridViewDataColumn dataCol = null;
dataCol = (
GridViewDataColumn)TableTypeChart.Columns[pair.Key];
if (dataCol == null)
{
dataCol =
new GridViewDataColumn();
dataCol.Header = pair.Key;
dataCol.UniqueName = pair.Key;
dataCol.SortMemberPath = pair.Key;
dataCol.Width =
new GridViewLength(75, GridViewLengthUnitType.Auto);
dataCol.DataMemberBinding =
new Binding()
{
Converter =
new DictionaryConverter(pair.Key)
};
TableTypeChart.Columns.Add(dataCol);
}
}
}
TableTypeChart.ItemsSource = lstDict1;
}
Xaml Page=========
<telerikGrid:RadGridView x:Name="TableTypeChart" d:LayoutOverrides="Width" ShowGroupPanel="False"
Background="{x:Null}" AlternateRowBackground="#FF1D1D1D" BorderBrush="Black"
Foreground="#FF000000" VerticalGridLinesBrush="Black" HorizontalGridLinesBrush="Black"
ColumnReordered="StandardGridView_ColumnReordered" Sorting="TableTypeChart_Sorting"
AutoGenerateColumns="False" IsFilteringAllowed="True" GroupPanelBackground="{x:Null}"
CanUserSortColumns="True" GroupPanelForeground="{x:Null}" CanUserFreezeColumns="False" CanUserReorderColumns="True" CanUserResizeColumns="True"
CanUserDeleteRows="False" CanUserInsertRows="False" CanUserSelect="True" RowIndicatorVisibility="Collapsed" d:IsHidden="True" />
Thanks and regards,
Munna