GridView AutoGenerateColumns not working

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.
 
A

Aamir Ghanchi

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.
 
I

IfThenElse

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top