Home Forums WPF controls Xceed DataGrid for WPF RichTextBox as CellEditor

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #22844 |

    Hi,

    I would like to use RichTextBox as CellEditor in DataGrid. I used this xaml code
    <xcdg:CellEditor x:Key=”helpEditor2″>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <RichTextBox Tag=”{xcdg:CellEditorBinding}”>
    <RichTextBox.Resources>
    <Style TargetType=”Popup”>
    <Setter Property=”TextElement.Foreground” Value=”{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}” />
    </Style>
    </RichTextBox.Resources>
    </RichTextBox>
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    <xcdg:CellEditor.ActivationGestures>
    <xcdg:KeyActivationGesture SystemKey=”Down” Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”Up” Modifiers=”Alt”/>
    <xcdg:KeyActivationGesture Key=”F4″/>
    <xcdg:KeyActivationGesture Key=”Space”/>
    </xcdg:CellEditor.ActivationGestures>
    </xcdg:CellEditor>

    and in columns definition of the datagridcontrol I have
    <xcdg:Column FieldName=”Help” Width=”280″ Title=”Help” CellEditor=”{StaticResource helpEditor2}”/>

    However there is a problem when I click inside the RichTextBox this Error is thown

    ‘System.Windows.Documents.FlowDocument’ is not a Visual or Visual3D.
    at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
    at System.Windows.Media.VisualTreeHelper.GetParent(DependencyObject reference)
    at Xceed.Wpf.DataGrid.DataGridControl.IsPartOfElement(DependencyObject referenceObject, DependencyObject sourceObject)
    at Xceed.Wpf.DataGrid.DataGridControl.OnPreviewMouseDown(MouseButtonEventArgs e)
    at System.Windows.UIElement.OnPreviewMouseDownThunk(Object sender, MouseButtonEventArgs e)

    Is there any solution or it is not possible to use richtextbox inside and I need to popup new window for editing?

    Thank you for your help

    Jarda

    Imported from legacy forums. Posted by Jarda Jirava (had 2464 views)

    Xceed Support
    Member
    Post count: 5658

    This seems to be a bug related to FrameworkContentElements (FrameworkElements that are not deriving from Visual )…

    There seems to be no workaround for the specific issue you encountered.

    I submitted a bug report and we’ll try to address this issue as soon as possible.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 210 views)

    User (Old forums)
    Member
    Post count: 23064

    This issue has been resolved. You can download the latest package <a href=”http://xceed.com/pages/TopMenu/Downloads/Trials.aspx”>here </a>

    Imported from legacy forums. Posted by Matt (had 3930 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.