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
Hm, I guess the grid doesn't expose a child bands collection on the band.
Anyway, the reason "Children" doesn't work is because that's not the name of the child bands. The band keys have to be unique. In a recursive case, the key will probably be a concatenated string of all of the band names up the parent chain. If that's the case, you can simply use the key of the current band and append ".Children" to the end of it.
Try looping through the grid.DisplayLayout.Bands collection and displaying the Key of each band and you will see the actual names of every band.
I looped through the band the keys I found are
List~1
Children
I dont think so that grid is appending any name here. In one of the other post you propsd this solution
"The other option would be to use multiple formulas. So what you would do is, on the lowest band (band 4), you don't have to do anything. On the second-lowest band (band 3) you would add a summary that sums up it's child rows. This summary would have to have a Key assigned to it. Then on band 2, you add a summary which sums it's child rows, plus the summary from band 3. On band 1, you add a summary that sums it's child rows plus the summary on band 2."
Can you please give me a sample for thsi option? As I am not able to figure out how can I sum the two summaries?
In one of your separate post
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.
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.
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.
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.