Hi,
I am using the example I found here to dinamically insert values into RadGridView. However, this example does not allow controling the properties of the generated columns like "IsFilterable" or "IsGroupable".
To implement this functionality, I modified the RadGridView to allow the indication of Column Definitions.
When the ColumnDefinitions property is changed, the following code is executed:
I am using the example I found here to dinamically insert values into RadGridView. However, this example does not allow controling the properties of the generated columns like "IsFilterable" or "IsGroupable".
To implement this functionality, I modified the RadGridView to allow the indication of Column Definitions.
When the ColumnDefinitions property is changed, the following code is executed:
static
void
ColumnDefinitionsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
var gridView = sender
as
i9rGridView;
gridView.Columns.Clear();
var columnDefinitions = e.NewValue
as
ObservableCollection<IAttributeDefinition>;
if
(columnDefinitions !=
null
&& columnDefinitions.Count > 0)
{
gridView.AutoGenerateColumns =
false
;
foreach
(var columnDefinition
in
columnDefinitions)
{
gridView.Columns.Add(
new
GridViewDataColumn() { HeaderCellStyle = Application.Current.Resources[
"GridViewHeaderCellStyle"
]
as
Style, UniqueName = columnDefinition.Code, Header = columnDefinition.Text, DataType = columnDefinition.DataType, IsReadOnly = columnDefinition.AccessLevel != AccessLevel.EDITABLE ?
true
:
false
, IsVisible = columnDefinition.AccessLevel != AccessLevel.INVISIBLE ?
true
:
false
, IsGroupable =
false
});
}
}
}
All the properties work like I want but "IsGroupable = false" is ignored and all the columns allow grouping.
How can I solve this issue?