True DBGrid for WinForms | ComponentOne
In This Topic
    Preserve Grid Layout
    In This Topic

    If the DataSource is reset through code, it will show all of the data in the grid and will not keep the initial layout created with the Designer. You can ensure that the grid layout remains the same as designed, that is, preserve the grid layout by using the SetDataBinding method with the HoldFields parameter set to True. For example:

    C#
    Copy Code
    // Bind grid at runtime
    c1TrueDBGrid1.SetDataBinding(dt, "", true);