This is a migrated thread and some comments may be shown as answers.

Next/Previous item

2 Answers 52 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Whanksta
Top achievements
Rank 1
Whanksta asked on 23 Jun 2011, 08:22 PM
Hi, 

I am currently using Combobox to select records to edit in the FormView. 

I want to know if there are any way for me to create next/previous button and possibly first/last button

I tried different methods such as selectedvalue, selectedindex, selectitem, but it's not working

protected void RadButton12_Click(object sender, EventArgs e)
{
    RadComboBox1.SelectedValue = RadComboBox1.SelectedValue + 1;
}

Any help would be greatly appreciated. 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 24 Jun 2011, 06:53 AM
Hello Whanksta,

Try the following code snippet to achieve your requirement.
C#:
protected void BtnNext_Click(object sender, EventArgs e)
   {
       int index = RadComboBox1.SelectedIndex;
       RadComboBox1.SelectedIndex = index + 1;
   }
   protected void BtnPrev_Click(object sender, EventArgs e)
   {
       int index = RadComboBox1.SelectedIndex;
       RadComboBox1.SelectedIndex = index - 1;
   }

Thanks,
Shinu.
0
Whanksta
Top achievements
Rank 1
answered on 27 Jun 2011, 03:22 PM
Thanks Shinu, 

The solution works perfectly except when I enabled automatic load on demand, enable load on demand doesn't affect it.

While I appreciate your previous solution, is there anyway for it to work under automatic load on demand? Thanks. 
Tags
ComboBox
Asked by
Whanksta
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Whanksta
Top achievements
Rank 1
Share this question
or