Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Getting dataset field name from grid's column

0 views
Skip to first unread message

Robert K.

unread,
Mar 8, 2003, 7:26:15 PM3/8/03
to
I binf my grid to dataset. In my scenario, a user selects a row in a grid by
clicking on a ButtonColumn. In SelectedIndexChanged I want to loop through
the grid columns (e.Item.Cells[n]), but I want to find out which cell
corresponds to which field in my DataSet. How do I do that?

Thanks


Ben Miller [msft]

unread,
Mar 13, 2003, 6:50:59 PM3/13/03
to
My hunch would be that if you had the fieldnames in the HeaderText
(autogeneratecolumns=true), then you could do something like this:

DataGrid1.Columns[index].HeaderText

This would give you what is in the HeaderText of the datagrid, and if that
is the field name, then you are good to go.

HTH.
Ben Miller

--
This posting is provided "AS IS" with no warranties, and confers no rights.


"Robert K." <rob...@nospam.com> wrote in message
news:HSvaa.8494$3g.16...@newssrv26.news.prodigy.com...

0 new messages