DataGrid.Column.Count is empty?

S

SK

Hello,

I have created my own datagrid control, derived from
datagrid. Now my webform uses this datagrrd and calls the
ItemDataBound method, which then SHOULD loop through the
columns, but it always shows me that the columns count is
0. Although I can see several columns in the webbrowser.
Now, I would like to know why it always shows 0?

Any help is very appreciated.
 
M

Mark Fitzpatrick

Mostly because you're still in the process of binding. The column count
isn't really finalized until databinding has been finished. Try testing the
column count of the grid after calling the databind() method.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
M

MattC

Are you using autogenerated columns, if there will be no entry in the
columns collection of the datagrid.

MattC
 

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

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top