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

can not move RowIndicator

5 Answers 132 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chirag
Top achievements
Rank 1
Chirag asked on 12 Apr 2012, 08:04 AM
hi to all
i have a telerik silverlight  Gridview  it's  bind with a source
i am select 5th row of gridview  but RowIndicator is not moved  it's sticy to 1st row Please see in Attached image fille

<telerik:RadGridView x:Name="FormsGrid"  CanUserFreezeColumns="False" MinHeight="25"  SelectionMode="Single" 
   AutoGenerateColumns="False"   ScrollMode="RealTime"  RowIndicatorVisibility="Visible"
   BorderThickness="1,6,1,1" telerik:StyleManager.Theme="Office_Blue"
   ScrollViewer.HorizontalScrollBarVisibility="Visible"                                                 
   ScrollViewer.VerticalScrollBarVisibility="Auto"  ShowGroupPanel="True" SelectionChanged="FormsGrid_SelectionChanged"                                              
   CanUserDeleteRows="False" CanUserInsertRows="False" Sorting="FormsGrid_Sorting" Grouped="FormsGrid_Groupe
</telerik:RadGridView>

5 Answers, 1 is accepted

Sort by
0
Nikhil
Top achievements
Rank 1
answered on 19 Jun 2012, 09:05 PM
I have the same issue. Did you find a solution for this?
0
Gopala
Top achievements
Rank 1
answered on 26 Jun 2012, 03:54 PM
I also have same issue. I found that when you keep SelectionUnit=FullRow then it moves. My problem is I want SelectionUnit= Cell. Did you found the solution for this.
0
Nikhil
Top achievements
Rank 1
answered on 26 Jun 2012, 04:37 PM
Hi,

I was able to achieve this by handling the 'CellLoaded' event for the RadGridView control. Here is the event handler pseudo code:

private

 

 

void GridView_CellLoaded(object sender, Telerik.Windows.Controls.GridView.CellEventArgs e)

 

{

 

 

RadGridView gridView = sender as RadGridView;

 

// Iterate through gridView.Items

 

// Determine if the item is for the new row being added to the gridview 
// The following line will ensure the RowIndicator is moved to the newly added row.

 

// Set gridView.SelectedItem = item;
}

I don't think the RadGridView allows to change the SelectionMode by cell. The only 3 values for it are Extended, Multiple and Single which is for single/multiple selection primarily.

Hope this helps.

0
Gopala
Top achievements
Rank 1
answered on 26 Jun 2012, 04:45 PM
Hi Nikhil,

Thanks for your reply. But in my case I donot want to select any row when grid is loaded for first time and shown to user. The user will select the row by clicking row indicator and at same time I also want user to select Cells. I am more interested in giving selectionunit = both i.e., when user clicks rowindicator entire row must be selected and rowindicator must move to that row and when user selects a cell only that cell must be selected not entire row. I was hoping you solved this issue.

Your pseudo code seems like to set the newly added row as the selecteditem.
0
Nikhil
Top achievements
Rank 1
answered on 26 Jun 2012, 04:57 PM
Hello Gopala,

The 'SelectionUnit' property can be set on the control itself (in the XAML file). Maybe that will solve your issue.

If that does not work, there are other events like 'SelectedCellsChanged' and 'SelectedCellsChanging'. You may want to try handling one of these events and setting the SelectionUnit in the handler for that.

My pseudocode showed solution for moving the row indicator to a newly added row only.
Good luck.

Nikhil

Tags
GridView
Asked by
Chirag
Top achievements
Rank 1
Answers by
Nikhil
Top achievements
Rank 1
Gopala
Top achievements
Rank 1
Share this question
or