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

Not able to Edit GridViewComboBox

1 Answer 62 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.
SivaPrasad Bevara
Top achievements
Rank 1
SivaPrasad Bevara asked on 12 Mar 2012, 10:14 AM
Hi,

I am using RadControls for Silverlight 5.0 (Version: 2012.1.215.1050), and I have issue editing the Combobox in the RadGridView.

I am using 2 different sources to load the GridView and the Combobox.
I am able to see the ComboBox, if I didnt set the DataMemberBinding property (for preselecting the item) for the Combobox. Once I set this property, then the combobox becomes like a readonly Textbox. Its preselecting the item, but not able to select the other items.

Following is the code.

<StackPanel x:Name="LayoutRoot" Background="White" DataContext="{Binding Source={StaticResource MyViewModel}}" Orientation="Vertical" Margin="10,10,10,10" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Grid x:Name="gridUploadFile" Width="950" HorizontalAlignment="Left">
            <Grid.RowDefinitions>
                <RowDefinition Height="30"></RowDefinition>
                <RowDefinition Height="300"></RowDefinition>
                <RowDefinition Height="50"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="900"></ColumnDefinition>
            </Grid.ColumnDefinitions>
  
            <TextBlock x:Name="lblMessage" Width="400" Height="30" FontWeight="Bold" Foreground="Red" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Left"></TextBlock>
            <GVControls:GVDataGrid Name="radCodes" Width="700" Height="250" VerticalAlignment="Top"
                                        IsFilteringAllowed="False"
                                        ShowGroupPanel="False"                 
                                        AutoGenerateColumns="False"
                                        ValidatesOnDataErrors="InEditMode" 
                                        ItemsSource="{Binding MyCollection}"
                                        EnableColumnVirtualization="True" HorizontalAlignment="Left" EnableRowVirtualization="True"
                                        AutoExpandGroups="True" Grid.Row="1" Grid.Column="0">
                <GVControls:GVDataGrid.Columns>
                    <GVControls:GVDataGridComboBoxColumn x:Name="grdCodes" 
                            IsComboBoxEditable="True"
                            ItemsSourceBinding="{Binding CodesLookup,Source={StaticResource MyViewModel}}" Header="Code" 
                            UniqueName="Codes" DisplayMemberPath="Name" 
                            SelectedValueMemberPath="Id" 
                            DataMemberBinding="{Binding CodeId}" Width="100">
                    </GVControls:GVDataGridComboBoxColumn>
                    <GVControls:GVDataGridTextColumn x:Name="grdCodeId" DataMemberBinding="{Binding CodeId}" Header="Code ID" Width="100"></GVControls:GVDataGridTextColumn>
                      
                </GVControls:GVDataGrid.Columns>
            </GVControls:GVDataGrid>
        </Grid>
    </StackPanel>

Please help.

Regards,
SivaPrasad.B

1 Answer, 1 is accepted

Sort by
0
SivaPrasad Bevara
Top achievements
Rank 1
answered on 14 Mar 2012, 01:36 PM
I got the fix. Its my issue.
For DataMemberBinding I am using the Key field. This is the reason its becoming like a read only.

Tags
GridView
Asked by
SivaPrasad Bevara
Top achievements
Rank 1
Answers by
SivaPrasad Bevara
Top achievements
Rank 1
Share this question
or