Hi, I'm playing around to find the best approach to display my task schedule in win grid.
In the first column down, employees should be displayed. To the right, every column stands for one day containing the working task for one employee. My business object has therefore two lists of objects: One list of objects A (employe plans), and every object A has a list of object B (tasks per days).The same day can have more than one task.
Is it possible to bind my business object directly to grid? How I can achieve that the days are generated to columns not rows (pivot) ?
Another approach I'm thinking about is to use UltraDataSource and setup bands and columns from code depending of my business object.
Thanks for any suggestions.
Markus
Hi,
mac_swit said:the basic problem seems that no pivot functionality is provided and therefore I can not bind the grid columns to a property of my business object.
You can certainly bind the grid to a business object (or more likely a List or BindingList of business objects). When you do this, the grid displays each item in the list as a row and the properties of those items are the grid column.
There is no support in the grid for pivoting the data, other than using CardView, which is not really the same thing.
mac_swit said:This task can maybe done more convenient using UltraDataSource? Do you have a complete sample project of using the UltraDataSource somewhere ? If so, please give me the link.
The samples installed with NetAdvantage (assuming you chose to install them) have a sample of using the UltraDataSource in virtual mode. There are two of them, in fact, one a simple one and an extended one. They can be found under the UltraDataSource samples on your hard drive, so where they are exactly depends on where (and if) you chose to install them. But it's usually something like this:
...\2010.2\Samples\WinDataSource\CS
Hi Mike,
the basic problem seems that no pivot functionality is provided and therefore I can not bind the grid columns to a property of my business object.
At the moment I'm playing with two scenarios. Scenario 1 is that just the employee column is bound directly to my business object property and in the Initialize_Layout event I add unbound columns for every day to the grid.
Scenario 2 is to use the UltraDataSource and setup the band and columns of the UltraDataSource depending on my business object and then bind it to the grid. In both scenarios I have to trigger changes of the data in the grid to update my domain object manually by code.
This task can maybe done more convenient using UltraDataSource? Do you have a complete sample project of using the UltraDataSource somewhere ? If so, please give me the link.
Thanks. Markus
Hi Markus,
The grid doesn't have any built-in functionality to pivot the data. It only displays the structure the data source gives it.
I'm not really sure I get the exact picture of what you want to do here, though. So you might be able to achieve what you want using CardView or maybe using some unbound columns. Since I don't understand it, it's hard to say if it can be done.
Your idea of using UltraDataSource for the grid's structure is a good one. The UltraDataSource can act as a sort've intermediary between the grid and the data. You can even load the data on-demand by handling events of the UltraDataSource like CelDataRequested.