RAD Studio for Microsoft .NET
ContentsIndex
PreviousUpNext
Binding Columns in the DBWebGrid

There may be times when you want to modify the order in which columns appear in a DBWebGrid control. You can accomplish this task by binding columns manually, from within the Property Builder.

Note: DB Web Controls (Borland.Data.Web namespace) are being deprecated in 2007. You should use standard Web controls instead.

To open the Property Builder

  1. Start a new ASP.NET application.
  2. Add a data provider.
  3. Add a DBWebDataSource object and connect it to a generated dataset.
  4. Add a DBWebGrid control to your Web form.
  5. Click the Property BuilderDesigner verb, located at the bottom of the Object Inspector. This displays the Property Builder.

To change column order

  1. On the Property Builder, click the General tab.
  2. Set the DataSource to the DBWebDataSource, or to the dataset the DBWebDataSource points to.
  3. Click the Columns tab.
  4. Select the columns you want to appear in the Available Columns list.
  5. Click the right-arrow button to add the columns to the Selected Columns list.
  6. Rearrange the column order, if you like, in the Selected Columns list.
  7. You can change the column heading name as it appears in the grid by changing the Header text.
  8. Click Apply.
  9. Click OK.
    Warning: If you choose to bind columns in this way, you must set the AutoGenerateColumns property to False. Setting this property to True raises a runtime error, and does not allow the visible restriction of columns at designtime. If the same column is bound to a grid more than once, you may get a runtime error.

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!