4 Answers, 1 is accepted
0
Hello,
You can use ItemPropertyInfo argument of AutoGeneratingColumn event - args.ItemPropertyInfo.PropertyType .
I hope this helps.
Regards,
Yoan
Telerik
You can use ItemPropertyInfo argument of AutoGeneratingColumn event - args.ItemPropertyInfo.PropertyType .
I hope this helps.
Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
W
Top achievements
Rank 1
answered on 29 Apr 2016, 01:49 AM
Not PropertyType.
GridViewColumn.ItemType's summary : Gets the type of the item that the field belongs to.
GridView's items or ItemsSource is IEnumerable<T> or DataItemCollection or some type else.
How to get the item type "T" in AutoGeneratingColumn?
Is there any way to get "T" direct, not judge by GridView's items or ItemsSource?
0
Accepted
Hello,
I am afraid that you can not use the ItemType property of GridViewColumn in AutoGeneratingColumn. However, you can use the GridView's Items property. In fact, the GridViewColumn.ItemType property is using a similar approach:
However, ElementType is internal, so you can't use it directly.
Regards,
Yoan
Telerik
I am afraid that you can not use the ItemType property of GridViewColumn in AutoGeneratingColumn. However, you can use the GridView's Items property. In fact, the GridViewColumn.ItemType property is using a similar approach:
/// <
summary
>
/// Gets the type of the item that the field belongs to.
/// </
summary
>
/// <
value
>The type of the item.</
value
>
public virtual Type ItemType
{
get
{
if (this.DataControl != null)
{
return this.DataControl.Items.ElementType;
}
However, ElementType is internal, so you can't use it directly.
Regards,
Yoan
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
W
Top achievements
Rank 1
answered on 06 May 2016, 08:14 AM
Thank you for answer me!
But "ElementType" is not public.So that only judged indirectly.