Home Forums WinForms controls Xceed Grid for WinForms Updating GridControl.FixedColumnSplitter.Position crashes

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

    Hi,

    I’m working on enhancements for a project which uses an old version of “Xceed.Grid.dll” (assembly version: 3.6.7264.16200). I’m trying to save the splitter position of the grid to be able to load it on startup. I set the Position property of FixedColumnSplitter in loadGridWithUserSettings() method as:

    grid.FixedColumnSplitter.Position = 1;

    This causes the following exception:

    The paint index must be greater than or equal to 0 and less than Count.
    Parameter name: paintIndex
    Actual value was -1.

       at Xceed.Grid.Collections.ColumnList.GetScrollingColumnFromPaintIndex(Int32 paintIndex)
       at Xceed.Grid.FixedColumnSplitter.ChangeFixedColumn(Int32 newSplitterPosition)
       at Xceed.Grid.FixedColumnSplitter.set_Position(Int32 value)
       at BasePanelControl.loadGridWithUserSettings() in C:\Projects…..

    Does anyone have any ideas on setting the splitter position? Thanks.

    Imported from legacy forums. Posted by Umit (had 2423 views)

    User (Old forums)
    Member
    Post count: 23064

    I suspect you set it too early, before the grid columns have been created/painted.

    Note however that you can accomplish the same result by looping through the columns collection, and setting the Fixed property and the VisibleIndex property.  This will ensure the columns are position correctly, either on the fixed or unfixed side of the grid.

    Imported from legacy forums. Posted by André (had 2038 views)

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