Hi There,
Is the following possible ? I have been reading around and did not find anything similar so far.
Thanks!
Hi,
What, specifically, are you asking about?
It looks like what you want to do is have a grid inside a grid. This is possible - you can use the new UltraControlContainerEditor to embed any control you want into a grid cell. Do you want this for the entire column or just one cell like you have shown here?
If it just for one cell, then the tricky part of this will be the column's DataType? How will you provide a single string of text for all of the cells in the column except one where you need to supply a whole grid of data?
If it's for every cell in the column, then this could be pretty inefficient, since every cell in the column will have to bind a WinGrid to it's data every time the cell paints.
Hi Mike,
Thanks for your anwer.
Each cell can have its own grid. The text representation of a grid only needs to be shown once a grid is collapsed (in contrary to what is shown on the picture).
Are you saying that the databinding takes place whenever a cell is painted ? Can you please explain ?
In order to show a grid in a cell, what you would have to do is create a DataSource and bind it to the main grid and then you would have to have a column in that grid whose data is another DataSource. For example, the column in the main grid could contain a field which is a BindingList<T> or a List<T> or maybe even a DataTable.
Every time a cell in that column paints, UltraControlContainerEditor would have to bind a grid control to the data in the cell and paint it on the screen. If you have 20 cells visible that means binding the same grid 20 times and painting it into each cell every time. So this is not very efficient.
ok, so I guess the answer is: in theory yes, in practice no ?
Ok, thanks mike. The whole thing even needs to be recursive, ie: the inline grid can contain other inline grids. And yes, with lots of data. Thanks for all info you supplied, I am going to check out your suggestions.
Well, there are ways you might do this in practice. It really depends what you want.
You could try it out using the WinGrid and see how it goes. If the grid in the cell is relatively small and you are not showing a lot of cells in the main grid, and depending on the processing power of your machine, it might work just fine.
You could also try to make the grid inside the cell as efficient as possible. I recommend consulting the WinGrid Performance Guide for tips on how to do that. Obviously, the grid inside the cell doesn't need to have a huge range of functionality.
If that's still not good enough, then maybe you could create a UserControl that displays the data from the cell in a simple and more efficient fashion. The WinGrid is designed to be very functional and very powerful, it's not designed as a lightweight control for just displaying data.