Welcome to the Xceed Community | Help
Community Search  
More Search Options

Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

Sort Posts: Previous Next
  •  09-03-2009, 8:57 AM Post no. 23699

    Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

    Hello,

             I am using the Custom Control in the Exceed Data Grid as CellEditor in one of the Column. Now i am getting the custom control when the cell/column is in the Edit Mode.  Now when i am selecting a value from the Custom Control. Its value is being selected but the column/Cell is not reflected with the Selected value.

     

      <Window.Resources>
            <xcdg:CellEditor x:Key="categoryEditor">
                <xcdg:CellEditor.EditTemplate>
                    <DataTemplate>
                          <ComboBox BorderThickness="0"
                                MinHeight="22"
                                VerticalContentAlignment="Top"
                                SelectedValue="{xcdg:CellEditorBinding}"
                                FocusVisualStyle="{x:Null}">
                            <ComboBox.Resources>
                                <Style TargetType="Popup">
                                    <Setter Property="TextElement.Foreground"
                                       Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
                                </Style>
                            </ComboBox.Resources>
                            <s:String>A</s:String>
                            <s:String>R</s:String>
                        </ComboBox>
                    </DataTemplate>
                </xcdg:CellEditor.EditTemplate>
            </xcdg:CellEditor>
            <xcdg:CellEditor x:Key="ucCategoyrEditor">
                <xcdg:CellEditor.EditTemplate>
                    <DataTemplate>
                        <common:ucEnhanceControl x:Name="ucCategory"
                                                 MyText="{xcdg:CellEditorBinding}"
                                                 Loaded="ucEnhanceControl_Loaded"
                                                 FocusVisualStyle="{x:Null}">
                           
                        </common:ucEnhanceControl>
                    </DataTemplate>
                </xcdg:CellEditor.EditTemplate>
            </xcdg:CellEditor>
        </Window.Resources>

       <xcdg:DataGridControl Name="dgcListView" AutoCreateColumns="False" ItemScrollingBehavior="Immediate" Grid.Row="1" Grid.Column="0"  Grid.ColumnSpan="3" >
                <xcdg:DataGridControl.Columns>
                    <xcdg:Column FieldName="Status"  Title="Status" CellEditor="{StaticResource categoryEditor}"/>
                    <!-- Invisible columns -->
                    <xcdg:Column FieldName="Entity Category" Title="Entity Category" CellEditor="{StaticResource ucCategoyrEditor}"/>            
                </xcdg:DataGridControl.Columns>
            </xcdg:DataGridControl>

     

    Now, here for the Column Name="Entity Category", i m using custom control for the editing and cell editor is defined in the resource file which is fine but MyText="{xcdg:CellEditorBinding}" is not working although my MyText property which is also dependency property in the Custom Control which i am binding with the xcdg:CellEditorBinding.

    So, Kindly reply me for the same. Kindly answer me for the same. As how to use the Custom Control in the Xceed Grid as the Cell Editor on how to bind the values with the Cell ?

     

    Thanks,

    Paras Sanghani


    Nothing Is Impossible
  •  09-03-2009, 5:39 PM Post no. 23730 in reply to 23699

    Re: Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

    this works for me

    <xcdg:CellEditor x:Key="WeightDesigCellEditor">
            <xcdg:CellEditor.EditTemplate>
                <DataTemplate>
                    <ComboBox BorderThickness="0"
                          BorderBrush="Transparent"
                          Foreground="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(TextElement.Foreground)}"
                          VerticalContentAlignment="Top"
                          StaysOpenOnEdit="True"
                          IsEditable="True"
                          ItemsSource="{StaticResource WeightDesigValues}"
                          SelectedItem="{xcdg:CellEditorBinding}">
                    </ComboBox>
                </DataTemplate>
            </xcdg:CellEditor.EditTemplate>
            <xcdg:CellEditor.ActivationGestures>
                <xcdg:TextInputActivationGesture/>
            </xcdg:CellEditor.ActivationGestures>
        </xcdg:CellEditor>

     

    Also possible the MyText property is a String and what you are binding to is not a string? You must use a converter like so:

    <xcdg:CellEditor x:Key="DoubleCellEditor">
            <xcdg:CellEditor.EditTemplate>
                <DataTemplate>
                    <xcd:AutoSelectTextBox AutoSelectBehavior="OnFocus" Text="{xcdg:CellEditorBinding
                                                    Converter={StaticResource DoubleConverter}}"
                                            BorderBrush="Transparent"/>
                </DataTemplate>
            </xcdg:CellEditor.EditTemplate>
            <xcdg:CellEditor.ActivationGestures>
                <xcdg:TextInputActivationGesture />
            </xcdg:CellEditor.ActivationGestures>
        </xcdg:CellEditor>

  •  09-04-2009, 1:32 AM Post no. 23735 in reply to 23699

    Re: Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

    Thanks, for the reply.

     No, i myText property is also the string and the database field to which column is bind is also string so there dont need to put the converter. But the custom control which we are using allows users to select the record from the other Xceed Grid as the input. So we are using the custom control which allows user to select the input from the other Xceed grid.

    So, kindly reply me for the same

    Thanks,

    Paras Sanghani
    Nothing Is Impossible
  •  09-04-2009, 9:47 AM Post no. 23748 in reply to 23735

    Re: Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

    Hello,

       Tommy 

    We are not able to bind the Dependency property to the celleditorbinding. The proptery MyText property is also of the same type as my column was.

    Can u assist me for the same as this is the big problem we are facing. Can you give me the example for the custom control binding to the ColumnEditorBinding. Please help me for the same

    Thanks,

    Paras Sanghani


    Nothing Is Impossible
  •  09-07-2009, 1:21 AM Post no. 23783 in reply to 23748

    Re: Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

    Hello,

       Kindly reply for this post if anyone knows the same. As what we need to have other than dependency property in the custom controls for the celleditorbinding. As we are facing this issues.

    We are not able to use custom control as the CellEditorBinding is not able to bind with the custom control dependency property of the same datatype.

    So please help me out for the same.

     

    Thanks,

    Paras Sanghani

     


    Nothing Is Impossible
  •  09-08-2009, 5:40 AM Post no. 23807 in reply to 23783

    Re: Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

    Hello Xceed Support Team,

       Kindly reply for this post if anyone knows the same. As what we need to have other than dependency property in the custom controls for the celleditorbinding. As we are facing this issues.

    We are not able to use custom control as the CellEditorBinding is not able to bind with the custom control dependency property of the same datatype.

    So please help me out for the same.

     

    Thanks,

    Paras Sanghani

     


    Nothing Is Impossible
  •  09-09-2009, 10:31 AM Post no. 23846 in reply to 23807

    Re: Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

    Hello,

       Kindly reply for the same.

     

    Thanks,

    Paras Sanghani

     


    Nothing Is Impossible
  •  09-28-2009, 1:52 PM Post no. 24199 in reply to 23807

    Re: Is Custom Control allowed as the Xceed DataGrid Column as CellEditor in Xceed DataGrid?

    Hi Paras,

    Setting the CellEditorBinding on the dependency property of your custom control should work as shown in several samples such as the ComboBox of the IncludedEditors example. To pursue the investigation, we need to review your project including the assemblies of your editor. Thank you for submitting this artefact.

     


    Xceed - Software Developer and Technical Support
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.