Sreenath G

Sreenath G

  • NA
  • 233
  • 310.6k

Keeping selected item focused in listbox after postback

Jun 23 2011 8:07 AM
 

I have a listbox with items been filled during runtime. Here how can I keep focus on the selected items in the listbox after postback. I have set multiple selection for the listbox.

 

I don't want use coding like this to keep focus every time

 

int lIntOldIndes = ListBox1.SelectedIndex;

                ListBox1.Focus();

                ListBox1.SelectedIndex = lIntOldIndes;

 

Any suggestions please.

 

Thanks

Sreenath


Answers (2)