Solved

Binding Data to DropDownList in ItemTemplate

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
ASP.NET e-commerce website 4 30
Trouble with References... 5 25
.Net application crashing 6 21
Change data in datatable 8 18
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…
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…

746 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

10 Experts available now in Live!

Get 1:1 Help Now