I’m using RadDropDownButton inside DataForm, it contains RadTreeView from which user can select item. This property is required in my model, so when validation is performed in validation summary error message appears, but RadDropDownButton style is not changed (red border and tooltip). Is it possible to set this style (like for RadComboBox).
Best regards,
Predrag
5 Answers, 1 is accepted
The RadDropDownButton doesn't implement validation states out-of-the-box. But you can edit its ControlTemplate to add validation states and then implement your own logic to go to the appropriate visual state. You can examine the current structure of the RadDropDownButton.ControlTemplate here. And I also attached a sample project to get you started. Please let us know if we can further assist you.
Regards,
Tina Stancheva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Hi Tina,
Sorry for late response.
I tried changed style like you explained (even copied your style), but with no success (control never apply those validation styles). I did similar thing for RadComboBox and it works, maybe I am missing something here, but I didn’t have more time to go dipper into problem.
I think that the best way to achieve the validation functionality is to create your own DropDownButton by inheriting ours and then add an IsValid property on which change you'll set the correct VisualState.
I've created a sample project with a DataForm, TreeViews and DropDownButtons so could you please examine it and see if this is what you're looking for? In the TreeView you'll see Items and Invalid Items and if you select an Invalid Item the dropdownbutton should become red and if you focus it it's error tooltip should appear.
If you have more questions please feel free to ask.
Greetings,
Zarko
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Is it possible that you can attach the RadDropDown button controltemplate xaml in file to me? I can't open it up RadDropDown button with my Blend 4 as you show on the
http://www.telerik.com/help/silverlight/radbuttons-styles-and-templates-template-structures.html
Thank you!
You can find the default ControlTemplates of our controls in your installation directory. For more information on that matter please refer to our Editing Control Templates article.
Do not hesitate to contact us if you have any other questions.
Regards,
Pavel R. Pavlov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.