开发者

selection index change is not working of drop down list [closed]

开发者_如何学运维 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

i have only one element in drop downlist so selection index change is not working... the datasource is given to run time... if it was on designing time i can give the select one list item... but at run time what should i do????????


if i've understood correctly your problem you can you add an empty item at design time , set the append databound item to true and selected property of the empty item to true


In your code when filling the list, check how many items there are, and if it is only one, manually call the method that the selected index changed event is hooked up to.


You want to call SelectedIndexChanged Event? I'm right?

If so, just do this:

private void callSelectedIndex()
{
    ComboBox cb = new ComboBox(); // Some ComboBox control to pass.
    comboBox1_SelectedIndexChanged(cb, null); // Your ComboBox's SelectedIndexChanged event method.
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜