how to access column property in gridview

M

Mukund Patel

Hi,

My gridview has auto generated columns. I mean there is no column at design
time. At run time there are seven column. But I cant access any column at
run time.

Gridview1.columns.count return 7 but Gridview1.columns[0].HeaderText throws
the exception. Is there any way to access column property of the gridview
which has autogenerated columns?

Thaks


--

----------------------------------------------------------------
Mukund Patel
Sr. Software Engineer
IntraAction Software
Ahmedabad, India
PH: 9426501727
 
M

Mohamed El Ashmawy

Did you try to use the DataGridCommandEventArgs object that is called on
the datagrid events.
You could use e.item to get the current row.
You could then call the cells where each cell is a column that you have.
Does this help doing what you need to do?

Regards
Mohamed El Ashmawy
MEA Developer Support Center
ITWorx on behalf of Microsoft EMEA GTSC
 

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
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top