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

How to select full row not cell?

6 Answers 209 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Kenz
Top achievements
Rank 1
Kenz asked on 21 Oct 2011, 07:34 AM
Hi,
just need to know how to select full row when clicking on grid rows?
i already set SelectionUnit to FullRow and yes it selects full row but still
shows like selecting a cell.
(i mean rectangle around a cell.... i don't want this... and if it must show a rectangle,i want it to show around full row not a single cell)
i've attached a screenshot.Hope u guys help me.. thanks

Best regards..

6 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 21 Oct 2011, 07:49 AM
Hi Kenz,

This border specifies the current cell - the one having the focus at the moment. If you want to remove this functionality, you need to change the template of GridViewCell. Please take a look at this article for additional reference.
 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Bryce
Top achievements
Rank 1
answered on 14 Dec 2011, 12:07 AM
Hi Maya,

This just removes the border of the cell; is there a way for the user not to be able to select a cell? I've already tried what Kenz did. I have a RadGridView that takes up the whole screen, but then if the user selects a row, a details window will show up on the right, which will minimize the grid. When doing this, the grid is focused on the cell the user has selected. So if the user selected a cell that was lets say 5 columns from the very left column, then the focus in the grid won't be to the very left column of the grid, but to the column that is 5 columns in.

<------------Grid---------------->
<C1 | C2 | C3 | C4 | C5 | C6>

the user selects a row in C5 and this happens:

<---Grid--->  <Details of selected row>
<| C5 | C6>

but this is what I'm trying to get:

<---Grid--->
<C1 | C2 | >

Is there any way to make it stay on the far left column?

Thanks,
Bryce
0
Maya
Telerik team
answered on 14 Dec 2011, 07:58 AM
Hi Bryce,

Would you clarify a bit - do you want every time you select an item to scroll to the first column so that you can see it on opening of the row details ?
If so, you can try handling SelectionChanging event for example and call ScrollIntoView(dataItem, column) method of the grid. For example:

private void clubsGrid_SelectionChanging(object sender, SelectionChangingEventArgs e)
        {
            this.clubsGrid.ScrollIntoView(this.clubsGrid.SelectedItem, this.clubsGrid.Columns[0]);
        }

Will that approach suit your needs ?
 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Bryce
Top achievements
Rank 1
answered on 14 Dec 2011, 11:38 PM
Hi Maya,

Is it possible to not even focus on a cell and just focus on a row? It's similar to the functionality I want, but it will focus on the cell first, and then go back to column 1.

Thanks,
Bryce
0
Maya
Telerik team
answered on 15 Dec 2011, 09:33 AM
Hello Bryce,

Actually, the corresponding row will be focuses as well. Would you clarify why the suggested approach is not appropriate for your specific requirements ? 
 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Bryce
Top achievements
Rank 1
answered on 15 Dec 2011, 08:47 PM
Hi Maya, 

The reason I'm asking is because when I do it the way suggested using SelectionChanging, this happens:

1)
<------------Grid---------------->
<C1 | C2 | C3 | C4 | C5 | C6>

then for a split second I will get this:

2)
<---Grid--->  <Details of selected row>
<| C5 | C6>

and then I will get this:

3)
<---Grid--->
<C1 | C2 | >

I just wanted a way to get from 1 to 3.

Thanks,
Bryce
Tags
GridView
Asked by
Kenz
Top achievements
Rank 1
Answers by
Maya
Telerik team
Bryce
Top achievements
Rank 1
Share this question
or