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

RadGridView is not updated

2 Answers 255 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ENTERPRISE INTERNATIONAL SAS
Top achievements
Rank 1
ENTERPRISE INTERNATIONAL SAS asked on 09 Sep 2010, 12:07 AM

Hi!

I have 2 panels, first one for details from every row and second one to show all rows via RadGridView like this:

<Grid x:Nme="pnlDetalle">

<Label x:Name="lblCodigo" Content="Código" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Margin="8,8.5,76,8.499"/>
<telerik:RadMaskedTextBox x:Name="fmtCodigo" IsEnabled="False" Style="{DynamicResource Estilo1MaskedTextBox}" Value="{Binding ElementName=grdGridConsulta, Path=SelectedItem.CA001, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" Margin="87,0,0,8.5" HorizontalAlignment="Left" Width="51.92" VerticalAlignment="Bottom" TabIndex="0" />
   Label x:Name="lblTitulo" Content="Titulo" Margin="21,84,0,0" VerticalAlignment="Top" Width="77" Height="27"/>
<TextBox x:Name="txtTitulo" Style="{StaticResource Estilo1TextBox}" Text="{Binding ElementName=grdGridConsulta, Path=SelectedItem.CA002, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" HorizontalAlignment="Left" Margin="102,84,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="27" TabIndex="1" Width="230"/>
<Label x:Name="lblEjecutable" Content="Ejecutable" Margin="21,121,0,0" VerticalAlignment="Top" Width="77" Height="27"/>
<TextBox x:Name="txtEjecutable" Style="{StaticResource Estilo1TextBox}" Text="{Binding ElementName=grdGridConsulta, Path=SelectedItem.CA003, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" HorizontalAlignment="Left" Margin="102,121,0,0" TextWrapping="Wrap" VerticalAlignment="Top" TabIndex="2" Width="301" Height="27"/>
<Label x:Name="lblID" Content="ID" Margin="21,159,0,0" VerticalAlignment="Top" Width="77" Height="27"/>
<TextBox x:Name="txtID" Style="{StaticResource Estilo1TextBox}" Text="{Binding ElementName=grdGridConsulta, Path=SelectedItem.CA004, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" HorizontalAlignment="Left" Margin="102,159,0,0" TextWrapping="Wrap" Height="27" VerticalAlignment="Top" TabIndex="3" Width="128"/>
<telerik:RadToggleButton x:Name="chkInactivo" Content="Inactivo?" IsChecked="{Binding ElementName=grdGridConsulta, Path=SelectedItem.CA005, Mode=TwoWay, Converter={StaticResource ValueConverter}}" Style="{StaticResource EstiloCheckBox}" HorizontalAlignment="Left" Margin="21,202.98,0,0" Width="86" Height="22" VerticalAlignment="Top" TabIndex="4">
<telerik:RadToggleButton.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFEBEBEB" Offset="0.074"/>
<GradientStop Color="#FFD2D2D2" Offset="0.93"/>
<GradientStop Color="#FFC6C6C6" Offset="0.561"/>
<GradientStop Color="#FFEDEDED" Offset="0.504"/>
<GradientStop Color="#FFF3F3F3" Offset="1"/>
<GradientStop Color="White" Offset="0.017"/>
</LinearGradientBrush>
</telerik:RadToggleButton.Background>
</telerik:RadToggleButton>
</Grid>

<Grid x:Name="pnlConsulta" Height="322">
<telerik:RadGridView x:Name="grdGridConsulta" ItemsSource="{Binding}" Margin="19,20.675,23,8" ShowGroupPanel="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" AutoGenerateColumns="False" ColumnWidth="Auto" CanUserInsertRows="False" IsReadOnly="True">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="[lblCodigo]" DataMemberBinding="{Binding CA001, Mode=TwoWay}" UniqueName="CA001" HeaderTextAlignment="Center" TextAlignment="Right"/>
<telerik:GridViewDataColumn Header="[lblTitulo]" DataMemberBinding="{Binding CA002, Mode=TwoWay}" UniqueName="CA002" HeaderTextAlignment="Center"/>
<telerik:GridViewDataColumn Header="[lblEjecutable]" DataMemberBinding="{Binding CA003, Mode=TwoWay}" UniqueName="CA003" HeaderTextAlignment="Center"/>
<telerik:GridViewDataColumn Header="[lblID]" DataMemberBinding="{Binding CA004, Mode=TwoWay}" UniqueName="CA004" HeaderTextAlignment="Center"/>
<telerik:GridViewCheckBoxColumn Header="[chkInactivo]" DataMemberBinding="{Binding CA005, Mode=TwoWay, Converter={StaticResource ValueConverter}}" UniqueName="CA005" HeaderTextAlignment="Center"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>

however when I change text into any TextBox, cells into radgridView doesn't reflect changes, I guess due to IsReadOnly="True" property I Set as I need only from Details panel users can make changes, so:

1 - I need those changes be reflected in radGridView, how can I do this?

2 - RadgridView is binded by DataContext where source is a DataTable.DefaultView. My second question is, Any changes happen in cells affects automatically data rows into DataTable? - I need this happen in this way

Thanks for your help

2 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 13 Sep 2010, 03:26 PM
Hello Ramiro,

Can you try to reproduce the problem in the attached sample project. I was not able to.

Please let me know.

All the best,
Veselin Vasilev
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
ENTERPRISE INTERNATIONAL SAS
Top achievements
Rank 1
answered on 14 Sep 2010, 03:14 PM

Hi!

I found a solution about it. The point was happened to me due to radGridView IsReadOnly = true, not edit cells was starting, this is good for me since I have a details panel with textboxes to accomplish this scenario. Every textbox is bounded with radGridView by using Text="{Binding ElementName=myGrid, Path=SelectedItem.COLUMN, Mode=TwoWay, UpdateSourceTrigger=LostFocus}".

It is supposed cells corresponding to COLUMN into myGrid reflects the change when lostfocus is triggered, but it was not happened, so I guessed it was due to IsReadOnly property was true; I set IsReadOnly property to false, but same problem,

so solution I found was to change UpdateSourceTrigger=Explicit, by code txtMyTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource(); and then execute myGrid.Rebind() and it worked

thanks

Tags
GridView
Asked by
ENTERPRISE INTERNATIONAL SAS
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
ENTERPRISE INTERNATIONAL SAS
Top achievements
Rank 1
Share this question
or