<
Controls:GridViewDataColumn
DataMemberBinding
=
"{Binding ProductCode,Mode=TwoWay}"
Header
=
"Product Code"
Width
=
"150"
>
<
Controls:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
TextBox
Text
=
"{Binding ProductCode,Mode=TwoWay}"
MaxLength
=
"50"
/>
</
DataTemplate
>
</
Controls:GridViewDataColumn.CellEditTemplate
>
</
Controls:GridViewDataColumn
>
Hello,
I have an old Silverlight application with the following in the App.xaml file:
<Style TargetType="tk:GridViewCell" BasedOn="{StaticResource GridViewCellCoreStyle}" />
After updating to the latest, the application no more works: it crashes as soon it displays a GridView control, without any useful error message. It takes me a long time to find the error because I can no more run the application with a debugger and I have no useful error message.
As the application was running fine before I updated Telerik UI for Silverlight, I suppose that the above line is the culprit. Unfortunately, I don't know the previous version of Telerik UI for Silverlight that was used for the application.
I hope this is enough for you to find the bug.
Best regards
Hello.
I need update value of RadGridView GridViewCell then she in Edit Mode.
I use MainGrid.BeginningEdit event:
private void MainGridOnBeginningEdit(object sender, GridViewBeginningEditRoutedEventArgs args)
{
if(args == null || args.Cell.Value != null) return;
if (BeginningCellEditEvent != null)
BeginningCellEditEvent.Invoke(args);
}
In BeginningCellEditEvent handler i try set new cell value:
private void ActivityDateFactTable_OnBeginningCellEditEvent(GridViewBeginningEditRoutedEventArgs args)
{
if((args?.Cell == null || args.Cell.Value != null)) return;
if(!(args.Row.DataContext is ViewModel viewModel)) return;
var bindingPath = args.Cell.DataColumn.DataMemberBinding.Path
.Path
.Replace("[", "")
.Replace("]", "")
.Split('_');
if(bindingPath.Length < 3) return;
var calcValue = viewModel.GetCalculatedValue(bindingPath[0]);
if (calcValue != null)
{
args.Cell.Value = calcValue;
args.Cell.UpdateLayout();
}
}
or
private void ActivityDateFactTable_OnBeginningCellEditEvent(GridViewBeginningEditRoutedEventArgs args)
{
if((args?.Cell == null || args.Cell.Value != null)) return;
if(!(args.Row.DataContext is ViewModel viewModel)) return;
var bindingPath = args.Cell.DataColumn.DataMemberBinding.Path
.Path
.Replace("[", "")
.Replace("]", "")
.Split('_');
if(bindingPath.Length < 3) return;
var calcValue = viewModel.GetCalculatedValue(bindingPath[0]);
if (calcValue != null)
{
this.Dispatcher.BeginInvoke
((Action) delegate
{
args.Cell.Value = calcValue;
args.Cell.UpdateLayout();
}
);
}
}
Cell.Value is changed, but in UI not updated (as seen on screenshot).
How i can update value in UI after changing him in code and i need that cell stays in edit mode?
<
telerik:GridViewDataColumn
DataMemberBinding="{Binding NameToDisplay,
Converter={StaticResource<BR>SimpleLocalizationConverter}}"Width="Auto"><
BR
><
BR
></telerik:GridViewDataColumn
<
telerik:RadGridView
x:Name
=
"ContentItemsGrid"
ColumnWidth
=
"Auto"
AutoExpandGroups
=
"True"
AutoGenerateColumns
=
"False"
FrozenColumnCount
=
"2"
RowIndicatorVisibility
=
"Collapsed"
GridLinesVisibility
=
"Horizontal"
SelectionMode
=
"Extended"
RowDetailsVisibilityMode
=
"Visible"
Loaded
=
"ContentItemsGrid_Loaded"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewSelectColumn
/>
<
telerik:GridViewImageColumn
DataMemberBinding
=
"{Binding Image}"
/>
<
telerik:GridViewImageColumn
DataMemberBinding
=
"{Binding ContentStateIcon}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Caption}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Created, StringFormat=d}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding CreatedUser}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding LastChanged, StringFormat=d}"
/>
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding ChangedUser}"
/>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.RowDetailsStyle
>
<
Style
TargetType
=
"telerik:DetailsPresenter"
>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Stretch"
/>
</
Style
>
</
telerik:RadGridView.RowDetailsStyle
>
<
telerik:RadGridView.RowDetailsTemplate
>
<
DataTemplate
>
<
Grid
Background
=
"White"
>
<
TextBlock
Text
=
"{Binding Preview}"
Margin
=
"30 0 5 0"
TextTrimming
=
"WordEllipsis"
/>
</
Grid
>
</
DataTemplate
>
</
telerik:RadGridView.RowDetailsTemplate
>
</
telerik:RadGridView
>