Disable GridView Validation

9 posts, 0 answers
  1. MiroslavStantic
    MiroslavStantic avatar
    42 posts
    Member since:
    Oct 2003

    Posted 26 Jul 2010 Link to this post

    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
  2. Stefan Dobrev
    Admin
    Stefan Dobrev avatar
    790 posts

    Posted 29 Jul 2010 Link to this post

    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
  3. Matthew
    Matthew avatar
    7 posts
    Member since:
    Mar 2009

    Posted 11 Dec 2012 Link to this post

    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?
  4. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 12 Dec 2012 Link to this post

    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.

  5. Matthew
    Matthew avatar
    7 posts
    Member since:
    Mar 2009

    Posted 12 Dec 2012 Link to this post

    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>
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 12 Dec 2012 Link to this post

    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.

  7. Matthew
    Matthew avatar
    7 posts
    Member since:
    Mar 2009

    Posted 12 Dec 2012 Link to this post

    (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>
  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 12 Dec 2012 Link to this post

    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.

  9. Matthew
    Matthew avatar
    7 posts
    Member since:
    Mar 2009

    Posted 12 Dec 2012 Link to this post

    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">
Back to Top