Skip to content

Commit

Permalink
Fixes #1528 selet checkbox (#1529)
Browse files Browse the repository at this point in the history
  • Loading branch information
msevestre authored Jul 21, 2020
1 parent 7acda0a commit 8ef2681
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 67 deletions.
62 changes: 0 additions & 62 deletions src/PKSim.Presentation/DTO/Simulations/SimulationIntervalDTO.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,13 @@ protected override bool ColumnIsButton(GridColumn column)
{
return Equals(_colButtons?.XtraColumn, column);
}



protected override bool ColumnIsCheckBox(GridColumn column)
{
return Equals(_colDefault?.XtraColumn, column);
}

public override void InitializeResources()
{
base.InitializeResources();
Expand Down
24 changes: 20 additions & 4 deletions src/PKSim.UI/Views/Core/BaseUserControlWithValueInGrid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ protected virtual void OnGridViewMouseDown(UxGridView gridView, MouseEventArgs e
return;
}

if (ColumnIsCheckBox(col))
{
RaiseCheckEditClick(gridView, col, rowHandle, e);
return;
}

if (!ColumnIsValue(col))
{
gridView.EditorShowMode = EditorShowMode.Default;
Expand All @@ -65,14 +71,24 @@ protected virtual void RaiseButtonClick(UxGridView gridView, GridColumn column,
edit.PerformClick(ehi.HitObject.DowncastTo<EditorButtonObjectInfoArgs>().Button);
((DXMouseEventArgs)e).Handled = true;
}
return;
}

protected virtual bool ColumnIsButton(GridColumn column)
protected virtual void RaiseCheckEditClick(UxGridView gridView, GridColumn column, int rowHandle, MouseEventArgs e)
{
return false;
//Adapted from https://supportcenter.devexpress.com/ticket/details/t230842/grid-the-buttonclick-event-is-not-raised-immediately-when-multi-selection-is-enabled
gridView.FocusedRowHandle = rowHandle;
gridView.FocusedColumn = column;
gridView.ShowEditor();
//force button click
var edit = gridView.ActiveEditor.DowncastTo<CheckEdit>();
edit.Toggle();
((DXMouseEventArgs) e).Handled = true;
}


protected virtual bool ColumnIsButton(GridColumn column) => false;

protected virtual bool ColumnIsCheckBox(GridColumn column) => false;

protected virtual void OnValueColumnMouseDown(UxGridView gridView, GridColumn col, int rowHandle)
{
gridView.EditorShowMode = EditorShowMode.MouseUp;
Expand Down

0 comments on commit 8ef2681

Please sign in to comment.