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

Setting to current month

1 Answer 8 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 12 May 2008, 04:58 PM
hi

I have combobox drpmth that has a list of value:

01
02
03
04
05
07
08
09
10
11
12

And a combobox drpYear has value:

2008
2009
2010
2011
2012

In my codebehind:

drpYear.SelectedValue = Year(Now()).ToString
drpMth.SelectedValue = Month(Now).ToString

The drpYear works fine but not drpMth. Am I missing something? Thanks

1 Answer, 1 is accepted

Sort by
0
Accepted
Simon
Telerik team
answered on 13 May 2008, 06:48 AM
Hi Lui Nai Wah,

Is it that you have missed the brackets in the second statement?

drpYear.SelectedValue = Year(Now()).ToString 
drpMth.SelectedValue = Month(Now()).ToString 

Another reason could be that there are no values for the Items in the month RadComboBox but only text.

Best wishes,
Simon
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
L
Top achievements
Rank 1
Answers by
Simon
Telerik team
Share this question
or