We help IT Professionals succeed at work.

gridview1.Columns.Count

Mr_Shaw
Mr_Shaw asked
on
Medium Priority
431 Views
Last Modified: 2013-12-17
I have a gridview in which the columns are automatically created. Here is my code

        GridView_FrequentAtt_Pivot.DataSource = DS;
        GridView_FrequentAtt_Pivot.DataBind();

I am trying to count the number of columns using

Response.Write(GridView_FrequentAtt_Pivot.Columns.Count);

but it always returns the number 1.

I am not sure what is going on here
Comment
Watch Question

Dirk HaestProject manager
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT

Commented:
check
DS.Table(0).Rows.count

CERTIFIED EXPERT

Commented:
check
DS.Tables(0).Rows.count

Author

Commented:
yes I have 62 rows
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Author

Commented:
thanks
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.