Solved

binding  combobox cannot save value into the table

Posted on 2008-10-23
2
350 Views
Last Modified: 2012-05-05
         <asp:DropDownList ID="DropDownList3" runat="server"
                DataSourceID="insert_billing_categorysource" DataTextField="category_descrip"
                DataValueField="category_id" AutoPostBack="True"
                SelectedValue='<%# Bind("category") %>'
                onselectedindexchanged="DropDownList3_SelectedIndexChanged1" style="height: 22px;"
                >
            </asp:DropDownList>



why can i  save the value of catery into my table using bind what is my problem?
0
Comment
Question by:neil17317
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
jinn_hnnl earned 500 total points
ID: 22784571
What do you mean you want to save value into the table?

You mean you can not set the selected value using Bind("category")??? If so, you can try do it from your code behind where you have full control and manipulation

Let say in Page_Load:
DropDownList3.SelectedValue = Convert.ToString(DropDownList1.Items.FindByText("anyvalue").Value)  ;

JINN
0
 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 22848254
In addition you can better switch around with FindByText or findByValue depend on the matching key that you want

string ddl1Selected = DropDownList1.Items.FindByText("anyvalue").Value;
DropDownList3.ClearSelection();
DropDownList3.Items.FindByValue(ddl1Selected).Selected = true;

JINN
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

726 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