Remove the SelectedUnfocused state for the RadGridView.

Thread is closed for posting
6 posts, 0 answers
  1. 63F75A2C-1F16-4AED-AFE8-B1BBD57646AD
    63F75A2C-1F16-4AED-AFE8-B1BBD57646AD avatar
    1572 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. 788DA931-5CEA-4DE2-BE1D-116F994FAC93
    788DA931-5CEA-4DE2-BE1D-116F994FAC93 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. 6D650FF8-A58F-4F2A-9657-7DFBA0400E3A
    6D650FF8-A58F-4F2A-9657-7DFBA0400E3A avatar
    1215 posts
    Member since:
    Aug 2017

    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. 788DA931-5CEA-4DE2-BE1D-116F994FAC93
    788DA931-5CEA-4DE2-BE1D-116F994FAC93 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. 8552CF93-E84D-4CB9-B915-AD8F727ACFE1
    8552CF93-E84D-4CB9-B915-AD8F727ACFE1 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. 6D650FF8-A58F-4F2A-9657-7DFBA0400E3A
    6D650FF8-A58F-4F2A-9657-7DFBA0400E3A avatar
    1215 posts
    Member since:
    Aug 2017

    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

This Code Library is part of the product documentation and subject to the respective product license agreement.