OldRow, Current Row, MultiColumnComboBox

6 posts, 1 answers
  1. Kem
    Kem avatar
    14 posts
    Member since:
    Oct 2010

    Posted 12 Jan 2011 Link to this post

    Hello

    I am using visual studio with c sharp, windorm and latest Rad controls. 

    I have a multcolumncombobox named mcbUserReports. Within it's SelectedIndexChanged event I want to be able to move the selected index to the OldRow. I understand that it is connnected to the CurrentRowChangedEventArgs. I am having a difficult time assign it's properties to an object which will allow me to tap into the OldRow and CurrentRow values. This is what I have thus far:

    Private Void mcbUserReports_SelectedIndexChanged(object sender, EventArgs e)
    }
        Telerik.WinControls.UI.CurrentRowChangedEventArgs objTelerikEventArgs = //(not sure what to put here)
        Int32 intOldRow = objTelerikEventArgs.OldRow.Index:
    }

    The first line within the SelectedIndexChanged block should read below:

    Thanks

  2. Kem
    Kem avatar
    14 posts
    Member since:
    Oct 2010

    Posted 13 Jan 2011 Link to this post

    I found the correct way to access the OldRow and CurrentRow properties. It is below.

    private void mcbUserReports_SelectedIndexChanged(object sender, EventArgs e)
    {
        CurrentRowChangedEventArg objTelerikEventArgs = (sender as currentRowChangedEventArgs);
        Int32 intOldRow = objTelerikEventArgs.OldRow.Index
        MessagBox.Show(intOldRow + " This is the OldRow index")
    }
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Kem
    Kem avatar
    14 posts
    Member since:
    Oct 2010

    Posted 13 Jan 2011 Link to this post

    After running the code I get a error saying that I need to use the keyword new. So how would I get access to the Oldrow and CurrentRow within the selectedindex change?
  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 14 Jan 2011 Link to this post

    Hello,

    Please consider the following sample:

    this.radMultiColumnComboBox1.EditorControl.CurrentRowChanged += new CurrentRowChangedEventHandler(this.radMultiColumnComboBox1_CurrentRowChanged);
      
            private void radMultiColumnComboBox1_CurrentRowChanged(object sender, CurrentRowChangedEventArgs e)
            {
                if (e.OldRow != null)
                {MessageBox.Show("OLD ROW INDEX: " + e.OldRow.Index.ToString());}
                MessageBox.Show("NEW ROW INDEX: " + e.CurrentRow.Index.ToString());
            }

    Hope that helps, but let me know if you have further questions
    Richard
  6. Kem
    Kem avatar
    14 posts
    Member since:
    Oct 2010

    Posted 14 Jan 2011 Link to this post

    Is it possible to access those properties within the SelectedIndexChanged?
  7. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 15 Jan 2011 Link to this post

    Hello,

    No, these event arguments are part of the RadGridView which is the editor control of the MultiColumnCombo.
    Please remember to mark as answer and if you have any other questions, let me know.
    Regards,
    Richard
Back to Top
UI for WinForms is Visual Studio 2017 Ready