View previous topic :: View next topic |
Author |
Message |
sprugh Guest
|
Posted: Wed Feb 01, 2006 11:24 pm Post subject: Hiding Columns that don't belong with a DataRow |
|
|
I saw in the DataSetBrowser sample that columns appear and disappear as you click on the appropriate row.
In my app, I get every column for every row type. What am I missing? Is there a special setting? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Feb 02, 2006 1:51 am Post subject: |
|
|
You need to set the Column.ContextSensitive property to true if you want the column to dissappear when the focus row does not have information for that column. _________________ Infralution Support |
|
Back to top |
|
|
sprugh
Joined: 02 Feb 2006 Posts: 4 Location: Chicago, IL
|
Posted: Thu Feb 02, 2006 4:55 pm Post subject: Hiding Editor that doesn't belong with a row |
|
|
Ok. The ContextSensitive works by turing off the columns until you click on the correct DataRow. But, I still see the sub row editor in parent rows, once I click on the child. In this case, I have a group and an item and the item has a checkbox:
The columns are
Group Name
Item Name
Active
The tree looks like(where 1 is checked, 0 is unchecked:
Group Name, Item Name, Active
Account
-Account Item Name, 1
In this case, when I click on the Account row, I do not see the check box. But, when I click on the Account Item the check box appears but in all rows. Since the check box does not make sense for Account I would like it not to show on that row.
How can this be done? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Thu Feb 02, 2006 9:26 pm Post subject: |
|
|
In this case don't set the CellEditor for the Column (as this applies to all rows in the column). Instead set the CellEditor in the CellBindings for the RowBindings that you want the editor displayed for. _________________ Infralution Support |
|
Back to top |
|
|
sprugh
Joined: 02 Feb 2006 Posts: 4 Location: Chicago, IL
|
Posted: Thu Feb 02, 2006 11:04 pm Post subject: |
|
|
Do you mean that I should do this programatically in the code instead of the designer?
Also, could I just implement GetCellData and set the editor to NULL for all the other rows? |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Fri Feb 03, 2006 6:33 am Post subject: |
|
|
You can do this in the designer if you are using Object Bindings or DataSet Bindings. Select the Bindings tab find the binding for the row, expand it and select the cell binding for the column. Set the CellEditor. _________________ Infralution Support |
|
Back to top |
|
|
|