Hello,
I've tried to use the Adorner UI Manager with a Guide element to highlight a certain GridView's cell (in my case: the focused cell).
Please refer to the image in the attachments.
I've used the Adorner UI Manager, created a Guide element.
Via code I get the focused cell's bounds (got it from another ticket, with ViewInfo and so on…). Then I create in runtime a new, transparent label, send it to back and draw it at the same position of a certain cell. It works. However, not that fine… is there a better way to accomplish this task? In my solution it is realy hacky and buggy, after showing and hiding the guides I cannot click at the cell again (focus problems) and so on…
I think I would need a way to clean up the runtime created stuff at least, but there is not Hiding-Event for the Adorner UI Manager or somthing simular I could use.
Anyway, it would be great if you could offer an example solution.
Greetings!
Hello,
To provide you with a suitable solution, I need to better understand your scenario. Would you please clarify why you need to use Adorner UI Manager?
To set a focused cell style, you can use the approach from the Custom Styles for Rows and Cells help article. To show a popup window, you can use the Beak Panel control.
I look forward to your reply.
Because I like the way the rest of the form is getting darker and the controls are getting highlighted and so on
Mayber another question relating to this topic / offering me an alternative workaround / solution:
When using Badges (with the Adorner UI Manager) you could set a Target Location (Default, Header, Content … for tab pages). However, when using Guides, I cannot set a property like this, and the whole tag page's content is getting highlighted, instead of just higlighting the tab header's region. How to achieve this? then the other / main question is obsolet :-)
sorry there is no edit button for comments:
EDIT:
and is there a way / an event to react on showing / hiding the guides? It would be helpfull if I could toggle some controls invisible when showing / hiding guides
Hello,
You chose the right approach to highlight only one cell and show the popup form at the same time. However, you mentioned that your cell cannot be clicked in this case. Could you modify the attached project to demonstrate this behavior? Also, clarify what action you wish to perform after you click a current cell? How do you close the guide?
As for the target location, initially, you talked about GridControl's cells. However, this function is required when you wish to highlight a tab page. Do you mean another control? If so, please specify it. Also, it would help if you share a couple of screenshots to demonstrate the current and required behavior.
I look forward to your response.
Thanks
In your Example form resizing doen't affect the highlighted guide region
Hello Joey,
The area that should be highlighted using Gauge is manually set in my project. If you need to change it based on the control size, you can handle the control's Resize event and modify the Bounds value based on your requirements. Here is a sample code snippet:
private void Form1_Resize(object sender, EventArgs e) { GridViewInfo viewInfo = (gridView1.GetViewInfo() as GridViewInfo); GridCellInfo cellInfo = viewInfo.GetGridCellInfo(0, gridView1.Columns[0]); Rectangle CellBounds = cellInfo.Bounds; (guide1.TargetElement as Cell).Bounds = CellBounds; }