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
and it returnN null,
here is the XAML:
Whant am I doing wrong?
10x
Ron
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>();
}
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