コード例 #1
0
        private void gridViewAppointments_DoubleClick(object sender, EventArgs e)
        {
            GridView currentView = sender as GridView;

            if (!currentView.IsGroupRow(currentView.FocusedRowHandle))
            {
                ListViewMenuBuilder.Scheduler = OwnerScheduler;
                ListViewAppointment listViewAppointment = currentView.GetRow(currentView.FocusedRowHandle) as ListViewAppointment;
                ListViewMenuBuilder.CurrentAppointment = listViewAppointment.SourceAppointment;
                ListViewMenuBuilder.ViewControl        = this;
                ListViewMenuBuilder.OnOpenCurrentAppointment(null, null);
            }
        }
コード例 #2
0
 private void gridViewAppointments_PopupMenuShowing(object sender, DevExpress.XtraGrid.Views.Grid.PopupMenuShowingEventArgs e)
 {
     if (e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.RowCell)
     {
         GridView            currentView       = sender as GridView;
         ListViewAppointment agendaAppointment = currentView.GetRow(e.HitInfo.RowHandle) as ListViewAppointment;
         ListViewMenuBuilder.GenerateContextMenu(this, e.Menu, OwnerScheduler, agendaAppointment.SourceAppointment);
     }
     if (e.HitInfo.HitTest == DevExpress.XtraGrid.Views.Grid.ViewInfo.GridHitTest.EmptyRow)
     {
         if (e.Menu == null)
         {
             e.Menu = new DevExpress.XtraGrid.Menu.GridViewMenu(sender as GridView);
         }
         ListViewMenuBuilder.GenerateContextMenu(this, e.Menu, OwnerScheduler, null);
     }
 }