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

Help! about GridView validation on celledittemplate?

1 Answer 55 Views
GridView
This is a migrated thread and some comments may be shown as answers.
xie
Top achievements
Rank 1
xie asked on 02 Jul 2010, 12:08 PM
HI! Every one:
 When i use telerikGridView:RadGridView and i used the template on GridViewDataColumn as fllows
 
 
     <telerikGridView:GridViewDataColumn.CellTemplate> 
         <DataTemplate> 
             <TextBlock Text="{Binding PropertyName, Mode=TwoWay}"/>  
         </DataTemplate> 
</telerikGridView:GridViewDataColumn.CellTemplate> 
     <telerikGridView:GridViewDataColumn.CellEditTemplate> 
         <DataTemplate> 
             <TextBox Text="{Binding PropertyName, Mode=TwoWay, ValidatesOnExceptions=true, NotifyOnValidationError=true}" />    
     </DataTemplate> 
     </telerikGridView:GridViewDataColumn.CellEditTemplate> 

that i need use silverlight validation on fileds, and i throws Exception at set method
public string PropertyName  
{  
    get  
     {  
      return this.propertyName;  
     }  
 
     set  
     {  
       if (value == null || value == string.Empty)  
       {  
           throw new Exception("Property Name is Blankļ¼");  
       }  
       else if (ValidatorUtil.HasSpecialChar(value, "~!@#$%^&*().,;"))  
       {  
           throw new Exception("Property Name have special char!");  
       }  
       this.propertyName = value;  
     }  
why update the propertyname blank and exception touch off, the UI is not prompt?

1 Answer, 1 is accepted

Sort by
0
Yavor Georgiev
Telerik team
answered on 06 Jul 2010, 01:29 PM
Hi xie,

 Could you please try throwing ValidationException, and not just the regular Exception?

Regards,
Yavor Georgiev
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
xie
Top achievements
Rank 1
Answers by
Yavor Georgiev
Telerik team
Share this question
or