Home Forums WinForms controls Xceed Grid for WinForms TrackBar as CellEditor

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #14937 |

    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)

    User (Old forums)
    Member
    Post count: 23064

    From what I see, this should work fine. That being said, can you send me a sample that replicates the issue along with the assemblies you are using? Please send this at suppport@xceedsoft.com and I will investigate further.

    Imported from legacy forums. Posted by Matt (had 2847 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.