Control in DetailsView Template Row

J

Jim McGivney

Using VWD I have an aspx page with a GridView and DetailsView controls, each
using a different AccessDataSource.
The DetailsView is displayed with appropriate data when the user selects one
of the Grid's rows.
In the DetailsView I would like the user to be able to select the sex
(Female, Male, Unknown) by clicking a button on a RadioButtonList control.
To do this I make a template row for the DetailsView, I place a
RadioButtonList in the template. I assign the values: Female, Male and
Unknown to three different Buttons on the RadioButtonList.
I set the RadioButtonList datasource to the datasource used by the details
list.
When I run this, if the Sex field is used as a datafield for the Radio I get
one button with the appropriate sex but the other two buttons do not
display, if I don't indicate the datafield I get a button with the
inscription "System.Data.DataViewRow"
Please point me in the right direction. Should I use a different control
than the RadioButtonList ? How should I configure the datasource and
databindings.
Thanks in advance for your help,
Jim
 
R

Riki

Jim said:
Using VWD I have an aspx page with a GridView and DetailsView
controls, each using a different AccessDataSource.
The DetailsView is displayed with appropriate data when the user
selects one of the Grid's rows.
In the DetailsView I would like the user to be able to select the sex
(Female, Male, Unknown) by clicking a button on a RadioButtonList
control. To do this I make a template row for the DetailsView, I
place a RadioButtonList in the template. I assign the values:
Female, Male and Unknown to three different Buttons on the
RadioButtonList. I set the RadioButtonList datasource to the datasource
used by the
details list.

Either you add the 3 buttons statically, or you use a datasource,
but not both. Here, the former is better, unless you want to create
a table with only 3 items.
When I run this, if the Sex field is used as a datafield for the
Radio I get one button with the appropriate sex but the other two
buttons do not display, if I don't indicate the datafield I get a
button with the inscription "System.Data.DataViewRow"
Please point me in the right direction. Should I use a different
control than the RadioButtonList ? How should I configure the
datasource and databindings.

Just make sure you bind the SelectedValue property of the radiolist:
SelectedValue='<%# Bind("Sex") %>'
 

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

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,744
Latest member
CortneyMcK

Latest Threads

Top