我的代码有问题,不会发送包含按下按钮的行的信息:
//This is the code that creates the button in the column.
else if (e.Column.Name == ActivePrescriptionGridFindReplaceButton.Name) {
GetGridButton(true, "Replace", PrescriptionGridFindReplaceButton_Click, e);
}
//This is my event, (GetGridButton is a function that make this an event)
void PrescriptionGridFindReplaceButton_Click(object sender, ButtonPressedEventArgs e) {
//My point have the information, it works and gives the correct coordinates
DoShowMenu(ActivePrescriptionsGridView.CalcHitInfo(m_Point), MenuMode.Replace);
}
//This receives the information
void DoShowMenu(DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitInfo hi, MenuMode mode) {
//Here the hi.HitTest says that does not have a value (NONE)
if (hi.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowCell) {
//So RxMedication take the value of NULL
PatientPrescriptionEntity RxMedication = ActivePrescriptionsGridView.GetRow(hi.RowHandle) as PatientPrescriptionEntity;
//Gets out of the event
if (RxMedication != null) {
RenewMenu menu = new RenewMenu(ActivePrescriptionsGridView, RxMedication, mode);
menu.Init(hi);
menu.OnReplaceMedication += menu_OnReplaceMedication;
menu.Show(hi.HitPoint);
}
}
}
有人有想法吗?请帮我
还有另一种方法吗?
我做错了什么?...