Telerik Forums RSShttp://www.telerik.com/urn:uuid:562c292e-b799-441f-a51d-2f1943bc6066http://www.telerik.com/forums/permalink/LiksVpm3H0SlHS8ZQ7xgZgHow to set the label for Validation errors?Hello Nivin,
<p>You can create a new ControlTemplate for DataFormValidationSummary and set it through RadDataForm's ValidationSummaryStyle property. In this ControlTemplate you can set a new ItemTemplate to the ItemsControl placed in the summary. Please, use the latest internal build, if possible, as we have fixed a related issue there.</p>
Kind regards,<br />
Ivan Ivanov <br />
the Telerik team
<div class="forumBaloonTop"></div>
<div class="forumBaloon">
<p class="MsoNormal" style="line-height: normal; margin: 0in 0in 10pt;"><span style="font-size: 7pt; font-family: arial, sans-serif; color: #333333;">
Explore the entire Telerik portfolio by </span><a href="http://www.telerik.com/download-trial-file.aspx?pid=763"><span style="font-size: 7pt; text-decoration: none; font-family: arial, sans-serif; color: #3366cc;">downloading Telerik DevCraft Ultimate</span>.</a></p>
</div>
<div class="forumBaloonBottom"></div>urn:uuid:70f5713e-6172-4310-9123-1dec1b4c3485http://www.telerik.com/forums/permalink/PnH1cHJhEEORIx3sG0w0hQHow to set the label for Validation errors?Hello Ivan,<br>
<br>
Could you please post some example code in which you have retemplated the validation summary ItemTemplate .&nbsp;<br>
<br>
Thank you.<br>urn:uuid:1a87152b-7c99-4363-80cf-27e2c47153a5http://www.telerik.com/forums/permalink/KxWHGpl8Y0OAzyfixHFTpQHow to set the label for Validation errors?Hi Jeff,<br />
<br />
Please excuse mo for the delayed answer. RadDataForm internally manages binding DataErrors and there is no easy way to make big changes in this mechanism. However, you can try disabling it.&nbsp;Basically it executes this logic on the BindingValidationError event, so that you can subscribe to it on DataFields' level and handle it there. Then you can implement your own custom validation errors&nbsp;like this:<br />
<div class="tFormatCodeBlock supportThreadCodeBlock" id="highlighter_76576" style="overflow-y: auto;border: #7f9db9 1px solid;">
<div style="background-color: #fff;"><span style="margin-left: 0px !important;"><code style="color: #000;">radDataForm.ValidationSummary.Errors.Add(...);</code></span></div>
</div>
Please, be advised that in case you choose this approach, you should also manage these errors removal from the validation summary. An alternative approach would be to retemplate the validation summary ItemTemplate, adding a converter that will generate the desired label names. As for the last point of your list, it will be great if you can send us a small project that illustrates your approach via a support ticket, so that we could debug it and implement a solution on our side. Please, do not hesitate to ask us for an example project if you have any difficulties while implementing the proposed approach, in case it meets your requirements.<br />
<br />
Greetings,<br />
Ivan Ivanov <br />
the Telerik team
<div class="forumBaloonTop"></div>
<div class="forumBaloon"><span style="font-family: &quot;arial&quot;,&quot;sans-serif&quot;; color: #333333; font-size: 7pt;">Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. </span><a href="http://www.telerik.com/account/your-products/trial-product-versions/download-trial-file.aspx?pid=763"><span style="font-family: &quot;arial&quot;,&quot;sans-serif&quot;; color: #3366cc; font-size: 7pt; text-decoration: none;">Get it now &gt;&gt;</span></a><o:p _rdEditor_exists="1"></o:p></div>
<div class="forumBaloonBottom"></div>urn:uuid:0c0e3db6-8415-4f7a-94bf-14397dd4f9e9http://www.telerik.com/forums/permalink/tj0ODBWEek-UvxQ5fdT56QHow to set the label for Validation errors?Any ideas?&nbsp; I'm lost.urn:uuid:cfa65bc7-670f-493b-b9ba-7b2590ed6614http://www.telerik.com/forums/permalink/x1umzw9nO0m5unslkO1mFAHow to set the label for Validation errors?I have a RadDataForm with a number of DataFormDataField. They are bound to an object of a class that implements IDataErrorInfo, and when a field control validation, it's surrounded by a red box and an error message is displayed at the bottom of the form, prefixed by the DataFormDataField's label.<br />
<br />
I have three problems:<br />
<br />
<ol>
<li>What if the label I want to display in the form isn't the label I want to display with the error message?&nbsp; I have a couple of controls where I want the label to include a closing colon, and that results in two colons in the error message.</li>
<li>What if the control is not a DataFormDataField? The error message for these seems to display the name of the property it is bound to - and that's usually not what I want.</li>
<li>I have added BindingGroups to a number of GroupBoxes on the form, that return errors if something about the group is wrong. (None of the fields in the group have been selected, etc.) These display an error message that just has a colon, with no label name at all.</li>
</ol>
<p >Seems like these are all different aspects of the same problem. Where does the form's error message display look, to get the names it includes, and how can I override this so as to use the labels I choose?</p>