GridView AutoGenerateColumns not working

  • Thread starter Thread starter Aamir Ghanchi
  • Start date Start date
A

Aamir Ghanchi

Hello,

I would like to hear if any one else is having the same problem. The
AutoGenerateColumns property is set to true. I can read the data right
and can loop through the datasource's columnscollection and get the
row count, but for some reasons the gridview does not get autopoulated
with the results. The Gridview is bound to objectdatasource and I can
see all the events firing as follows when I trace:
objdsCourseMatrix_Selecting
objdsCourseMatrix_Selected
gvCourseMatrix_DataBinding
gvCourseMatrix_DataBound
This was originally a .Net 1.1 project imported now into 2.0
Any ideas will be appreciated.

thanks.
 
Answering my own post for the benefit of others.
The default value of AutoGenerateColumns property of gridview is true
as it shows up in the proprty window, but my suggestion is : Don't
count on it.
I manually added the AutoGenerateColumns attribute in the asp:GridView
element on the html page and its is now showing all the returned
columns without . I don't know how long it will stay there as it gets
reset (removes) from the html code when I do other changes to the
gridview or switch back & forth between the designer and the source.
 
Thank you for sharing


Aamir Ghanchi said:
Answering my own post for the benefit of others.
The default value of AutoGenerateColumns property of gridview is true
as it shows up in the proprty window, but my suggestion is : Don't
count on it.
I manually added the AutoGenerateColumns attribute in the asp:GridView
element on the html page and its is now showing all the returned
columns without . I don't know how long it will stay there as it gets
reset (removes) from the html code when I do other changes to the
gridview or switch back & forth between the designer and the source.
 
Back
Top