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

edit mode GridViewComboboxColumn don't work

4 Answers 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jupa
Top achievements
Rank 1
Jupa asked on 27 Aug 2012, 10:53 PM
HI, I´m trying this but it's don't work

my combobox don't change to edit mode, but only the comboboxes, the textbox are editables

I try put itemsources in codebehind and nothing

<telerik:RadGridView Height="77" HorizontalAlignment="Left" Margin="36,33,0,0" Name="GrdSupExplotada"
                                       VerticalAlignment="Top" Width="356" ShowGroupPanel="False"
                                       AutoGenerateColumns="False" ShowInsertRow="True" IsFilteringAllowed="False"
                                        
                                       AddingNewDataItem="GrdSupExplotada_AddingNewDataItem" RowEditEnded="GrdSupExplotada_RowEditEnded">
                                        
                      <telerik:RadGridView.Columns>
                          <telerik:GridViewComboBoxColumn x:Name="cmbActividad" DisplayMemberPath="Nombre"
                                                          IsReadOnly="False"
                                                          IsComboBoxEditable="True"
                             UniqueName ="Nombresss"
                             SelectedValueMemberPath="IdParametro"
                              Header="Actividad" DataMemberBinding="{Binding IdTipoCategoria}">
                             <!--
                              ItemsSource="{Binding Path=Parametro, Source={StaticResource ddsActividad }}"
                              <telerik:GridViewColumn.CellTemplate>
                               <DataTemplate>
                                  <TextBlock Text="{Binding Categorie.Nome}"></TextBlock>
                              </DataTemplate>
                              </telerik:GridViewColumn.CellTemplate>-->
                              </telerik:GridViewComboBoxColumn>
                           
                          <telerik:GridViewDataColumn Header="Superficie(ha)" DataMemberBinding="{Binding Superficie}" />
                          <telerik:GridViewDataColumn Header="Observación" DataMemberBinding="{Binding Observaciones}" />
                      </telerik:RadGridView.Columns>
                  </telerik:RadGridView>


y mi code behind

GrdSupExplotada.ItemsSource = aa;
((GridViewComboBoxColumn)this.GrdSupExplotada.Columns["Nombresss"]).ItemsSource = convert.dictGruposParametros["52"];
 my itemsSources have data.

I hope Yours could help me

the problem is the DataMemberBinding but, I don't understand why both are int32 an both are keys

4 Answers, 1 is accepted

Sort by
0
Jupa
Top achievements
Rank 1
answered on 28 Aug 2012, 02:48 PM
ja ja ja keys are no editables. I put a metadata and it work
0
MahMah
Top achievements
Rank 1
answered on 03 Oct 2012, 06:48 AM
Hello Dear Jupa,

I should make a key column in a RadGridView editable too, but I can't.

What do you mean by saing " I put a metadata "

Please express more what should I do ?

Thank you a lot.
0
Jupa
Top achievements
Rank 1
answered on 03 Oct 2012, 02:37 PM
In the web project, in file metadata.cs add metadata

[Editable(true, AllowInitialValue = true)]
public int IdTipoCategoria { get; set; }

to atribute, in my case IdTipoCategoria


0
MahMah
Top achievements
Rank 1
answered on 06 Oct 2012, 06:07 AM
Thank you very much.
Tags
GridView
Asked by
Jupa
Top achievements
Rank 1
Answers by
Jupa
Top achievements
Rank 1
MahMah
Top achievements
Rank 1
Share this question
or