Changing the TextAlignment property of the GridViewExpressionColumn doesn't refresh the cells, thus the change is not visible in the UI.
To work this around, remove and add again the corresponding column in the Columns collection of RadGridView. Or define a CellTemplate and use a TextBlock control with its TextAlignment bound to the column's property.
<telerik:GridViewExpressionColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding}"
TextAlignment="{Binding RelativeSource={RelativeSource AncestorType=telerik:GridViewCell}, Path=Column.TextAlignment}" />
</DataTemplate>
</telerik:GridViewExpressionColumn.CellTemplate>
In this particular case, the DisplayIndex properties of the parent and child grid are bound to property from our ViewModel. When the parent grid columns are reordered runtime, the columns of the child grid are also reordered. But when sorting is performed by clicking on a column header, an exception is thrown.
Memory leak appears when exporting to Xlsx and Pdf formats.
To work this around, you can call one of the export methods GridViewDataControlExportExtensions with empty arguments.
Workbook workbook = this.gridView.ExportToWorkbook();
try
{
GridViewDataControlExportExtensions.ExportToWorkbook(new RadGridView(), new GridViewDocumentExportOptions());
GridViewDataControlExportExtensions.ExportToWorkbook(null);
}
catch (ArgumentException)
{
}
If the DisplayIndex of the columns is set when they are initialized, ColumnGroups are not displayed.
As a workaround, you can set the DisplayIndex after the columns are initialized.
Hello
I have often faced a scenarion where I have groups (GroupDescriptor), but those groups need to be ordered by a different property.
Usually, telerik column properties already provide a SortMemberPath.
<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" SortMemberPath="Id"
However, the GroupDescriptor does not have that, it only has Member and SortDirection.
The only way to set the sort to refer another property is in code behind using a generic group descriptor. It is very flexible, but it has several drawbacks, since now I'd have to declare everything in C# (aggregate functions, templates, etc) and also lose the Design time feedback from Visual Studio.
My request is to just have the possibility to set a SortMember in XAML which will work for most scenarios, same way as others components already do.
<telerik:GroupDescriptor Member="OrderState" SortDirection="Ascending"
SortMember="OrderStateIndex" >
Thanks