Sid,
when you add controls to a datagrid you can't access them
programmatically by referring to their IDs directly.
At run time you can access the control by first
retrieving it from the datagrid cell.
A good time to do this is within the item_databound or
the item_created events of the datagrid; see the
following code example:
[C#]
private void onItemCreated(object
sender,System.Web.UI.WebControls.DataGridItemEvent Args e)
{
DropDownList c =
(DropDownList)e.Item.Cell[0].Controls[0];
c.DataSource = yourdatareader;
//etc
}
regards,
alex
-----Original Message-----
Hi All,
I am trying to populate a dropdown list in my Datagrid
control using the OleDbDataReader, but when my function
tries to add items to the dropdownlist it says that my
dropdownlist control has not been 'declared' even though
it is set to runat="server" .
Any ideas?
.