This is a migrated thread and some comments may be shown as answers.

[Solved] Row not selected with combo box in the grid

1 Answer 64 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shipra
Top achievements
Rank 1
Shipra asked on 17 Apr 2009, 04:51 PM
Hello,

In my grid, I have only one column which is a combo box. When I click on the combo box to select the row, the row doesn't get selected.

Here the XAML code for the combo box -

 

 

<telerikGrid:GridViewDataColumn HeaderText="Functions">

 

 

 

<telerikGrid:GridViewDataColumn.CellStyle>

 

 

 

<Style TargetType="GridView:GridViewCell">

 

 

 

<Setter Property="Template">

 

 

 

<Setter.Value>

 

 

 

<ControlTemplate TargetType="GridView:GridViewCell">

 

 

 

<Controls:RadComboBox ItemsSource="{Binding AllFunctions}" DisplayMemberPath="FunctionName" SelectedItem="{Binding Path=Function, Mode=TwoWay}"></Controls:RadComboBox>

 

 

 

</ControlTemplate>

 

 

 

</Setter.Value>

 

 

 

</Setter>

 

 

 

</Style>

 

 

 

</telerikGrid:GridViewDataColumn.CellStyle>

 

 

 

</telerikGrid:GridViewDataColumn>

 

1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 21 Apr 2009, 08:59 AM
Hi Shipra,

By default this should not happen (you can check standard DataGrid in Silverlight) however you can easily implement this:

...
<Controls:RadComboBox GotFocus="RadComboBox_GotFocus"></Controls:RadComboBox>
...

        private void RadComboBox_GotFocus(object sender, RoutedEventArgs e)
        {
            GridViewRow row = ((RadComboBox) sender).ParentOfType<GridViewRow>();
            if (row != null)
            {
                row.IsSelected = true;
            }
        }
...

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
GridView
Asked by
Shipra
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Share this question
or