如何使用 vb.net 在 Telerik RadComboBox 中动态加载学年?
问问题
548 次
1 回答
1
我找到了如何在telerik radComboBox中加载学年值的答案希望这对每个人都有用。
Dim dat As String = Month(Now()).ToString()
Dim fromdate As String
Dim todate As String
If Month(Now()) > 6 Then
fromdate = Year(Now()).ToString
todate = (Year(Now()) + 1).ToString
Else
fromdate = (Year(Now()) - 1).ToString
todate = Year(Now()).ToString
End If
txtacademicYear.Items.Insert(0, New RadComboBoxItem(Val(fromdate - 2).ToString + "-" + Val(fromdate - 1).ToString))
txtacademicYear.Items.Insert(1, New RadComboBoxItem(Val(fromdate - 1).ToString + "-" + fromdate))
txtacademicYear.Items.Insert(2, New RadComboBoxItem(fromdate + "-" + todate))
txtacademicYear.Items.Insert(3, New RadComboBoxItem(Val(fromdate + 1).ToString + "-" + Val(todate + 1).ToString))
txtacademicYear.Items.Insert(4, New RadComboBoxItem(Val(fromdate + 2).ToString + "-" + Val(todate + 2).ToString))
txtacademicYear.SelectedIndex = 2
于 2013-03-15T09:41:09.683 回答