Hi, I am getting the exception while performing drag drop on multiband grid. I am dragging a row on to the other row and deleting the dragged row. I am attaching the sample project which has the issue. In the sample just drag "Employee 3" over to "Employee 1" you will get the exception. Can some one pls help?
Hi,
The error message you are getting here is coming from the BindingManager. Basically, your data source is rejecting the deletion - it's nothing to do with the grid.
It's probably because your data source and the Children property are using List<T> instead of BindingList<T>. List<T> is very limited as a data source.
Thanks Mike. That did the trick. But I have a follow up questions. I am having the data in the following manner:-Band 0 (Profit) | Column Total
Band 1(Services) | Column Total
Band 2(Software) | Column Total Band 2(Hardware) | Column TotalI want the Sum of Total Column of Band 2 to be the Total of Band 1. And the total of Band 1 to be the total of Band 0. Provided that I have recursive Data structure so I dont have any control on number of bands (the depth will not be more than 8). Will it be possible in the grid using Formulas or WinCalcManager? If yes, Can you pls provide a sample or a link for me to get started ? Thanks
This is discussed here: sum cell from band[1] into cell in band[0] - Infragistics Community
Thanks Mike. I did read that link before. But as I mentioned in the post that my data is recursive. I will not know how many child bands will be created. So I will not be able to write the formula like this Sum([Band 1/Column 0]). Is there any way I can write a formula that every parent row calculates its child rows and show the sum at the parent row.? My requirement is like a bottom up Sum of nodes in a Tree.
You can't apply a formula to the entire grid, the Formula only applies to a column. So you must apply a formula to the column in each band.
What I would do is use the InitializeLayout event and loop through the bands collection and apply the formula to the column on each band. You will have to examine the bands ChildBands collection to get the name of the child band.
An alternate solution would be to handle the grid's InitializeRow event and write the code to sum up the child rows values yourself and populate the cell in the parent row.
This might make your implementation simpler, but it's a little more code, since you have to loop through the child rows.
Or, you might be able to take a sort've hybrid approach where you use InitializeRow to check if the Formula on the column has been set and if not, set it at that point.
Wow!! Thanks that did the trick. I dint event ried that before as I was wondering when I will have the same Summary key , ultragrid will blow up. But it worked. Thanks Mike for the sample. Can you please take this conversation out to separate thread so that some one else might get the answer as this thread title is about drag drop problem? Anyways, Thanks for the sample.
The fact that you have an unknown number of bands is not a problem, You simply have to loop through the Bands collection inside InitializeLayout and apply the same formula to the same column in each band. You could even give the summaries different keys - perhaps by appending the band index in the summary key.
I don't think that the duplicate band keys will be an issue, either. The formula syntax is not ambiguous, and it's pretty clear that you are referencing a summary of a child band. So the grid should be able to find the right summary.
So I don't see anything that will prevent you from doing this in InitializeLayout just as my sample does.
Thanks Mike for the sample and Thanks for following up.Sample works well *only* when you know how many bands you will be having in your grid. Like in the sample a grand parent band, parent band and child band. But as I said that my data is recursive in nature and I will not know how many band will I be having(I do have the MaxBandDepth set to 8 though) .I guess I have to write a recursive routine in initialzerow or seomwhere to calculate the summary myself and put it on a cell. But I would still use the summary or Formulas and let ultragrid calculate for me. Let me know if you guys have any more question or if I have missed something.
Hello ajayk2k1,
Did you have the time to look at the sample? Is it fine for you? Please let me know, I will be waiting for your feedback.
I responded to your request for a sample on the other thread.
WinCalcManager formulas in WinGrid with hierarchical data - Infragistics Community