Set a selectedvalue in a listbox list in a DataGrid

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
 
J

Jos

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top