Home Forums WinForms controls Xceed Grid for WinForms Force databinding without displaying

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

    I’ve noticed that when I bind the grid to a DataTable, the actual creating of the columns and rows only happens when I show the grid for the first time.
    However, I need the columns and rows without showing the grid: I’ve created a control that acts like a combobox, but with a dropdown-grid instead of a dropdown-listbox. The control has a textbox where you can type in stuff, and the control then auto-completes your input with what’s in the grid. Also, if you press the Up- or Down-key, the previous/next record should be selected. In this situation, the dropdowngrid shouldn’t be visible.

    Is there a way to force the actual creating of the columns and rows, without showing the grid?

    Imported from legacy forums. Posted by Tommy (had 1895 views)

    User (Old forums)
    Member
    Post count: 23064

    For those who also need this: I got the solution from the great guys at Xceed technical support: setting the <b>BindingContext</b> of the grid to a new BindingContext will force the actual creating of the columns and rows.
    <code>Xceed.Grid.GridControl myGrid;

    myGrid.<b>BindingContext</b> = new <b>BindingContext</b>();</code>

    Imported from legacy forums. Posted by Tommy (had 2892 views)

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