I use MultiEditor to edit some certain order data. I want to detect which datacell focused at runtime in editor event…
I use events for initialize popup list. So I declare OnInitPopup at runtime for all datacells.
like this…
with MultiEditorRow.Properties.Editors.Add do begin
TcxMRUEditProperties(EditProperties).OnInitPopup := OnMRUInitPopup;
end;
… Now, I have to find out which datacell editing in OnMRUInitPopup
procedure TForm.OnMRUInitPopup(Sender: TObject);
begin
DataId := cxVerticalGrid1.FocusedRow.Tag; //This gives me MultiEditor Row's Tag…
// How can I know which datacell focused now ???
end;
I try to use Row.Tag to assign data, but, multieditor.editors has no Tag property. Furhermore, I could not find a pointer from Sender (TcxEditor) in OnMRUInitPopup(Sender: TObject) to reach which datacell?
I hope I could tell my trouble…
Thanks…
Hi,
You can obtain the required information via the VGController's CellIndex property. However, the Controller property is declared as protected in the TcxCustomVerticalGrid class. Please use the approach described in the "How to access a protected class member" knowledgebase article (www.devexpress.com/kbA1030) to access it. Here is some sample code demonstrating this technique in action
type
TcxVerticalGridAccess = class(TcxVerticalGrid);
var
ACellIndex: Integer;
begin
…
ACellIndex := TcxVerticalGridAccess(cxDBVerticalGrid1).Controller.CellIndex;
…
Please try this solution and let us know if it helps.
Thanks,
Vito