Hi,
I'm using UltraConrolContainerEditor.
I want to assign values of child band to nested grid, so each row will display related child band in the cell row.
I added unbound column to parent grid and set the data type of the column to IList.
I've tried to assign the values of the child band to the cell.
However I'm having problem with picking those values by nested grids. (have two grids for rendering and editing control)
Can I get some example on that?
Thanks,
s
I've sorted this, just needed to set cell Data.Type to 'Object'.
However I am still working on the problem..
Hello,
I tried to set the unbound cell value like this:
e.Row.Cells("UnboundCell").Value = MyDataTable
but I get the error 'Object must implement IConvertible.'
Any ideas?
Thank you,
I'm not sure what you mean by "overwrite the values". What values are you referring to?
What I would do is create an unbound column in the parent band. In the InitializeRow event, you need to populate this column with data. So you would loop through the child rows and build some object, like a DataTable, that contains the child row data that you want. Then you set the value of the unbound cell to this object.
If the child row data is not being changed outside of the cell, then you probably only want to do this the first time InitializeRow fires. Is that what you means by overwriting? That InitializeRow is firing again and replacing the data with the original values from the child rows? If that's the case, then all you have to do is check e.ReInitiailize in the InitializeRow event. If this is true, it means the row is being initialized for the second or subsequent time and you should skip building the data again.
I want to go ahead with the ControlContainerEditor and two grids.
I have a DataTable with child band values. The values in the DataTable are changing for each parent row.
I populate two grids on InitializeRow event of the parent grid.
But the problem I am facing now is that I overwrite values of the grids with the newly populate DataTable.
And I want to display specific child band values for each parent row.
What to do to not to overwrite the values?
In the link you have here, the developer was copying a single value from the child row into the parent row. There's no way to put multiple values into the same cell in the grid. A grid cell has only one Value. Of course, that Value could be an object which contains more than one piece of information. But then we are right back where we started - using a single control to display multiple rows in an efficient way.
What kind of assumptions can you make about the child data here? Do you know the maximum number of child rows / columns?
If you just want to display the data in the cell and allow a separate dialog for editing, then maybe you could create a simple UserControl with some TextBoxes that displays the data and is more efficient than using a WinGrid (which has a whole lot of functionality you won't be using).
It's also possible that I am wrong about the performance, but the only way to tell would be to implement it and test it. And like I said, it's not a trivial implementation, so it could be a lot of work for something that ultimately isn't feasible.