I remember attempting to do the same thing that you are trying to do. I discovered that it isn't possible..and at one point had a good reason as to why this is but can't remember it off the top of my head.
Because the controls are dynamically given an ID anyways, why don't you just give the CheckBox an ID like "ChkboxAdd", and include a hidden column called something like "DFNumber" that will keep track of what DFNumber you are "adding".
EG
-
<asp:TemplateField Visible="False" HeaderStyle-CssClass="SpreadSheetHeader" ItemStyle-CssClass="SpreadSheetCell" ShowHeader="True" HeaderText="Add to Cart / Qty" >
-
<ItemTemplate>
-
Add?<asp:CheckBox ID='ChkboxAdd' CssClass="chkOrder" runat="Server" />
-
Qty:<asp:TextBox CssClass="txtBoxQuantity" ID="txtQuantity" runat="server"></asp:TextBox>
-
</ItemTemplate>
-
</asp:TemplateField>
-
<asp:BoundField Header="DFNumber" DataField="DFNumber ">
-
<ItemStyle CssClass="noShow" width="0px">
-
<HeaderStyle CssClass="noShow" width="0px">
-
</asp:BoundField>
-
Then in your code that does "stuff" loop through the rows in the gridview, grab the checkbox check value and the DFNumber for that row....and do your processing on that:
-
For Each dr In MyGridView.Rows
-
Dim chkBox as CheckBox=Ctype(dr.FindControl("ChkboxAdd"),Checkbox)
-
If chkbox.checked = true then
-
'Here retrieve the DFNumber for the row that has been "checked".
-
End If