This is a migrated thread and some comments may be shown as answers.

Radgrid Form Template DropDownList

5 Answers 313 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Hildebrand
Top achievements
Rank 1
Steve Hildebrand asked on 24 May 2010, 04:32 AM
I have a radgrid, using form template for update/insert/delete.  I have a drop down list that is populated from another database and I preselect the value fine.  However, since the dropdown is loaded in the itemdatabound of the radgrid, I'm having trouble doing two-way databinding.  When I do the update button, all fields are updated in the database except the dropdownlist.  Is there a way to fix this?

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 24 May 2010, 07:59 AM
Hello Steve,

Have you set the SelectedValue property of DropdDownList?
               SelectedValue='<%# Bind("TitleOfCourtesy") %>'

The demo shows how to use DropDownList in FormTemplate.

Could you provide some more information about your scenario if this does not help?

Regards,
Princy.
0
Steve Hildebrand
Top achievements
Rank 1
answered on 24 May 2010, 11:28 AM
The demo works fine for a dropdown that is built staticly.  If I used the selectedvalue property it throws the error saying the item doesn't exist in the list.  This is because the data hasn't been built yet, since it's built in the itemdatabound method of the grid.
0
Mira
Telerik team
answered on 27 May 2010, 08:14 AM
Hello Steve,

I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality could be achieved. You can find it attached to this post.

Please, take a look at it and let me know whether it helps.

All the best,
Mira
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Steve Hildebrand
Top achievements
Rank 1
answered on 10 Jun 2010, 05:14 AM
Mira, you example worked.  Thank you very much.  However, I have another problem.  I'm using automatic updates from a template.  Since I have the radcombobox loading in the itemdatabound, I don't have a way to do two-way databinding.  Is there a way to force the combo box to be seen as the db field or is there a way to set the update parameter of the sqldatasource to the selected value of the radcombobox?
0
Mira
Telerik team
answered on 11 Jun 2010, 01:57 PM
Hello Steve,

To achieve the desired functionality, I recommend that you update the DataSource manually.
For additional information, please take a look at the Updating values using UserControl/FormTemplate help topic.

All the best,
Mira
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Steve Hildebrand
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Steve Hildebrand
Top achievements
Rank 1
Mira
Telerik team
Share this question
or