Hi,
I've two grids in my page and based on the selected row of the first grid i'm populating the second grid.The problem is that, i've selected a row and the corresponding data is populated in the second grid, now i click on datapager or grouping or sorting the second grid data remains but the selection (highlighter) is not seen in the first grid.
Could you please let me what is the issue
Thanks.
10 Answers, 1 is accepted
By default the grid will keep the SelectedItem for such operation - you can set however SelectedItem to desired in case of grouping, paging, etc.
Kind regards,Vlad
the Telerik team

Thanks for your response.
I understand the selected value remains even after sorting or grouping, is there any way to retain the highlighted row even after sorting. Currently after sorting the row highlighting (orange colour) vanishes when data moves to another page.
Thanks
You can use the grid Items collection if you want to keep selection by index instead by data - find desired item in Items and set this item as SelectedItem.
Greetings,Vlad
the Telerik team

Hello Kavi,
RadGridView has a number of events that can aid you. We have several pair of events where the first one in a pair indicates what operation will occur and the second one indicated that an operation has occurred. For example we have Grouping, Groped, Sorting, Sorted, Filtering, and Filtered events. The events related to paging can be found on RadGridView.Items - PageChanging, PAgeChanged.
Hope this helps.
All the best,
Milan
the Telerik team

In SL3 version of controls Q1 2010 i had:
<
grid:RadGridView
Grid.Row
=
"1"
x:Name
=
"dgResourcesList"
RowIndicatorVisibility
=
"Collapsed"
IsReadOnly
=
"True"
Background
=
"#FFFFFF"
AutoGenerateColumns
=
"False"
CanUserFreezeColumns
=
"False"
Visibility
=
"Visible"
FontFamily
=
"Verdana"
FontSize
=
"10"
CanUserReorderColumns
=
"False"
CanUserSortColumns
=
"False"
CanUserInsertRows
=
"False"
CanUserResizeColumns
=
"False"
SelectionMode
=
"Multiple"
ShowGroupPanel
=
"False"
IsFilteringAllowed
=
"False"
Width
=
"Auto"
ScrollMode
=
"RealTime"
ScrollViewer.VerticalScrollBarVisibility
=
"Auto"
MaxWidth
=
"600"
>
<
grid:RadGridView.Columns
>
<
grid:GridViewSelectColumn
Width
=
"Auto"
>
<
grid:GridViewSelectColumn.Header
>
<
TextBlock
Text
=
"Sel."
Width
=
"Auto"
></
TextBlock
>
</
grid:GridViewSelectColumn.Header
>
</
grid:GridViewSelectColumn
>
<
grid:GridViewDataColumn
DataMemberBinding
=
"{Binding DisplayName}"
Width
=
"*"
>
<
grid:GridViewDataColumn.Header
>
<
TextBlock
Text
=
"Descrizione"
/>
</
grid:GridViewDataColumn.Header
>
</
grid:GridViewDataColumn
>
</
grid:RadGridView.Columns
>
</
grid:RadGridView
>
private
void
Filter_TextChanged(
object
sender, TextChangedEventArgs e)
{
FilterDescriptor filter =
null
;
if
(dgResourcesList.FilterDescriptors.Count == 0)
{
filter =
new
FilterDescriptor();
filter.Member =
"DisplayName"
;
filter.Operator = FilterOperator.Contains;
filter.IsCaseSensitive =
false
;
dgResourcesList.FilterDescriptors.Add(filter);
}
else
{
filter = dgResourcesList.FilterDescriptors[0]
as
FilterDescriptor;
}
filter.Value = Filter.Text;
}
And after changing the filter text and returning back, selected items were mantained, now with SL4 controls version Q2 2010 (same code) this doesn't work as before but it lose the selected items every time.
It is wonderfull that you add a lot of functionality every time but, in my honest opinion, it would be better to mantein previous features also.
Best regards
Previously the selection was indeed preserved but this was not correct: when you filter, the items that are filtered out must be deselected since they are no longer available and cannot be accessed by the grid.
This is indeed a breaking change and we are sorry for the inconvenience.
Is this change a show stopper?
Greetings,Milan
the Telerik team

Is there any workaround to select the first row in the grid after the filtering has taken place, currently in my application even after filtering the data, the earlier selected row details are still reflected in the second grid.
Silverlight version: 3
It would be helpful if you could provide me a sample solution to fix this issue.
i'm using Visual studio 2008
You can use the Filtered event to reset the selected item after the grid has been filtered:
public
MainWindow()
{
InitializeComponent();
this
.clubsGrid.Filtered +=
new
EventHandler<GridViewFilteredEventArgs>(clubsGrid_Filtered);
}
void
clubsGrid_Filtered(
object
sender, Telerik.Windows.Controls.GridView.GridViewFilteredEventArgs e)
{
if
(
this
.clubsGrid.Items.Count > 0)
this
.clubsGrid.SelectedItem =
this
.clubsGrid.Items[0];
}
Regards,
Milan
the Telerik team
