Hi,
I have s small problem.
I have tried the demo Grid/DataEditing/TemplateFormUpdate. It works great (of course) but I would like to change one thing.
The result label should be inside the Template edit area:
<EditFormSettings EditFormType="Template">
<FormTemplate>Here!
But I cant reach that. The original code in the demo is:
private void DisplayMessage(bool isError, string text)
{
Label label = (isError) ? this.Label1 : this.Label2;
label.Text = text;
}
I use:
private void DisplayMessage(bool isError, string text)
{
Label errorLabel = (Label)FindControlRecursiveBobBooksRadGrid, "Label2");
errorLabel.Text = text;
}
The reason to this is that I use a lot of server-side error checking and throw different Exceptions. I catch them and presents the information in a label that I have put next to the textboxes.
I catch the error like this:
if (e.Exception != null)
{
e.KeepInEditMode = true;
e.ExceptionHandled = true;
DisplayMessage(true, e.Exception.Message);
}
So my question is: whats the best way to run the server-side error checking raise an exception (when needed) and present the result in a label next to the textboxes.
Thanks
Kalle