3 Answers, 1 is accepted
0
Hello Marco,
Peter
the Telerik team
Thank you for the writing.
I would like to suggest subscribing to the event after the control is initialized, for example:
radCheckBoxElement1.ToggleState = Telerik.WinControls.Enumerations.ToggleState.OnAddHandler radCheckBoxElement1.ToggleStateChanged, AddressOf ToggleStateChangedSub ToggleStateChanged(sender as object, args as StateChangedEventArgs)End SubI hope this helps.
Peter
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
0
Marco
Top achievements
Rank 1
answered on 02 Dec 2011, 08:22 AM
Hello Peter,
thank you for your reply.
I made a fault, because in my logic I convert the RadItem, to the RadCheckBoxElement or the RadButtonElement, etc., with the as C# operator.
The RadCheckBoxElement inherits from the RadButtonElement, so the event was subscibed twice.
I corrected my logic like this example:
Best regards.
Marco
thank you for your reply.
I made a fault, because in my logic I convert the RadItem, to the RadCheckBoxElement or the RadButtonElement, etc., with the as C# operator.
The RadCheckBoxElement inherits from the RadButtonElement, so the event was subscibed twice.
I corrected my logic like this example:
foreach (RadItem radItem in items){ bool handled = false; RadRibbonBarGroup ribbonBarGroup = radItem as RadRibbonBarGroup; if (ribbonBarGroup != null && !handled) { this.InitializeRibbonBarItemsState(ribbonBarGroup.Items); handled = true; } RadRibbonBarButtonGroup ribbonBarButtonGroup = radItem as RadRibbonBarButtonGroup; if (ribbonBarButtonGroup != null && !handled) { this.InitializeRibbonBarItemsState(ribbonBarButtonGroup.Items); handled = true; } RadCheckBoxElement checkBoxElement = radItem as RadCheckBoxElement; if (checkBoxElement != null && !handled) { this.InitializeCheckBoxElement(checkBoxElement); handled = true; } RadDropDownListElement dropDownListElement = radItem as RadDropDownListElement; if (dropDownListElement != null && !handled) { this.InitializeRadDropDownListElement(dropDownListElement); handled = true; } RadButtonElement buttonElement = radItem as RadButtonElement; if (buttonElement != null && !handled) { this.InitializeButtonElement(buttonElement); handled = true; }}Best regards.
Marco
0
Hello Marco,
Peter
the Telerik team
I am happy to hear that you managed to get it working.
Do not hesitate to write me back if you have further questions.
Peter
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.