Hi,
I am using UltraWinGrid.UltraGrid control. The data is in hierarchy format in the grid. AddNewBox is added for that control. I want to hide some of the AddNewBox buttons from the grid. Is there any option to hide those buttons? And I want to track which AddNewBox button event is firing.
Help me regarding this.
Thank you for your time.
Prathap Reddy
Thank you for your reply.
First Point:
I dont want to hide all AddNewBox buttons. I need some of buttons visible and some of buttons hidden. If i do UltraGrid.DisplayLayout.AddNewBox.Hidden to true then no buttons will be visible. I think u understand my point.
Second Point:
I did not understand what u r trying to explain on tracking of AddNewButon event handler. Could you please provide any example on this. I am repeating mquestion again on this.........How to track the AddNewBox button event handler? If i am able to find out which button is firing then i can write the code accrodingly.
Regards, Prathap Reddy U
You can hide the AddNewBox by setting UltraGrid.DisplayLayout.AddNewBox.Hidden to true (actually I thought it was hidden by default, so you might be setting it to true somewhere without realizing it).
The grid's AfterRowInsert event will fire when a row is added this way, but I don't see anything on the event arguments that distinguishes a row added in this manner from some other method. You could, however, use the IUIElementCreationFilter interface to intercept the creation of the AddNewRowButtonUIElements (that represent the addnew buttons in the user interface), and handle their ElementClick event. In the event handler, you would upcast the Element property of the event arguments to this type, from which you can get a context on the associated UltraGridBand using the GetContext method, passing in typeof(UltraGridBand).