or
private void editCabinetForm_AutoGeneratingField(object sender, Telerik.Windows.Controls.Data.DataForm.AutoGeneratingFieldEventArgs e) { if (e.PropertyName == "CabinetName") { e.DataField.Label = "Cabinet Name"; } else if (e.PropertyName == "BriefDescription") { e.DataField.Label = "Brief Description"; } else if (e.PropertyName == "Comments") { RadRichTextBox commentsBox = new RadRichTextBox(); //commentsBox.SetBinding(???, new Binding("Comments")); e.DataField.Content = commentsBox; e.DataField.Label = "Comments"; } else { e.Cancel = true; } }dBVideoArchiveDataSetArchiveTableTableAdapter.Update(dBVideoArchiveDataSet.ArchiveTable);
dBVideoArchiveDataSet.AcceptChanges();
radGridView1.Rebind();
-populate table (set binding in row_loaded)
-set background on viewmodel
-converter not called.
-clear table
-populate table (again create binding)
-set background, then it is called.
While in debug, when I checked PropertChanged.Target, in first run it is System.ComponentModel.PropertyChangedEventManager (doesnt work),
and in the second run, it is Telerik.Windows.Data.WeakEvent.WeakListener<System.ComponentModel.PropertyChangedEventArgs>.
Telerik version : 2011.1.411.40
MultiBinding multiBindingBackground = new MultiBinding(); multiBindingBackground.Converter = cellColorConverter; Binding background = new Binding("Background"); background.Source = row.Item; background.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; //background.Mode = BindingMode.TwoWay; multiBindingBackground.Bindings.Add(background); multiBindingBackground.Bindings.Add(rcBinding); Binding isBackgroundForBackground = new Binding(); isBackgroundForBackground.Source = true; multiBindingBackground.Bindings.Add(isBackgroundForBackground); multiBindingBackground.Bindings.Add(new Binding()); cellBase.SetBinding(GridViewCellBase.BackgroundProperty, multiBindingBackground);private void SetShapeParameters() { if (this.MapControl != null) { Rectangle rect = this.Shape as Rectangle; Size size = this.MapCanvas.GetPixelSize(this.Location, this.RadiusX, this.RadiusY); if (!double.IsNaN(size.Width) && !double.IsInfinity(size.Width)) { rect.RadiusX = size.Width; } if (!double.IsNaN(size.Height) && !double.IsInfinity(size.Height)) { rect.RadiusY = size.Height; } } }<Window x:Class="Crash_Example.MainWindow" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" Title="Crash Example" Height="350" Width="525"> <telerik:RadGridView x:Name="TheGrid" Style="{StaticResource CrashGrid}"> <telerik:RadGridView.Columns> <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding A}" UniqueName="A" Header="A" DisplayMemberPath="Data" SelectedValueMemberPath="Id" ItemsSourceBinding="{Binding Converter={StaticResource converter}, ConverterParameter=A, Mode=OneWay}" /> <telerik:GridViewComboBoxColumn DataMemberBinding="{Binding B}" UniqueName="B" Header="B" DisplayMemberPath="Data" SelectedValueMemberPath="Id" ItemsSourceBinding="{Binding Converter={StaticResource converter}, ConverterParameter=B, Mode=OneWay}" /> <telerik:GridViewColumn UniqueName="Arrow" Style="{StaticResource ArrowColumn}" /> <telerik:GridViewDataColumn UniqueName="C" Header="C"> <telerik:GridViewDataColumn.CellEditTemplate> <DataTemplate> <TextBox Text="{Binding C}" MaxLength="20" /> </DataTemplate> </telerik:GridViewDataColumn.CellEditTemplate> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn UniqueName="D" Header="D"> <telerik:GridViewDataColumn.CellEditTemplate> <DataTemplate> <TextBox Text="{Binding D}" MaxLength="20" /> </DataTemplate> </telerik:GridViewDataColumn.CellEditTemplate> </telerik:GridViewDataColumn> </telerik:RadGridView.Columns> </telerik:RadGridView></Window><Application x:Class="Crash_Example.App" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" xmlns:Crash_Example="clr-namespace:Crash_Example" StartupUri="MainWindow.xaml"> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary> <Crash_Example:Converter x:Key="converter" /> <Style x:Key="CrashGrid" TargetType="telerik:RadGridView"> <Setter Property="AutoGenerateColumns" Value="False" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="CanUserInsertRows" Value="True" /> <Setter Property="CanUserReorderColumns" Value="False" /> <Setter Property="ClipboardPasteMode" Value="Cells" /> <Setter Property="DataLoadMode" Value="Asynchronous" /> <Setter Property="EditTriggers" Value="CellClick" /> <Setter Property="EnableColumnVirtualization" Value="True" /> <Setter Property="EnableRowVirtualization" Value="True" /> <Setter Property="IsFilteringAllowed" Value="False" /> <Setter Property="ItemsSource" Value="{Binding Path=Data}" /> <Setter Property="SelectionMode" Value="Extended" /> <Setter Property="ShowInsertRow" Value="False" /> </Style> <Style x:Key="ArrowColumn" TargetType="telerik:GridViewColumn"> <Setter Property="Background" Value="#FF727272" /> <Setter Property="IsEnabled" Value="False" /> <Setter Property="IsFilterable" Value="False" /> <Setter Property="IsGroupable" Value="False" /> <Setter Property="IsReadOnly" Value="True" /> <Setter Property="IsResizable" Value="False" /> <Setter Property="IsSortable" Value="False" /> <Setter Property="IsVisible" Value="True" /> <Setter Property="Width" Value="30" /> <Setter Property="CellTemplate"> <Setter.Value> <DataTemplate> <TextBlock Background="Transparent" Foreground="WhiteSmoke" FontWeight="Bold" FontFamily="Arial Unicode MS" HorizontalAlignment="Center"> ➨ </TextBlock> </DataTemplate> </Setter.Value> </Setter> </Style> </ResourceDictionary> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources></Application>const string message = "We're sorry, an error has occurred. Please report this to your support representative.";var errorTextBox = new TextBox{ IsReadOnly = true, Text = exception.ToString(), TextWrapping = TextWrapping.Wrap, TextAlignment = TextAlignment.Left, VerticalContentAlignment = VerticalAlignment.Top, MaxWidth = 360, Height = 150};errorTextBox.MouseDoubleClick += delegate { errorTextBox.SelectAll(); };var panel = new StackPanel();panel.Children.Add(new TextBlock { Text = message, Padding = new Thickness(0, 0, 0, 12), TextWrapping = TextWrapping.Wrap });panel.Children.Add(new RadExpander { Content = errorTextBox, Header = "Details..." });var dialogParameters = new DialogParameters{ Owner = owner, Header = "An error has occurred", Content = new ContentControl { MaxWidth = 400, MinHeight = 80, Content = panel }, Opened = (sender, e) => ((ContentControl)sender).Focus()};RadWindow.Alert(dialogParameters);