Home Forums WPF controls Xceed DataGrid for WPF combobox in datagrid

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

    I have a combobox in wpf datagrid, I want to default some values in the row when the selection change for that row’s combobox. I added a method to the SelectionCHanged event for that combo
    <xcdg:CellEditor x:Key=”lobEditor”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <ComboBox Name=”cboLOB” BorderThickness=”0″
    IsSynchronizedWithCurrentItem=”True”
    Background=”Transparent”
    Foreground=”{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(TextElement.Foreground)}”
    VerticalContentAlignment=”Top”
    SelectedValuePath=”LOB”
    ItemsSource=”{Binding Source={x:Static Application.Current},Path=LOB}”
    ItemTemplate=”{StaticResource lobDataTemplate}”
    IsEditable=”true”
    IsTextSearchEnabled =”true”
    TextSearch.TextPath=”LOB”
    SelectedValue=”{xcdg:CellEditorBinding}”
    SelectionChanged=”LOB_SelectionChanged”>
    <ComboBox.Resources>
    <Style TargetType=”Popup”>
    <Setter Property=”TextElement.Foreground”
    Value=”{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}” />
    </Style>
    </ComboBox.Resources>
    </ComboBox>
    </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>
    but it is not work, any help?

    Imported from legacy forums. Posted by dalia (had 2401 views)

    User (Old forums)
    Member
    Post count: 23064

    I am also having the same issue

    How can we get the selectedindex or rowindex of the datagrid in the combo box selectionchanged event handler ?

    Thanks in advance

    Raghuraj

     

    Imported from legacy forums. Posted by Raghuraj (had 273 views)

    Xceed Support
    Member
    Post count: 5658

    You can check the SelectedIndex property of the DataGridControl directly in the event handler:

    int index = dataGridControl.SelectedIndex;

    Imported from legacy forums. Posted by Jenny [Xceed] (had 285 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks for the reply but could you also be kind enough to tell me how we can get the datarow using the selected index so that i can get cell values of that row.

    Raghuraj

     

    Imported from legacy forums. Posted by Raghuraj (had 704 views)

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