Hi,
I have a fairly complex setup as shown below. I am using row details to act as an editor for the selected row in the gridview. I have Expand mode set to single so only one row can be expanded at a time. My question is how to validate data before the move to another row, or try to navigate elsewhere, or close the app, etc.? As you can see from the xaml, I tried wiring up the RowEditEnded command to the RowEditEnded event, but it doesn't seem to ever fire.
Any guidance would be greatly appreciated.
Thanks ... Ed
<
telerik:RadGridView
x:Name
=
"ssSamples"
AutoGenerateColumns
=
"False"
IsReadOnly
=
"True"
ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type UserControl} },
Path
=
DataContext
.Samples}"
SelectedItem
=
"{Binding SelectedRow}"
MaxHeight
=
"500"
RowIndicatorVisibility
=
"Visible"
RowDetailsVisibilityMode
=
"VisibleWhenSelected"
>
<
telerik:EventToCommandBehavior.EventBindings
>
<
telerik:EventBinding
Command
=
"{Binding RowDetailsVisibilityChangingCommand}"
EventName
=
"RowDetailsVisibilityChanging"
PassEventArgsToCommand
=
"True"
/>
<
telerik:EventBinding
Command
=
"{Binding RowEditEndedCommand}"
EventName
=
"RowEditEnded"
PassEventArgsToCommand
=
"True"
/>
</
telerik:EventToCommandBehavior.EventBindings
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewToggleRowDetailsColumn
ExpandMode
=
"Single"
/>
<
telerik:GridViewDataColumn
Width
=
"auto"
Header
=
"Sample Key"
DataMemberBinding
=
"{Binding Sample.Sample_Key}"
/>
<
telerik:GridViewDataColumn
Width
=
"auto"
Header
=
"Client Sample Id"
DataMemberBinding
=
"{Binding Sample.ClientSampleID}"
/>
<
telerik:GridViewDataColumn
Width
=
"auto"
Header
=
"Arrival"
DataMemberBinding
=
"{Binding ArrivalDesc}"
/>
<
telerik:GridViewDataColumn
Width
=
"auto"
Header
=
"Status"
DataMemberBinding
=
"{Binding Sample.Status}"
/>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.RowDetailsTemplate
>
<
DataTemplate
>
<
Grid
Width
=
"Auto"
HorizontalAlignment
=
"Stretch"
>
<
Grid.RowDefinitions
>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
<
RowDefinition
/>
</
Grid.RowDefinitions
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
Label
Grid.Row
=
"0"
Grid.Column
=
"0"
Content
=
"Client Sample Id:"
VerticalAlignment
=
"Top"
/>
<
TextBox
x:Name
=
"txtSampleId"
Grid.Row
=
"0"
Grid.Column
=
"1"
HorizontalAlignment
=
"Left"
Text
=
"{Binding Sample.ClientSampleID}"
Width
=
"250"
/>
<
Label
Grid.Row
=
"1"
Grid.Column
=
"0"
Content
=
"Priority:"
VerticalAlignment
=
"Top"
/>
<
telerik:RadComboBox
x:Name
=
"ddlPriority"
Grid.Row
=
"1"
Grid.Column
=
"1"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
Width
=
"250"
SelectedValuePath
=
"Tag"
SelectedValue
=
"{Binding Sample.Priority, UpdateSourceTrigger=PropertyChanged }"
SelectedIndex
=
"0"
>
<
telerik:RadComboBoxItem
Content
=
"Low"
Tag
=
"Low"
/>
<
telerik:RadComboBoxItem
Content
=
"Medium"
Tag
=
"Medium"
/>
<
telerik:RadComboBoxItem
Content
=
"High"
Tag
=
"High"
/>
</
telerik:RadComboBox
>
<
Label
Grid.Row
=
"2"
Grid.Column
=
"0"
Content
=
"Arrival:"
VerticalAlignment
=
"Top"
/>
<
telerik:RadComboBox
x:Name
=
"ddlArrival"
Grid.Row
=
"2"
Grid.Column
=
"1"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
Width
=
"250"
SelectedValuePath
=
"Tag"
SelectedValue
=
"{Binding Sample.Arrival, UpdateSourceTrigger=PropertyChanged }"
SelectedIndex
=
"0"
>
<
telerik:RadComboBoxItem
Content
=
"No"
Tag
=
"0"
/>
<
telerik:RadComboBoxItem
Content
=
"Park"
Tag
=
"1"
/>
<
telerik:RadComboBoxItem
Content
=
"Returned"
Tag
=
"2"
/>
<
telerik:RadComboBoxItem
Content
=
"Discarded"
Tag
=
"3"
/>
</
telerik:RadComboBox
>
<
Label
Grid.Row
=
"3"
Grid.Column
=
"0"
Content
=
"Status:"
VerticalAlignment
=
"Top"
/>
<
telerik:RadComboBox
x:Name
=
"ddlStatus"
Grid.Row
=
"3"
Grid.Column
=
"1"
HorizontalAlignment
=
"Left"
VerticalAlignment
=
"Top"
Width
=
"250"
SelectedValuePath
=
"Tag"
SelectedValue
=
"{Binding Sample.Status, UpdateSourceTrigger=PropertyChanged }"
SelectedIndex
=
"0"
>
<
telerik:RadComboBoxItem
Content
=
"Incomplete"
Tag
=
"Incomplete"
/>
<
telerik:RadComboBoxItem
Content
=
"Complete"
Tag
=
"Complete"
/>
</
telerik:RadComboBox
>
<
Label
Grid.Row
=
"4"
Grid.Column
=
"0"
Content
=
"Description:"
VerticalAlignment
=
"Top"
/>
<
TextBox
x:Name
=
"txtSampleDesc"
Grid.Row
=
"4"
Grid.Column
=
"1"
Grid.ColumnSpan
=
"2"
Text
=
"{Binding Sample.SampleDescription }"
Height
=
"60"
Width
=
"250"
HorizontalAlignment
=
"Left"
TextWrapping
=
"WrapWithOverflow"
AcceptsReturn
=
"True"
VerticalScrollBarVisibility
=
"Auto"
VerticalAlignment
=
"Top"
VerticalContentAlignment
=
"Top"
/>
<
Label
Grid.Row
=
"5"
Grid.Column
=
"0"
Content
=
"Comments:"
VerticalAlignment
=
"Top"
/>
<
TextBox
x:Name
=
"txtSampleComments"
Grid.Row
=
"5"
Grid.Column
=
"1"
Grid.ColumnSpan
=
"2"
Text
=
"{Binding Sample.Comments }"
Height
=
"60"
Width
=
"250"
HorizontalAlignment
=
"Left"
TextWrapping
=
"WrapWithOverflow"
AcceptsReturn
=
"True"
VerticalScrollBarVisibility
=
"Auto"
VerticalAlignment
=
"Top"
VerticalContentAlignment
=
"Top"
/>
<
Label
Content
=
"Associated Techniques:"
Grid.Row
=
"0"
Grid.Column
=
"2"
HorizontalAlignment
=
"Left"
HorizontalContentAlignment
=
"Left"
Width
=
"350"
Height
=
"auto"
/>
<
StackPanel
Orientation
=
"Vertical"
Grid.Row
=
"1"
Grid.Column
=
"2"
Grid.RowSpan
=
"5"
MaxHeight
=
"210"
>
<
ItemsControl
x:Name
=
"lstTechniques"
ItemsSource
=
"{Binding AssociatedTechniques, Mode=TwoWay }"
Margin
=
"5,0,0,0"
>
<
ItemsControl.ItemsPanel
>
<
ItemsPanelTemplate
>
<
support:UniformGridWithOrientation
Orientation
=
"Vertical"
Columns
=
"4"
/>
</
ItemsPanelTemplate
>
</
ItemsControl.ItemsPanel
>
<
ItemsControl.ItemTemplate
>
<
DataTemplate
>
<
CheckBox
Content
=
"{Binding TechniqueID}"
IsChecked
=
"{Binding IsSelected, Mode=TwoWay}"
ToolTip
=
"{Binding TechniqueName}"
>
</
CheckBox
>
</
DataTemplate
>
</
ItemsControl.ItemTemplate
>
</
ItemsControl
>
</
StackPanel
>
</
Grid
>
</
DataTemplate
>
</
telerik:RadGridView.RowDetailsTemplate
>
</
telerik:RadGridView
>