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

Grid Columns with GridViewComboBoxColumn are initially blank

2 Answers 142 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 21 Oct 2011, 07:38 PM
Hi, i have the following Radgrid with two columns based on GridViewComboBoxColumn 

The grid works fine.

My problem is these columns apper initialy blank. 

It needs a simple click to show its values.

Please see attached screen shots.

Thanks

Ricardo

<telerik:RadGridView HorizontalAlignment="Left" Margin="12,63,0,0" Name="radGridView1"
              ItemsSource="{Binding ElementName=projectDomainDataSource, Path=Data}"
              VerticalAlignment="Top" Height="375" Width="614" AutoGenerateColumns="False" SelectionChanged="radGridView1_SelectionChanged" SelectedCellsChanged="radGridView1_SelectedCellsChanged" PreparingCellForEdit="radGridView1_PreparingCellForEdit" BeginningEdit="radGridView1_BeginningEdit" CanUserInsertRows="True" CanUserDeleteRows="False" IsReadOnly="False" CellValidated="radGridView1_CellValidated" CellValidating="radGridView1_CellValidating" CanUserFreezeColumns="False">
    <telerik:RadGridView.Columns>
        <telerik:GridViewComboBoxColumn
            Header="Cliente"
            DataMemberBinding="{Binding Customer_ID}"
            UniqueName="Customer"
            ItemsSource="{Binding ElementName=customerDomainDataSource, Path=Data}"
            SelectedValueMemberPath="ID"
            SortMemberPath="Name"
            ItemTemplate="{StaticResource ComboBoxCustomTemplate}"
            telerik:TextSearch.TextPath="ShortName"
            DisplayMemberPath="ShortName" IsVisible="True" SortingState="Ascending" />
        <telerik:GridViewDataColumn x:Name="ShortDescription" IsReadOnly="False" IsFilterable="True" TextAlignment="Left" Header="Descrição Curta"  DataMemberBinding="{Binding ShortDescription}" Width="*" />
        <!--<telerik:GridViewDataColumn
            x:Name="ResponsibleArea"  IsReadOnly="False" IsFilterable="True" TextAlignment="Left"
            Header="Área responsável"
            DataMemberBinding="{Binding ResponsibleArea}"
            Width="*" />-->
        <telerik:GridViewComboBoxColumn
            Header="Área responsável"
            DataMemberBinding="{Binding ResponsibleArea}"
            UniqueName="Area"
            ItemsSource="{Binding ElementName=areaDomainDataSource, Path=Data}"
            SelectedValueMemberPath="Id"
            DisplayMemberPath="Description" />
        <telerik:GridViewDataColumn x:Name="LongDescription"  IsReadOnly="False" IsFilterable="True" TextAlignment="Left" Header="Descrição Longa"  DataMemberBinding="{Binding LongDescription}" Width="*" />
        <telerik:GridViewDataColumn x:Name="Id" IsReadOnly="True" IsFilterable="True" TextAlignment="Center" Header="ID" DataMemberBinding="{Binding Id}" Width="*" IsVisible="False" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 24 Oct 2011, 07:02 AM
Hi Ricardo,

Please take a look at this article as well as this forum thread for a reference.
 

Best wishes,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Gio
Top achievements
Rank 1
answered on 24 Nov 2011, 04:13 PM
Resolved without static resource, but with cellTemplate.
This template is used only for view data, while on edit is used the combo box.

<tlk:GridViewComboBoxColumn Header="Categoria"
    ItemsSource="{Binding Path=EntitiesAdditional[Categorie], Mode=TwoWay}"
    DataMemberBinding="{Binding Path=Categorie, Mode=TwoWay}"
    DisplayMemberPath="Nome"
        <tlk:GridViewColumn.CellTemplate
            <DataTemplate
                <TextBlock Text="{Binding Categorie.Nome}"></TextBlock
            </DataTemplate>  
        </tlk:GridViewColumn.CellTemplate
</tlk:GridViewComboBoxColumn>
Tags
GridView
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Maya
Telerik team
Gio
Top achievements
Rank 1
Share this question
or