Solved

Binding Data to DropDownList in ItemTemplate

Posted on 2007-11-16
2
2,057 Views
Last Modified: 2008-02-05
Hi all,

I have a grid with editable dropdownlist. I would like to bind data consisting of numbers (using FOR loop) to the dropdownlist which is not retrieved from the database but from a function. Only the specific row's value is retrieved from the database.

Secondly, in the Insert form there are two dropdowns from one column. This works quite fine while inserting, but while editing how do I bind one part of the data to one dropdown and the other part to the other dropdown.

For example:

this is the data => 12:54. In the database, it is stored in one column.

While editing, 12 should be bind to one dropdown and the 54 should bind to another dropdown while updating the table.

I hope I have been clear in asking the question.

Thanks in advance.
0
Comment
Question by:digitalZo
2 Comments
 
LVL 22

Accepted Solution

by:
DarkoLord earned 500 total points
ID: 20304044
Hi,

1. You can select the data to a temporary DataTable, modify the data and then bind it to the DropDownList

2. If you're using SQLDataSource (or similar), you can use the datasource's Updating event to modify the values of the parameters right before the sql query gets executed.

Regards,
Darko
0
 
LVL 10

Author Comment

by:digitalZo
ID: 20310957
Hi,

Thanks for the response. Can you provide some kinda example for both the problems?
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question