or
'Add the new object to the collection...
mcolStudents.Add(moStudent)
'Locate the record in the grid...
With
gvStudents
For
Each
item
As
StudentView
In
.Items
If
item.StudentId = moStudent.StudentId
Then
.SelectedItem = item
.ScrollIntoView(item)
Exit
For
End
If
Next
End
With
<
telerik:RadDocking
Grid.Row
=
"3"
Grid.Column
=
"0"
Grid.ColumnSpan
=
"2"
Name
=
"rdContent"
Margin
=
"5,2"
MaxWidth
=
"5000"
MaxHeight
=
"5000"
telerik:StyleManager.Theme
=
"Office_Blue"
>
<
telerik:RadDocking.DocumentHost
>
<
telerik:RadSplitContainer
x:Name
=
"rcsContent"
InitialPosition
=
"DockedLeft"
>
<
telerik:RadPaneGroup
x:Name
=
"rpgContent"
>
<
telerik:RadPane
x:Name
=
"rpProcesses"
Header
=
"Well Processes"
>
<
telerik:RadGridView
Name
=
"gvProcesses"
RowStyle
=
"{StaticResource SelectedGrid}"
Margin
=
"5,2"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
telerik:StyleManager.Theme
=
"Office_Blue"
AutoGenerateColumns
=
"False"
ShowColumnFooters
=
"False"
ShowGroupFooters
=
"False"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Collapsed"
ItemsSource
=
"{Binding}"
DataLoadMode
=
"Synchronous"
CanUserDeleteRows
=
"False"
CanUserInsertRows
=
"False"
ToolTip
=
"Select the Processes associated with the Well Stage record"
UseLayoutRounding
=
"True"
Visibility
=
"Visible"
MinHeight
=
"100"
MaxHeight
=
"250"
>
<
telerik:RadGridView.Resources
>
<
Style
TargetType
=
"ListBox"
>
<
Setter
Property
=
"MaxHeight"
Value
=
"400"
/>
</
Style
>
</
telerik:RadGridView.Resources
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewCheckBoxColumn
Header
=
"Active"
UniqueName
=
"IsActive"
DataMemberBinding
=
"{Binding Path=IsActive}"
IsReadOnly
=
"True"
Width
=
"auto"
TextAlignment
=
"Center"
>
<
telerik:GridViewCheckBoxColumn.CellStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Center"
/>
</
Style
>
</
telerik:GridViewCheckBoxColumn.CellStyle
>
</
telerik:GridViewCheckBoxColumn
>
<
telerik:GridViewDataColumn
Header
=
"Select"
UniqueName
=
"Selected"
DataMemberBinding
=
"{Binding Path=IsSelected}"
IsReadOnly
=
"False"
Width
=
"auto"
>
<
telerik:GridViewDataColumn.CellStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Center"
/>
</
Style
>
</
telerik:GridViewDataColumn.CellStyle
>
<!-- See http://www.telerik.com/help/wpf/gridview-checkbox-column-clicks.html for info on enabling single-click editing of checkboxes -->
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
CheckBox
IsChecked
=
"{Binding Path=IsSelected, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
telerik:StyleManager.Theme
=
"Office_Blue"
Click
=
"Process_Clicked"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Process"
UniqueName
=
"Process"
DataMemberBinding
=
"{Binding Path=Process}"
IsReadOnly
=
"True"
Width
=
"auto"
/>
<
telerik:GridViewDataColumn
Header
=
"Notes"
UniqueName
=
"Notes"
IsReadOnly
=
"True"
Width
=
"*"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Path=Notes, Converter={StaticResource RemoveNewLine}}"
HorizontalAlignment
=
"Left"
TextTrimming
=
"CharacterEllipsis"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
telerik:RadPane
>
<
telerik:RadPane
x:Name
=
"rpRigClasses"
Header
=
"Rig Classes"
>
<
telerik:RadGridView
Name
=
"gvRigClasses"
RowStyle
=
"{StaticResource SelectedGrid}"
Margin
=
"5,2"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
telerik:StyleManager.Theme
=
"Office_Blue"
AutoGenerateColumns
=
"False"
ShowColumnFooters
=
"False"
ShowGroupFooters
=
"False"
ShowGroupPanel
=
"False"
RowIndicatorVisibility
=
"Collapsed"
ItemsSource
=
"{Binding}"
DataLoadMode
=
"Synchronous"
CanUserDeleteRows
=
"False"
CanUserInsertRows
=
"False"
ToolTip
=
"Select a Project record to edit"
UseLayoutRounding
=
"True"
Visibility
=
"Visible"
MinHeight
=
"100"
MaxHeight
=
"250"
>
<
telerik:RadGridView.Resources
>
<
Style
TargetType
=
"ListBox"
>
<
Setter
Property
=
"MaxHeight"
Value
=
"400"
/>
</
Style
>
</
telerik:RadGridView.Resources
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewCheckBoxColumn
Header
=
"Active"
UniqueName
=
"IsActive"
DataMemberBinding
=
"{Binding Path=IsActive}"
IsReadOnly
=
"True"
Width
=
"auto"
TextAlignment
=
"Center"
>
<
telerik:GridViewCheckBoxColumn.CellStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Center"
/>
</
Style
>
</
telerik:GridViewCheckBoxColumn.CellStyle
>
</
telerik:GridViewCheckBoxColumn
>
<
telerik:GridViewDataColumn
Header
=
"Select"
UniqueName
=
"Selected"
DataMemberBinding
=
"{Binding Path=IsSelected}"
IsReadOnly
=
"False"
Width
=
"auto"
>
<
telerik:GridViewDataColumn.CellStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Center"
/>
</
Style
>
</
telerik:GridViewDataColumn.CellStyle
>
<!-- See http://www.telerik.com/help/wpf/gridview-checkbox-column-clicks.html for info on enabling single-click editing of checkboxes -->
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
CheckBox
IsChecked
=
"{Binding Path=IsSelected, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
telerik:StyleManager.Theme
=
"Office_Blue"
Click
=
"RigClass_Clicked"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
<
telerik:GridViewDataColumn
Header
=
"Rig Class"
UniqueName
=
"RigClass"
DataMemberBinding
=
"{Binding Path=RigClass}"
IsReadOnly
=
"True"
Width
=
"auto"
/>
<
telerik:GridViewDataColumn
Header
=
"Notes"
UniqueName
=
"Notes"
IsReadOnly
=
"True"
Width
=
"*"
>
<
telerik:GridViewDataColumn.CellTemplate
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding Path=Notes, Converter={StaticResource RemoveNewLine}}"
HorizontalAlignment
=
"Left"
TextTrimming
=
"CharacterEllipsis"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellTemplate
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking.DocumentHost
>
</
telerik:RadDocking
>
The grid is bound to an ObservableCollection so I'm not sure why the "Selected" values would change.
Does anyone have any suggestions?