Is there any way to add right-click functionality through code to a grid or dataset to get context menu functionality in an ultragrid if the data is not bound to a dataview?
i am attaching non-BAQ datasets to an ultragrid without storing the data and it would be nice to still have the right-click functionality.
I am drawing the data from a stored procedure and attaching it via ultragrid.Datasource in a custom form. Everything works perfectly but I don’t have any right-click functionality, which I understand, I was just wondering if there was a way to point a custom column to an existing context like the following:
Ultragrid.Rows.Column(“ParentJobNumber”) = JobHead.JobNum. I know this syntax isn’t correct, it is just to illustrate the idea.
BAQView as @tkoch recommends or even a custom EpiDataView, you should try to use the “EpiMagic” whenever possible. You get a bunch of “free” help with that including right click menus
I agree and wanted to do it that way but I couldn’t get it done with a BAQ. Creating a Epidataview is a good idea. Can I just pin a custom datasource to that and go with it?
One more thing…in this case, how do I align the ParentJobNumber column on the incoming dataset with the JobHead.JobNum context right-click function on the dataview?
I see that I can bind the dt to the dv and tie that to the ultragrid for continuity but I don’t see how to get the right-click to tie in.
Once this dataview is created from the empty row datatable in Initialize Custom Code, how do I dynamically populate it in my subroutines?
I thought I could just fill the dt as I am and it would present in the dv but it is not. Do you I need to iterate through and populate the dataview that way? Sorry I am being so slow with this…
Otherwise, it looks like the perfect solution. I have the DataView bound to the grid and the properties set I just need to populate the DataView on retrieve from the incoming dataset.
You should be able to fill in the datatable with data and as long as the data table is the one you bound to the dataView property in the EpiDataView it should just work.
Just to clarify another feature that many people don’t know about with BAQs… you can redefine the “Like” attribute on any field within a BAQ - even calculated fields.
Below is an example where I defined a calculated field to be “Like” an OrderHed.OrderNum… when this BAQ is later run, you can right-click in the field, and it will automagically allow the Open With dialog. This has proved very useful with some advanced BAQs & Dashboards.