Solved

Binding Data to DropDownList in ItemTemplate

Posted on 2007-11-16
2
2,056 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

867 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now