R
RN
Hi. I used this article to add a template column to a datagrid that is
entirely created with code:
http://msdn.microsoft.com/library/d...emplatesprogrammaticallyindatagridcontrol.asp
It works fine except for one thing. My template column needs a field in the
recordset that binds to the datagrid. The template column is an HTML radio
button where the value of the radio button needs to be the ProductID field
in the recordset. As many of you may know, using radio buttons in a
datagrid invariably means using a template column, but the above code sample
doesn't help me understand how the "Case ListItemType.Item" section of code
(count 16 lines down their code sample) can possibly reference the field
name.
This "not so helpful" example puts "asdf" in the value field each time, but
it is not dynamic...
lc.Text = "<Input type=""Radio"" Name=""ProductID"" Value=""asdf"">"
BUT You obviously can't do:
lc.Text = "<Input type=""Radio"" Name=""ProductID"" Value=""" &
Container.DataItem("ProductID") ...
because Container.DataItem is not a recognizeable object in that section of
code (see 16 lines down the code sample in the article to see where I need
to reference the ProductID field of my dataset.
So how can I do this? Thanks.
entirely created with code:
http://msdn.microsoft.com/library/d...emplatesprogrammaticallyindatagridcontrol.asp
It works fine except for one thing. My template column needs a field in the
recordset that binds to the datagrid. The template column is an HTML radio
button where the value of the radio button needs to be the ProductID field
in the recordset. As many of you may know, using radio buttons in a
datagrid invariably means using a template column, but the above code sample
doesn't help me understand how the "Case ListItemType.Item" section of code
(count 16 lines down their code sample) can possibly reference the field
name.
This "not so helpful" example puts "asdf" in the value field each time, but
it is not dynamic...
lc.Text = "<Input type=""Radio"" Name=""ProductID"" Value=""asdf"">"
BUT You obviously can't do:
lc.Text = "<Input type=""Radio"" Name=""ProductID"" Value=""" &
Container.DataItem("ProductID") ...
because Container.DataItem is not a recognizeable object in that section of
code (see 16 lines down the code sample in the article to see where I need
to reference the ProductID field of my dataset.
So how can I do this? Thanks.