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

Row goes pink when TextBox is added to GridView

2 Answers 28 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Michal
Top achievements
Rank 1
Michal asked on 31 Mar 2011, 08:13 AM
Hi I have a GridView where on column has a TextBox.

When I edit the textbox the whole row goes pink.

<telerik:RadGridView Name="AttachedFilesGridView" Grid.Column="1" Margin="3,2" Grid.Row="2" Grid.ColumnSpan="2" ShowGroupPanel="False" AutoGenerateColumns="False" CanUserReorderColumns="False" CanUserFreezeColumns="False" CanUserDeleteRows="False" CanUserInsertRows="False" RowIndicatorVisibility="Collapsed" IsFilteringAllowed="False" IsReadOnly="True" Drop="AttachedFilesGridView_Drop" AllowDrop="True" RowHeight="28">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header=""   IsReadOnly="True"  DataMemberBinding="{Binding Checked, Mode=TwoWay}">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding Checked,Mode=TwoWay}" />
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Filename" IsReadOnly="True" DataMemberBinding="{Binding PipeAttachment.Filename, Mode=TwoWay}" />
                <telerik:GridViewDataColumn Header="Description"  Width="*" IsReadOnly="False"  DataMemberBinding="{Binding Description}">
                    <telerik:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="0">
                                <TextBox Height="22" Margin="0"   VerticalAlignment="Center" Text="{Binding Description, Mode=TwoWay}"/>
                            </StackPanel>
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellTemplate>
                </telerik:GridViewDataColumn>
                <telerik:GridViewDataColumn Header="Date Uploaded" IsReadOnly="True" DataMemberBinding="{Binding DateUploaded}"/>
                <telerik:GridViewDataColumn Header="User" IsReadOnly="True" DataMemberBinding="{Binding PipeAttachment.User.UserName}"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>


How do I stop it from going pick then there is a change in the textbox?

I'm sure I am missing some "don't highlight changes" flag.

Thanx
Mike

2 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Zagorski
Telerik team
answered on 31 Mar 2011, 01:21 PM
Hi Michal,

You could try to set ValidatesOnDataErrors property to None in order to disable the UI validation in the grid.

<telerik:RadGridView Name="AttachedFilesGridView"  ValidatesOnDataErrors="None" >

Another option is to remove the Background_Invalid border and the Invalid state from the default template of the GridViewRow as described in our documentation here.

Let me know if that solves the issue.

Regards,
Vladimir Zagorski
the Telerik team
0
Michal
Top achievements
Rank 1
answered on 07 Apr 2011, 04:50 AM
ValidatesOnDataErrors property to None didn't work.

But removing the Background_Invalid border and the Invalid state from the default template of the GridViewRow did the trick.

Thank you.
Tags
GridView
Asked by
Michal
Top achievements
Rank 1
Answers by
Vladimir Zagorski
Telerik team
Michal
Top achievements
Rank 1
Share this question
or