Remove the SelectedUnfocused state for the RadGridView.

6 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 25 Sep 2012 Link to this post

    Requirements

    RadControls version    2013.1.0220
    .NET version     4.0
    Visual Studio version     2010
    programming language     C#
    browser support

    all browsers supported by RadControls


    PROJECT DESCRIPTION

    In this project is demonstrated how to make the appearance of a row in SelectedUnfocused state to be the same as its appearance  in Focused state. In the older versions of RadGridView the SelectedUnfocused state was not enough distinguishable and it was the same as the hover effect of the row, for that reason now it is changed. If you want to revert to the previous behavior you should predefine the template of GridViewRow and remove the animations within SelectedUnfocused state, which modify the BorderBrush/Background of the row in this state. You can find attached a sample application which demonstrates how this can be achieved.


  2. Silvan
    Silvan avatar
    10 posts
    Member since:
    Jun 2009

    Posted 02 Oct 2012 Link to this post

    Hi

    Is there also and easier solution/sample to achieve the old behaviour?

    I get lost in this XAML-definition, since we've in our project many grid's i not want go and adapt all of them.

    Thanks!
  3. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 05 Oct 2012 Link to this post

    Hello Marcel,

     I am afraid that the approach described in the code library is the only simple one. I suggest you to set the style implicitly in order to apply it to all grids.

    All the best,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  4. Silvan
    Silvan avatar
    10 posts
    Member since:
    Jun 2009

    Posted 05 Oct 2012 Link to this post

    Hi Yoan

    Thanks for the Info.

    Meanwhile i found the solution to load the modify SelectedUnfocused grid-definition in a ResourceDirectory and change the background-color in the code:

    myResDic.Source = New Uri("/Assembly;component/Resources/DefaultRowStyle.xaml", UriKind.RelativeOrAbsolute)
    Dim myStyleNormal As Style = CType(myResDic("GridViewRowStyle"), Style)
    myStyleNormal.Setters.Add(New Setter(Control.BackgroundProperty, facWinCol.GridBackgroundEven))
    myList.RowStyle = myStyleNormal

    In this way i can set for the "AlternateRow" a different background-color easy.
  5. Mark
    Mark avatar
    1 posts
    Member since:
    Aug 2011

    Posted 21 Feb 2013 Link to this post

    This solution works fine when the Grid is in SelectionMode = Single.

    However, when it is in Extended or Multiple the selected rows are lost when the grid loses focus.

    Is this a bug, or does this workaround need enhancing?

    Mark

    Grid version:  2012.3.1129.40
  6. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 26 Feb 2013 Link to this post

    Hi Mark,

    Thank you for reporting this!

    I have updated the project and now it is working as expected. I have updated your Telerik points accordingly.

    Kind regards,
    Yoan
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top