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

OldRow, Current Row, MultiColumnComboBox

5 Answers 156 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Kem
Top achievements
Rank 1
Kem asked on 12 Jan 2011, 11:47 PM
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

5 Answers, 1 is accepted

Sort by
0
Kem
Top achievements
Rank 1
answered on 13 Jan 2011, 07:52 PM
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")
}
0
Kem
Top achievements
Rank 1
answered on 14 Jan 2011, 01:58 AM
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?
0
Richard Slade
Top achievements
Rank 2
answered on 14 Jan 2011, 10:57 AM
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
0
Kem
Top achievements
Rank 1
answered on 15 Jan 2011, 01:55 AM
Is it possible to access those properties within the SelectedIndexChanged?
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 15 Jan 2011, 10:24 AM
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
Tags
MultiColumn ComboBox
Asked by
Kem
Top achievements
Rank 1
Answers by
Kem
Top achievements
Rank 1
Richard Slade
Top achievements
Rank 2
Share this question
or