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

Grid view - get a reference to a combox inside a raw

3 Answers 78 Views
GridView
This is a migrated thread and some comments may be shown as answers.
ron klod
Top achievements
Rank 1
ron klod asked on 22 Jul 2010, 01:48 PM
Hi,

I have a datagrid and one of the columns is combobox, in the RowLoaded event I am trying to get a reference for that combox using the follwoing
private void dgConflictResolution_RowLoaded(object sender, RowLoadedEventArgs e)
        {
  
           OblicoreCombobox combo = (OblicoreCombobox)dgConflictResolution.ChildrenOfType<OblicoreCombobox>();
             
        }
 and it returnN null,

here is the XAML:
<TelerikControls:RadGridView x:Name="dgConflictResolution" ItemsSource="{Binding Conflicts, Mode=TwoWay}"  VerticalAlignment="Stretch"  AutoGenerateColumns="False" MultipleSelect="True" CanUserSelect="True" Margin="0,0,0,0" Grid.Row="1" 
                                     RowIndicatorVisibility="Collapsed" RowDetailsVisibilityMode="VisibleWhenSelected" RowLoaded="dgConflictResolution_RowLoaded" >
            <TelerikControls:RadGridView.Columns>
                <TelerikControls:GridViewToggleRowDetailsColumn />
                <TelerikControls:GridViewColumn>
                    <TelerikControls:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <Image Source="{Binding ConflictResolutionImageSource}" ToolTipService.ToolTip="{Binding ConflictResolutionImageToolTip}"></Image>
                        </DataTemplate>
                    </TelerikControls:GridViewColumn.CellTemplate>
                </TelerikControls:GridViewColumn>
                <TelerikControls:GridViewDataColumn x:Name="colSelectedEntityType" IsReadOnly="True" DataMemberBinding="{Binding EntityTypeName}"/>
                <TelerikControls:GridViewDataColumn x:Name="colSelectedEntityName" IsReadOnly="True" DataMemberBinding="{Binding DisplayName}" />
                <TelerikControls:GridViewDataColumn x:Name="colResolutionType" IsReadOnly="True" >
                    <TelerikControls:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <OblicoreControls:OblicoreCombobox x:Name="comboResolutionType" ItemsSource="{Binding ConflictResolutions,Mode=TwoWay}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedConflictResolution,Mode=TwoWay}" Tag="{Binding GlobalId}" SelectionChanged="comboResolutionType_SelectionChanged" />
                        </DataTemplate>
                    </TelerikControls:GridViewDataColumn.CellTemplate>
                </TelerikControls:GridViewDataColumn>
                <TelerikControls:GridViewDataColumn x:Name="colSelectedSourceChangeType" IsReadOnly="True" DataMemberBinding="{Binding SourceChangeType}" />
                <TelerikControls:GridViewDataColumn x:Name="colSelectedTargetChangeType" IsReadOnly="True" DataMemberBinding="{Binding TargetChangeType}" />
                <TelerikControls:GridViewColumn x:Name="colConflicts" IsReadOnly="True" >
                    <TelerikControls:GridViewColumn.CellTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image x:Name="syncConflict" Visibility="{Binding HasSyncConflict, Converter={StaticResource VisibilityConverter}}" Source="../Resources/Images/sync_conflict.png" ToolTipService.ToolTip="{Binding Source={StaticResource Strings}, Converter={StaticResource StringConverter}, ConverterParameter=COL_SYNC_CONFILCT_TOOLTIP}"></Image>
                                <Image x:Name="nameConflict" Visibility="{Binding HasNameConflict, Converter={StaticResource VisibilityConverter}}" Source="../Resources/Images/name_conflict.png" ToolTipService.ToolTip="{Binding Source={StaticResource Strings}, Converter={StaticResource StringConverter}, ConverterParameter=COL_NAME_CONFILCT_TOOLTIP}"></Image>
                            </StackPanel>
                        </DataTemplate>
                    </TelerikControls:GridViewColumn.CellTemplate>
                </TelerikControls:GridViewColumn>
            </TelerikControls:RadGridView.Columns>
            <TelerikControls:RadGridView.RowDetailsTemplate>
                <DataTemplate>
                    <Grid Margin="10,0,0,0" Width="350" HorizontalAlignment="Left" >
                        <Grid.RowDefinitions>
                            <RowDefinition Height="30" />
                            <RowDefinition Height="30" />
                            <RowDefinition Height="100" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                          
                        <TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding Source={StaticResource Strings}, Converter={StaticResource StringConverter}, ConverterParameter=COL_CHANGE_DATE}" />
                        <TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding ChangeDate}" />
                        <TextBlock Grid.Column="0" Grid.Row="1" Text="{Binding Source={StaticResource Strings}, Converter={StaticResource StringConverter}, ConverterParameter=LBL_EDIT_PARAMETERS}" />
                        <Button x:Name="btnEditParameters" Width="150" Grid.Column="1" Grid.Row="1" Content="{Binding Source={StaticResource Strings}, Converter={StaticResource StringConverter}, ConverterParameter=BTN_EDIT_PARAMETERS}" HorizontalAlignment="Left" Click="btnEditParameters_Click"  IsEnabled="{Binding HasParameters, Mode=TwoWay}" ></Button>
                        <TextBlock Grid.Column="0" Grid.Row="2" Text="{Binding Source={StaticResource Strings}, Converter={StaticResource StringConverter}, ConverterParameter=CONFLICT_RESOLUTION_LEADING_ENTITIES_COLUMN}" />
                        <Grid x:Name="gridLeadingEntities" Grid.Column="1" Grid.Row="2"></Grid>
  
                    </Grid>
                </DataTemplate>
            </TelerikControls:RadGridView.RowDetailsTemplate>
        </TelerikControls:RadGridView>


Whant am I doing wrong?

10x

Ron

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 22 Jul 2010, 02:03 PM
Hello ron klod,

How do you add the combo box to the row ?

Greetings,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
ron klod
Top achievements
Rank 1
answered on 22 Jul 2010, 02:09 PM
I added tha XAML to my first post
0
ron klod
Top achievements
Rank 1
answered on 22 Jul 2010, 10:05 PM
ok, the problem was found

10x
Tags
GridView
Asked by
ron klod
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
ron klod
Top achievements
Rank 1
Share this question
or