Can't find "DataField" as readable property on any GridView child

Giganews Newsgroups
Subject: Can't find "DataField" as readable property on any GridView child
Posted by:  Larry Epn (larrye…@noemail.noemail)
Date: Thu, 14 Feb 2008

The GridView has Rows and Columns, however no matter how much I search the
control hierarchy, I can't find anything that lets me identify a particular
cell or column by testing for the value of the "DataField" property that was
set when the BoundField was defined.  For example:

<asp:GridView ID="GridView1" runat="server"
OnRowCreated="GridView1_RowCreated" >
<asp:BoundField DataField="dfX" HeaderText="X"/>
<asp:BoundField DataField="dfY" HeaderText="Y"/>

Now, in the codebehind, please look for a way to find a column based upon
its value for the "BoundField" property being equal to either "dfX", or
"dfY".  I can't find it.  Spent hours searching.  Hope I'm just stupid or
blind...  I don't want to find the columns index based upon the HeaderText
(done that already) because it is possible for the HeaderText to be duplicate
for two fields populated by two different datafields.

        protected void GridView1_RowCreated(Object sender,
GridViewRowEventArgs e)
// where is the e.Row.Cells[0].DataField property??? (or anything like that
that will get me a handle to the DataControlFieldCell or equivalent)

Thanks for any help.