This is a migrated thread and some comments may be shown as answers.

[Solved] Validating Gridview Cell

7 Answers 252 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Asaduzzaman
Top achievements
Rank 1
Asaduzzaman asked on 15 Jul 2010, 10:45 AM
I have written some code in my Gridview CellValidating event to checked SSN field unique when user add/edit records.
I have also set GridViewCellValidatingEventArgs ErrorMessage when get duplicate data.Now I want show error message
in rectangular box as alert with red color and set focus on error message cell.

Thanks

7 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 15 Jul 2010, 12:54 PM
Hi Asaduzzaman,

Please provide us with more details about your requirements and expectations for the appearance of the Error Message. Following up this forum thread, when an item is edited or a new one is added, an immediate validation is performed. That results in coloring the borders of the cell with the incorrect value in red and a red Message Box appears with an explanation of the error. You can find more information about data validation in our online documentation.    

All the best,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Asaduzzaman
Top achievements
Rank 1
answered on 19 Jul 2010, 06:05 AM
I have solved my problem but rectangular box with error message not popup when error found.Its only show when mouse hover in the 
error cell.Would please give me some idea how can i popup this error message rectangular automatically like other error field.
0
Maya
Telerik team
answered on 22 Jul 2010, 10:19 AM
Hi Asaduzzaman,

You need to change the Templates for the Invalid States and to use a ContentControl instead of the ToolTip. I am sending you a sample project with all the predefined Templates.
I hope that helps. 

Kind regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Lee
Top achievements
Rank 1
answered on 18 Aug 2010, 09:24 PM
Maya, I'm having trouble running your sample code.

I get an exception on Cell Validating.  The exception is: "System.InvalidOperationException: Cannot resolve TargetName border".

Is there any reason I shouldn't be able to run this sample.  I'm using RadControls for Silverlight version 2010.2.812.

Thank you.
0
Maya
Telerik team
answered on 19 Aug 2010, 08:16 AM
Hello Lee Weisenberger,

I have updated the sample project so that the Exception you are receiving will not be raised and the cause for it is removed. 
 

Sincerely yours,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Deborah
Top achievements
Rank 1
answered on 21 Jun 2011, 02:20 PM
Hello Maya,
could you please specify how I have to modify my files in order to have the same style for the error message BOTH IF it is the default message ("input string is not in a correct format", which appears for example if I enter a letter in a column with numeric values) AND if I use the cellvalidation event and I set the error message from code?
Thank you very much.
0
Maya
Telerik team
answered on 23 Jun 2011, 03:45 PM
Hi Deborah,

If you want to edit the ToolTip of the default validation coming from the Framework, you can edit the template of the TextBox itself. The approach should be similar to the one illustrated in the sample attached above. 
Please let me know if you need any further assistance with it.

Regards,
Maya
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Asaduzzaman
Top achievements
Rank 1
Answers by
Maya
Telerik team
Asaduzzaman
Top achievements
Rank 1
Lee
Top achievements
Rank 1
Deborah
Top achievements
Rank 1
Share this question
or