Solved

Binding Data to DropDownList in ItemTemplate

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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…
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…

820 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