Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
170
Delete an Unbound column from UltraWinGrid
posted

Hi experts,

I am struggling since couple of hours to delete some columns from an existing UltraWinGrid of a form.

I have an UltraWinGrid which is having Unbound columns. The grid binds the data-source at run time. My requirement is to delete some columns from grid and add new.

I am able to add the new column to the existing grid and remove the same.

But, not able to delete the existing columns from the grid. When I click on a column - (UltraWinGrid Designer -> Bands and Columns settings -> Bands[0] -> Columns, then I click on a column to delete),  I see that the "Remove Unbound Column" button is disabled.

What should I do in order to delete the column from the existing grid?


Thanks,

Soumya

  • 29105
    Suggested Answer
    Offline posted

    Hello Soumya,

    It appears that you do not have an unbound column to remove. You won't be able to remove unbound columns that you added at runtime. You can bind a data source to the grid in the designer by using the ultradatasource component and populate it with some records. You will notice that they appear in the UltraWinGrid Designer by visiting 'Band and Column Settings but they won't be removable here. That's because they are not unbound. They can only be removed in code or by accessing your data source again.

    Try and add some unbound columns in the designer and let me know if the 'Remove Unbound Column button is still disabled. It should immediately be active upon adding an unbound column.

     // You can remove a column from the column collection in code by either specifying a column key or an index. For example,

    childBand0.Columns.Remove( "Col0" );

    childBand1.Columns.RemoveAt( 0 );