How add an Event Handler to the Columnhead / Columntitel of a Grid?
Sebastian Schweer
Hi Everybody,i try to put an Eventhandler to the Top of a Grid, so i can Sort the Grid by clicking on the Top or so select the hole column by clicking to the caption of the grid.
I know, that this must be possible, because i can check all Checkboxes in the Import/Export Customize Rules by clicking on the Columnhead.
But how to add an Eventhandler to Columnhead of a Grid?
Best Regards,
Sebastian
Paolo Manfrin
Hi Sebastian,you can use the following code:
myGrid.AddHandler_DoubleClick(ModeComponent.FormModes.ALL, DoubleClickHandler);
private void DoubleClickHandler(DoubleClick e)
{
if
{
if
(e.Row == -1) // the user clicked on a header
{
string headerName = e.ColUID
// do something.
{
string headerName = e.ColUID
// do something.
}
}
Regards,
paolo
thanks for the hint.
Here is the complete delegate Method, which can be used in customizer:
And off course the Eventhandler:
Best Regards,
Sebastian
}
Regards,
paolo
Sebastian Schweer
Hallo Paolo,thanks for the hint.
Here is the complete delegate Method, which can be used in customizer:
SwissAddonFramework.UI.EventHandling.ItemEvents.DoubleClickEventHandler doubleClickHandler = null;
doubleClickHandler = delegate(SwissAddonFramework.UI.EventHandling.ItemEvents.DoubleClick evdc)
{
try
{
if((evdc.Row == -1) && ( evdc.ColUID == "Code") )
{
MessageBox.Show("im DoubleClick Handler", "ok");
}
}
catch(System.Exception exe2)
{
StatusBar.WriteError("Something goes wrong: " + exe2.Message);
}
};
And off course the Eventhandler:
myGrid.AddHandler_DoubleClick(ModeComponent.FormModes.ALL, doubleClickHandler);
Best Regards,
Sebastian
myGrid.AddHandler_DoubleClick(ModeComponent.FormModes.ALL, DoubleClickHandler);
private void DoubleClickHandler(DoubleClick e)
{
if
{
if
(e.Row == -1) // the user clicked on a header
{
string headerName = e.ColUID
// do something.
{
string headerName = e.ColUID
// do something.
}
}
Regards,
paolo
}
Regards,
paolo
0
Please sign in to leave a comment.
Comments
0 comments