combo box property in asp.net

Posted by Mahesh.d16 under Interview Questions on 3/9/2011 | Points: 10 | Views : 1359 | Status : [Member] | Replies : 6
hi forum.

i dunno exact q asked in interview but i tried my best to remember

what property is assigned to combo box before assigning it to a data source property

i think the q was little lengthy than this one but it was somewhat like above.




Responses

Posted by: Raja on: 3/9/2011 [Member] Starter | Points: 25

Up
0
Down
Your answer should be DataTextField and DataValueField . DataTextField is basically the field that shows in the DropDown item and DataValueField is the field that is set as value for the items.

You should assign these two fields for the DropDownList before assigning to a DataSource otherwise you will not get desired results.

Thanks

Regards,
Raja, USA

Mahesh.d16, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 3/9/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Nicely explained Raja :)

Thanks and Regards
Madhu

Mahesh.d16, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 3/10/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
Raja,

without giving DataTextField and DataValueField does the binding will not work out?

Thanks
Karthik
www.f5Debug.net

Mahesh.d16, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sathya4260 on: 3/10/2011 [Member] Starter | Points: 25

Up
0
Down
I think it would bind, only the expected values is not displayed...

Sathish Kumar S

Mahesh.d16, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 3/10/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
If the datatable to bind has one column then no need to specify it takes by default...

Thanks and Regards
Madhu

Mahesh.d16, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Karthikanbarasan on: 3/11/2011 [Member] [Moderator] [Microsoft_MVP] [MVP] Silver | Points: 25

Up
0
Down
ok got it... thanks satya and madhu

Thanks
Karthik
www.f5Debug.net

Mahesh.d16, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response