This is a migrated thread and some comments may be shown as answers.

[Solved] How to bind celltype from code

1 Answer 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
xp
Top achievements
Rank 1
xp asked on 03 Jun 2009, 03:02 PM
Since all of data are dynamical generated, so Columns in gridview are different every time, and it is unable for us create Style from Xaml.

How can we create it from code? How to find the column datatype after ItemsSource has already been set?

Thanks

1 Answer, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 04 Jun 2009, 01:32 PM
Hi sam,

You can set AutoGenerateColumns property to false. Then in the code behind you should add your GridViewDataColumn to the Columns collection of the GridView. This will allow you to set the DataType to the correct type from code behind.

Greetings,
Stefan Dobrev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
xp
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Share this question
or