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

Disable GridView Validation

8 Answers 139 Views
GridView
This is a migrated thread and some comments may be shown as answers.
MiroslavStantic
Top achievements
Rank 1
Iron
MiroslavStantic asked on 26 Jul 2010, 10:03 AM
Hi,

I want to explain my problem in screenshots.
1. I have GridView that binds to DDS. See step1.PNG screen shot.

2. When user clicks on Edit button a rad dialog window opens with DDS.CurrentItem displayed in data form. See step2.PNG. Description is required and Data Validation on the form shows it. You can also see that underlying grid, its selected row, also shows data validation message.

3. In step 3 (see step3.PNG) I fill up Description and data validation message is not showing any more, but in underlying grid validation message still stays.

4. User clicks on Save button, in dialog closed event DDS.SubmitChanges is called. Everything works but the grid's validation message still stays there. See step4.png. I need to re-load data to get rid of the validation message.

Is there a way I can refresh data in a datagrid withot really making a round-trip to the database?

Is there a way I can disable validation in the grid? (Grid is set to be ReadOnly anyway)

Thanks

Miroslav

8 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 29 Jul 2010, 10:21 AM
Hello Miroslav,

This seems to be a bug in our current implementation. We are not reevaluating the cell's row validation state when the new valid value is entered into the DataForm. I have logged this issue in our bug tracking system and you can follow it using its ID 2894.

Thanks for reporting this bug. I have updated your Telerik points respectively.

Kind regards,
Stefan Dobrev
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
Matthew
Top achievements
Rank 1
answered on 11 Dec 2012, 04:08 PM
this question didn't get answered:

Is there a way I can disable validation in the grid? (Grid is set to be ReadOnly anyway)

I'm in the same situation, I've got a read only grid that's displaying the red box around a row bound to a data object that is invalid based off of a required annotation. I don't want the red box, ever. How do I make it go away?
0
Vlad
Telerik team
answered on 12 Dec 2012, 07:26 AM
Hello,

 You can control the grid validation using ValidateOnDataErrors property. For example you can set it to None.

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Matthew
Top achievements
Rank 1
answered on 12 Dec 2012, 02:37 PM
Yeah, I tried that already, it's still showing. I mearly did this:
<telerik:RadGridView ValidatesOnDataErrors="None"  Grid.Row="1" Margin="12" AutoGenerateColumns="False" CanUserFreezeColumns="False" IsFilteringAllowed="False" IsReadOnly="True" ItemsSource="{Binding Documents}" RowHeight="32" RowIndicatorVisibility="Collapsed" SelectedItem="{Binding SelectedDocument, Mode=TwoWay}" ShowGroupPanel="False">
           <telerik:RadGridView.Columns>
               <telerik:GridViewDataColumn Header="viewed">
                   <telerik:GridViewDataColumn.CellTemplate>
                       <DataTemplate>
                           <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Resources/check.png" Stretch="None" Visibility="{Binding Viewed, Converter={StaticResource BooleanToVisibilityConverter}}" />
                       </DataTemplate>
                   </telerik:GridViewDataColumn.CellTemplate>
               </telerik:GridViewDataColumn>
               <telerik:GridViewDataColumn DataMemberBinding="{Binding FileName}" Header="file name" />
           </telerik:RadGridView.Columns>
       </telerik:RadGridView>
0
Vlad
Telerik team
answered on 12 Dec 2012, 02:49 PM
Hi,

You may need to set the same property for your bindings in your custom templates. 

All the best,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Matthew
Top achievements
Rank 1
answered on 12 Dec 2012, 03:21 PM
(thanks for the replies, not trying to be annoying...)

I tried this and it didn't work:
<telerik:RadGridView Grid.Row="1" Margin="12" AutoGenerateColumns="False" CanUserFreezeColumns="False" IsFilteringAllowed="False" IsReadOnly="True" ItemsSource="{Binding Documents}" RowHeight="32" RowIndicatorVisibility="Collapsed" SelectedItem="{Binding SelectedDocument, Mode=TwoWay}" ShowGroupPanel="False" ValidatesOnDataErrors="None">
 
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Header="viewed" ValidatesOnDataErrors="None">
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <Image HorizontalAlignment="Center" VerticalAlignment="Center" Source="/Resources/check.png" Stretch="None" Visibility="{Binding Viewed, Converter={StaticResource BooleanToVisibilityConverter}}" />
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
        </telerik:GridViewDataColumn>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding FileName}" Header="file name" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>
0
Vlad
Telerik team
answered on 12 Dec 2012, 03:30 PM
Hello,

I'm not sure where you have set the property? Can you clarify? The code in your CellTemplate is exactly the same with the code from your previous reply. 

Kind regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Matthew
Top achievements
Rank 1
answered on 12 Dec 2012, 05:46 PM
Vlad, this is what changed from the previous:

I added the 'Validates' to the GridViewDataColumn, I assumed that's what you were referring to. So what did you want me to add?
<telerik:GridViewDataColumn Header="viewed" ValidatesOnDataErrors="None">
Tags
GridView
Asked by
MiroslavStantic
Top achievements
Rank 1
Iron
Answers by
Stefan Dobrev
Telerik team
Matthew
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or