Hello,
I’m working with RepositoryItemComboBox editors in XtraGrids. When updating a DataRow I need access to the underlaying ComboBoxEdit control to read its SelectedIndex property.
The active editor is null.
How can I realize that?
Regards
Manfred
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hello Manfred,
Thank you for the question. I'm afraid that this is not possible, because the editor itself is present only when the corresponding column is switched to Editing mode. However, you can obtain the necessary cell's value using the GrdView's GetRowCellValue method. After that, you can use this value to obtain the required index through the RepositoryItemCOmboBox object:
object v = <gridView>.GetRowCellValue(<gridView>.FocusedRowHandle, <aComboBoxColumnFieldName>); int index = <repositoryItemComboBoxEdit>.Items.IndexOf(v);
However, I don't think that this is the best solution. Could you please clarify why you need to obtain a selected index? I'll try to find better solution for you.
Thanks,
Stan.