I'm looking for some direction in accomplishing the design of one particular grid I want to use in my application. A screen print of the grid is attached.
The design considerations for this grid are as follows:
- the rows and columns are set
- some rows act as subtotals of the rows below them and need to expand and/or contract the rows they total
- data can be entered "behind" each cell in the grid in a one-to-many relationship with the total of all the numbers displaying in a read-only way in the cell above it and marking that cell to show that it comprises rolled-up numbers
I can see that it would be easy to set the rows and columns in a non-data-bound grid as well as get the expanding/contracting functionality. But I would like the grid to be bound to my underlying dataset. Is there a way to bind individual cells with individual fields in individual records of the dataset? I can see that the last point could be accomplished with a drop down grid, but is there a way to use a data-bound grid with a drop down grid and still get a specific row/column design and the other functionality that I require?
Any insight would be appreciated.
ADAdministrator Syncfusion Team September 26, 2002 12:10 AM
One way you could go about this is to use a GridControl in a pseudo-virtual manner. Then in your QueryCellInfo, you would use your dataset/datatable to provide the values as requested by the row and col indexes passed in as the EventArgs. I used the term 'pseudo' since you may want to go ahead and explicity set the row and col size since they are fixed. Doing so means that you have the option of using the GridControl's internal data storage for any row/col. So, the rows and columns that are not bound to the dataset would use this 'normal' storage to maintain their values and you would not have to handle them in your QueryCellInfo as you would need to do with a pure virtual (not pseudo) grid.
To handle saving things back to your dataset, you would use the SaveCellInfo event to catch those values that should be moved back into your dataset.
AKAmanda KabakSeptember 26, 2002 06:48 AM
Fantastic. I think this will work perfectly. Thanks for the tip.