With a control inheriting from an ultragrid I'd like to place another control on the design surface and have it draw itself over the ultragrid. When I try this though, the control isn't visible. Checking its properties I can see that it is visible, has a sensible, non-zero size, and a location that should be visible. I've also tried calling its BringToFront method. Is there any way I can do this?
We're trying to add functionality to all our grids (which use a class inheriting from the ultragrid) to be able to display an indicator that data is being fetched, along with a cancel button to abort the fetch. I've created a usercontrol to implement this, but am getting the behaviour described. I've tried using a simple standard control as well, but that isn't displayed either
Hi Kevin,
Thank you for posting to our forums.
One reason for why you can’t see your control is if you are fetching the data on the UI thread. That will lead to the UI thread being blocked until it is done with the fetching the data, so your controls can’t be drawn. What you could do is to fetch the data on another thread, and display your controls on the main thread. There are a few ways to implement this. I have attached a sample demonstrating how to do this with the Task class. It displays an activity indicator over the control while a long loading of data is simulated.
Please let me know if you have any additional questions.
Hi, thanks for the reply. We are in fact using the TPL to load the data on a background thread, then apply it to the grid on the UI thread when it has been fetched, so that in itself isn't the problem. I've downloaded the sample you provided, but it's not quite what I'm looking for. You are dropping a grid on to the form, then dropping the progress bar on to the form as well. This works (and is in fact the workaround I'm using at the moment) bit I want to encapsulate all of this in our control that inherits from the ultragrid. I've dropped my progress bar on to this user control's design surface, not on to the form itself. I'm presuming it's something to do with the grid not being a container, and am wondering if there's a way to work around this.