This is a migrated thread and some comments may be shown as answers.

Can not update DropDownList

1 Answer 59 Views
DropDownList
This is a migrated thread and some comments may be shown as answers.
Sebastian
Top achievements
Rank 1
Sebastian asked on 17 Jun 2014, 11:12 AM
Hello,
I have problem with population DropDownList few times... First time is working, than I get first element choosed but rest of the list is empty:

                MainProgram.myConnectionHelper.Connection.Open();
                SqlCommand myCommand = new SqlCommand("SELECT Twr_Kod, Twr_Nazwa FROM Seven.TwrKarty WHERE Twr_Kod = 'W01 'or Twr_Kod = 'W06';", MainProgram.myConnectionHelper.Connection);
                //ddlRodzajMiesa.BeginUpdate(); 
                //ddlRodzajMiesa.DropDownStyle = RadDropDownStyle.DropDown;
                ddlRodzajMiesa.DataSource = null;
                ddlRodzajMiesa.ValueMember = "Twr_Kod";
                ddlRodzajMiesa.DisplayMember = "Twr_Nazwa";
                ddlRodzajMiesa.DataSource = myCommand.ExecuteReader();
                ddlRodzajMiesa.SelectedValue = 0;
                //ddlRodzajMiesa.DropDownStyle = RadDropDownStyle.DropDownList;
                //ddlRodzajMiesa.EndUpdate();
                MainProgram.myConnectionHelper.Connection.Close();



Thanks for any help in advance...







1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 20 Jun 2014, 09:42 AM
Hi Sebastian,

Thank you for writing.

I was not able to reproduce the observed behavior. This is why I attached my test project. Could you please check it and let me know how it differs from your real setup? 

I am converting this Forum thread into a support ticket in order to allow attachments.You can find it in your Telerik account.

I am looking forward to your reply.

Regards,
Dimitar
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
DropDownList
Asked by
Sebastian
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or