Next/Previous item

3 posts, 0 answers
  1. Whanksta
    Whanksta avatar
    2 posts
    Member since:
    Jun 2011

    Posted 23 Jun 2011 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Jun 2011 Link to this post

    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.
  3. Whanksta
    Whanksta avatar
    2 posts
    Member since:
    Jun 2011

    Posted 27 Jun 2011 Link to this post

    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. 
Back to Top