オブジェクトの情報をSelectedIndexChanged
にしたい、リストボックスでバインドしました。ListBoxでバインドしたSelectedIndexChangedイベントで同じオブジェクトを取得する方法
listbox.bind=list of person object
forexample
は今のListItemの各リスト上の人物オブジェクトがあり、私はのSelectedIndexChangedイベントでこの人物オブジェクトが必要です。
protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
//here is the compatibility issue
//how can i solve this
person ss = ListBox1.SelectedItem as Person;
}
あなたは[ListBox1.SelectedIndex] '私はselectedchangeイベントにコードを確認して –