dear all..
I'm using vs 2003
and i was generate one combobox on runtime...
i set DropDownStyle become System.Windows.Forms.ComboBoxStyle.DropDownList
my problem is, i wanna set default value to that combo using combobox.SelectedValue..
but it doesn't work..
on combobox doesn't appear any value
is there any condition which should fulfilled to make selectedValue work?
thanks in advance
sherly
AD
Administrator
Syncfusion Team
June 25, 2008 12:15 PM UTC
Hi Sherly,
Thank you for using Syncfusion products.
I am afraid that I was not able to see the issue of
Selectedvalue on comboboxadv doesn't work . Please refer the simple sample below and let me know the Essential Studio version you are using.
http://websamples.syncfusion.com/samples/Tools.Windows/F74692/main.htmRegards,
Jaya
SN
Sherly Numawaty
June 26, 2008 02:40 AM UTC
Hi Jaya
thanks for ur reply
i'm using .net framework 1.1, and using syncfusion 5.201.0.25
is any problem with above version?
thanks sherly
SN
Sherly Numawaty
July 1, 2008 03:08 AM UTC
Hi Jay
i've tried this code
this.comboBoxAdv1.SelectedValue = 2;
this.comboBoxAdv1.DataSource = dt;
this.comboBoxAdv1.DisplayMember = "Name";
this.comboBoxAdv1.ValueMember = "PreName";
this.comboBoxAdv1.DropDownStyle = ComboBoxStyle.DropDownList;
actually i want to select the second value on list...
but i think it's doesnt work
thanks
sherly
AD
Administrator
Syncfusion Team
July 1, 2008 07:04 AM UTC
Hi Sherly,
Please use the codesnippet below to display the second item (Mark) of ComboBoxAdv as SelectedValue.
[C#]
this.comboBoxAdv1.SelectedValue = "Tucker";
Please let me know if this helps you.
Regards,
Jaya
SN
Sherly Numawaty
July 2, 2008 01:51 AM UTC
Hi Jaya...
here i attach u my code..
it doesnt work
sherly
combo_c922ad01.zip
SN
Sherly Numawaty
July 2, 2008 09:39 AM UTC
hi jaya...
thanks for all...
I've got the problem n has solved..
i should set selectedValue after i add that control to form...
comboBoxAdv1 = new ComboBoxAdv();
DataTable dt = TableEmp();
this.comboBoxAdv1.DataSource = dt;
this.comboBoxAdv1.DisplayMember = "Name";
this.comboBoxAdv1.ValueMember = "PreName";
this.comboBoxAdv1.DropDownStyle = ComboBoxStyle.DropDownList;
this.comboBoxAdv1.Location = new Point(113,57);
this.Controls.Add(comboBoxAdv1);
comboBoxAdv1.SelectedValue = "Tucker";
AD
Administrator
Syncfusion Team
July 7, 2008 07:22 AM UTC
Hi Sherly,
Thanks for the update. Please let me know if you have any further issues.
Regards,
Jaya