Hello,
When i use a TracBar as an grid cell editor i receive the following error after editing the cell:
Excepción no controlada del tipo ‘System.InvalidOperationException’ en xceed.grid.dll
Información adicional: An attempt was made to select a row that does not belong to a grid.
That occurs when i click in another cell of the same row to leave the edit mode.
The code that creates the control and the events are:
grid.BeginInit();
grid.SingleClickEdit = true;
foreach(Xceed.Grid.DataRow row in grid.DataRows)
{
Xceed.Grid.Cell carriles = row.Cells[<cell name>];
TrackBar track = new TrackBar();
track.Minimum = 0;
track.Maximum = <int variable>;
track.TickFrequency = 1;
track.TickStyle = TickStyle.BottomRight;
track.SmallChange = 1;
track.LargeChange = 1;
Xceed.Grid.Editors.CustomEditor trackEditor = new Xceed.Grid.Editors.CustomEditor(track, “Value”, true);
carriles.CellEditor = trackEditor;
Xceed.Grid.Editors.ControlViewer trackViewer = new Xceed.Grid.Editors.ControlViewer(track, “Value”);
carriles.CellViewer = trackViewer;
trackViewer.Control.Location = new Point(-1000, -1000);
this.Controls.Add(track);
carriles.Value = <int value>;
carriles.EditLeft += new EditLeftEventHandler(carriles_EditLeft);
row.AllowCellNavigation = true;
}
grid.EndInit();
…..
private void carriles_EditLeft(object sender, EditLeftEventArgs e)
{
if (e.Commited)
{
Xceed.Grid.DataCell cell = (Xceed.Grid.DataCell)sender;
Xceed.Grid.DataRow row = (Xceed.Grid.DataRow)cell.ParentRow;
if (row == null)
return;
<some code not affecting to grid>
} <<<<<<<<<<<<< when reaches this point fires the exception mentioned above.
Thanks for your help.
Imported from legacy forums. Posted by Javier (had 1795 views)