Hi Brian,
It is absolutely possible.
However, unless you have some special requirement, in most
case it's not necessary. Because even you assign a static
id to any control in the datagrid, you can easily get its
reference in many events such as datagrid_ItemCommand,
datagrid_UpdateCommand, datagrid_EditCommand, and so on,
by e.Item.FindControl("staticID").
Anyway, following code snippet shows how to dynamically
assign id to RadioButtonList in datagrid_ItemCreated event
foreach (Control ctrl in e.Item.Cells
[rblColIndex].Controls )
{
string ctrlName = ctrl.GetType().FullName;
if (ctrlName.Equals
("System.Web.UI.WebControls.RadioButtonList"))
{
ctrl.ID = assignID;
}
}
Elton Wang
el********@hotmail.com -----Original Message-----
I have a datagrid that is listing a bunch of questions
from my DB.. Iam creating a radiobuttonlist for each question to give
me a yes or noanswer. I would like to use the "QuestionCode" column
from thatdatabase to assign the radiobuttonlist ID. Is this
possible??????
.