Is there any way to specify the column type and/or templates/editors for a column when autogenerating columns?
I am currently using the DisplayAttribute and a custom attribute with a behavior to manage column specific things that the DisplayAttribute does not support. If there is no way to support this, I figure I could add a TemplateSelector type to the GridColumnDisplayAttribute for the edit template. If this is the only way are there any links/projects showing how I can achieve this for complex controls and bindings like an autocomplete?
An example of what I am using now:
01.
private
bool
isSelected =
true
;
02.
[Display(Name =
"Selected"
, Order = 0)]
03.
[GridColumnDisplay(CanHide =
false
, Width = 25, Resizeable =
false
, TextAlignment = TextAlignment.Center)]
04.
public
bool
IsSelected
05.
{
06.
get
=> isSelected;
07.
set
=>
this
.SetValue(
ref
isSelected, value);
08.
}
09.
10.
private
string
name;
11.
[Display(ResourceType =
typeof
(Resources.Properties.Resources), Name = ResourceKeys.GridHeader_AccountName)]
12.
public
string
AccountName
13.
{
14.
get
=> name;
15.
set
=>
this
.SetValue(
ref
name, value);
16.
}
1.
<
telerik:RadGridView
ItemsSource
=
"{Binding Accounts}"
>
2.
<
i:Interaction.Behaviors
>
3.
<
gridBehaviors:GridColumnsBehavior
/>
4.
</
i:Interaction.Behaviors
>
5.
</
telerik:RadGridView
>
Thanks,
Maurice