Set a selectedvalue in a listbox list in a DataGrid

  • Thread starter Thread starter Do
  • Start date Start date
D

Do

Hi,

I have a datagrid that displays records
from a database.
On the edit command, I am trying to do something like this.

CType(dtgUsers.FindControl("rdoEAdmin"), RadioButtonList).SelectedValue =
True

But rdoEAdmin is only the name of the list. I have two items in the list
and want

to access their selected value properties. How do I access the list items?



Thanks,



Do
 
Do said:
Hi,

I have a datagrid that displays records
from a database.
On the edit command, I am trying to do something like this.

CType(dtgUsers.FindControl("rdoEAdmin"),
RadioButtonList).SelectedValue = True

But rdoEAdmin is only the name of the list. I have two items in the
list and want

to access their selected value properties. How do I access the list
items?

In order to select the first item:

CType(dtgUsers.FindControl("rdoEAdmin"),
RadioButtonList).Items(0).Selected = True

In order to get the index of the selected item:

CType(dtgUsers.FindControl("rdoEAdmin"),
RadioButtonList).SelectedIndex
 
Back
Top