column count

A

anonymou

I have questions regarding data grid control. I am binding
the data at run time to the data grid.
How can I find out number of columns after binding? What
even would handle this?
My binding:
grdTransaction.DataSource = DataSet
grdTransaction.DataBind()
Column: grdTransaction.Columns.Count.ToString
 
E

Eliyahu Goldin

This will work only for the columns you specify explicitly. AutoGenerated
columns are not listed in Columns property. You have to access the
datasource for any info about them.

Eliyahu
 

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

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top