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

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,247
Latest member
crypto tax software1

Latest Threads

Top