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

problem auto generate columns

1 Answer 138 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ali
Top achievements
Rank 1
ali asked on 28 Apr 2011, 05:04 PM
i write blow code:

 grdusers.MasterGridViewTemplate.AutoGenerateColumns = false;
 grdusers.MasterGridViewTemplate.LoadFrom(LoadData());

but line 1 not working and display other fields that i dont want
help me very soon
my telerik is q1 2010 sp1

1 Answer, 1 is accepted

Sort by
0
Accepted
Emanuel Varga
Top achievements
Rank 1
answered on 29 Apr 2011, 11:54 AM
Hello ali,

Sorry for the late reply,

Please try clearing the columns before setting AutoGenerateColumns = false;
radGridView1.MasterTemplate.Columns.Clear();
//or
radGridView1.Columns.Clear();

I cannot see here where are you setting the DataSource for the grid, if you are setting the data source before this the grid could have already generated the columns at the point you are setting the auto generate columns to false.

Hope this helps, if you have any other questions or comments, please let me know,

(Off topic and please don't take it the wrong way: the first line was really fun to read :)))

Best Regards,
Emanuel Varga

Telerik WinForms MVP
Tags
GridView
Asked by
ali
Top achievements
Rank 1
Answers by
Emanuel Varga
Top achievements
Rank 1
Share this question
or