DataGrid question

S

Steve Caliendo

Hi,

I am populating a DataGrid using an SQLDataReader. My question is:

How can I change the properties of a column, or get the data from a field
after the DataBind method?

When I try to reference a column, I get the error that the index must be
non-negative and less then the size of the collection. I know that there
are multiple columns because the DataGrid displays correctly.

Thanks,

Steve
 
C

Cowboy \(Gregory A. Beamer\)

Use the binding event on the DataGrid to hijack setting column values. This
allows you to easily change as the data is bound. There is a slight expense,
compared to straight binding, but it is less error prone than attempting to
get rows.

NOTE: The issue with rows may be where you are attempting to change the row
(ie, in what event). You have to play with adjustments after the data is
bound if you wish to grab rows from the DataGrid.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
 

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,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top