How to save and display a sorted ListBox Control??
-
Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from an SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstAssoc.SelectedIndex; string str = lstAssoc.SelectedItem.ToString(); if (i > 0) { lstAssoc.Items.RemoveAt(i); lstAssoc.Items.Insert(i - 1, str); lstAssoc.SelectedIndex = i - 1; } } ------------------- Redcastle CRM
-
Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from an SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstAssoc.SelectedIndex; string str = lstAssoc.SelectedItem.ToString(); if (i > 0) { lstAssoc.Items.RemoveAt(i); lstAssoc.Items.Insert(i - 1, str); lstAssoc.SelectedIndex = i - 1; } } ------------------- Redcastle CRM
Posted in multiple forumns :omg: http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2678901
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
-
Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from an SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstAssoc.SelectedIndex; string str = lstAssoc.SelectedItem.ToString(); if (i > 0) { lstAssoc.Items.RemoveAt(i); lstAssoc.Items.Insert(i - 1, str); lstAssoc.SelectedIndex = i - 1; } } ------------------- Redcastle CRM
-
Hi I have a query with the ListBox control. I have two pages on my web app, a main page and a sort page. The main page contains a table populated with names from an SQL database. The sort page contains a ListBox with all the names from the main page and 2 buttons, Up and Down. The user can move the names Up and Down by clicking the name and pressing Up or Down. Now i would like to know, How can i save the 'sorted' listBox and display that order on the Main Page?? I would greatly appreciate some help. Many Thanks PS this is what i have for moving the items UP/Down protected void Button1_Click(object sender, EventArgs e) { int i = lstAssoc.SelectedIndex; string str = lstAssoc.SelectedItem.ToString(); if (i > 0) { lstAssoc.Items.RemoveAt(i); lstAssoc.Items.Insert(i - 1, str); lstAssoc.SelectedIndex = i - 1; } } ------------------- Redcastle CRM
Sorry for cross posting. Does this mean i get no help ?? :(
------------------- Redcastle CRM