Hi,
We'd like to put a control in the group header area - for example a textbox to specify an offset to apply to all values for every group.
We're wondering how feasible this is within the existing infrastructure of the UltraGrid control, and if you have any recommendations on how to achieve this.
Thank you.
Hello,
Maybe one possible way to achieve desired behaviour could be if you are using CreationFilter. I have similar sample where I`m using this approach. Could you please take a look at the attached sample and let me know if you have any questions.,
Regards
Thanks Georgi for your sample, it looks promising. A few questions:
Thanks Georgi. I'm still having trouble having it work exactly how we'd like.
Please see attached solution with modified version of your sample to better illustrate our use case.
What we'd like to have is
I hope very much you are able to help us in this scenario. So far I'm unable to get the textbox to appear in the right position and repeat above each column.
Hello Gsharm3,
Thanks for provided details, but this is very custom scenario and we have not such kind functionality. Nevertheless I made small sample for you with desired behavior. This sample is just an idea how to achieve your requirements. Please take a look at the attached sample and video file for more details and let me know if you have any questions.
Thank you Georgi, this is very close to what we want. However, a few issues we've noticed:
gsharm3 said:When we scroll in this demo using the mouse wheel, we get some screen corruption, as textboxes appear all over the grid in the wrong places. Is there a way to prevent this? Curiously, the problem doesn't appear if we use the scrollbar instead of the mouse wheel.
Hm. You are right. I forgot for this scenario. I didn`t remove the TextEditors. Just modify my Creation fIlter to remove the TextEditors before start draw it again and eveything should works properly
gsharm3 said:Text editors appear also for higher-level groups. For example, next to AAPL we have a text box which does not directly contain datarow items. Is it possible to hide this, and only show it for the lowest leaf-level groups that have datarow children?
Yes, It is possible. You could extend the IF condition in the Creation Filter and exclude this row (you could check this using property IsGroupByRow and Decription).
Please let me know if you have any questions.
Also - note that we get the redraw bug when we expand/collapse group too. Can we deal with this in the same way as suggested above for mouse scrolling?
Thanks for all your grt efforts Mike.
Yes I am using single -band. I had a terrible time myself with it , but now with your valuable efforts its all sorted.
Datasource for my requirement has a pre-filtered data , so lot rows won't be an issue.
Once again thanks for your time.
Hi Deepti,
I started to write a sample for you demonstrating this, and it turned out to be a lot bigger job that I thought it would be.
Anyway, I have attached my sample here.I tried to keep all of the CheckBox encapsulated into a separate file (GroupByRowCheckBoxCreationFilter.cs) so you could hook this same code up to any grid you want. I made it work for multiple levels of grouping, also.
I made a few assumptions, like that you are only working with a single-band grid.
I am determining the state of the CheckBox in the GroupByRow by recursively looping through all of it's child rows. There are probably more efficient ways to do this by caching the states, but this code should work okay as long as you don't have a huge number of rows.
I have a similar requirement where group by column is decided dynamically an can be changed programatically. To this we need checkbox control on groupby row.
If the checkbox is checked at group level checkbox for all the rows under the group must be selected. Similarly if all the rows in a group had idividually been checked the group checkbox should also get selected.
I have applied the above samples and am able to get checkbox on header , but how to get above functionality added. Also is there way to get checkbox before group description should that we don't have to force position as description length would vary for each group.
Hello gsharm3,
Thanks for attached CreationFilter. Looking at the provided code, I think that everything is correct. Also I get your creation filter and past it in my sample and again everything works properly. So I suppose that something else in your application cause this behavior. Maybe we call our creationFilter in inappropriate moment, but I need to reproduce this behavior to be sure what is the reasons.
If you are able to reproduce this issue in a sample, I`ll be glad to research it.
Hi Georgi - we have been able to replicate the code from this prototype in our actual product, but have come across one issue - we're wondering if you might know what it could be.
Basically, in the prototype it is removing the old textboxes, and then adding new ones, which makes sense.
However, in our product, it adds the new textboxes first, and then removes the same textbox again. This is regardless of how we order the code in AfterCreateChildElements.
Do you know how we can ensure it does not remove the textboxes we've just created? It works this way in the demo, but I am not sure why it doesn't in the actual product. I've attached our full CreationFilter file - let us know if it looks correct. Note that the Remove happens first in the code, but at runtime seems to happen after the textboxes are added, removing the new textbox, and showing nothing.
Any help/suggestions would be appreciated. Thank you.