How to select full row not cell?

7 posts, 1 answers
  1. Kenz
    Kenz avatar
    19 posts
    Member since:
    Apr 2011

    Posted 21 Oct 2011 Link to this post

    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..
  2. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 21 Oct 2011 Link to this post

    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 >>

  3. Bryce
    Bryce avatar
    32 posts
    Member since:
    Aug 2010

    Posted 13 Dec 2011 Link to this post

    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
  4. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 14 Dec 2011 Link to this post

    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 >>

  5. Bryce
    Bryce avatar
    32 posts
    Member since:
    Aug 2010

    Posted 14 Dec 2011 Link to this post

    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
  6. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 15 Dec 2011 Link to this post

    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 >>

  7. Bryce
    Bryce avatar
    32 posts
    Member since:
    Aug 2010

    Posted 15 Dec 2011 Link to this post

    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
Back to Top