Prevent hot-tracking and cell formatting of selected row?

5 posts, 0 answers
  1. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 15 May 2015 Link to this post

    Hi, how do I prevent hot-tracking and highlighting of a selected cell/row with the RadListView?

    I need to do this with ListViews having a ViewType of both IconView and DetailsView.

    I found the following post and tried the suggestion (with both ViewTypes) but it did not work for me:

    http://www.telerik.com/forums/remove-selected-and-hover-states

    The code I was using was (following the above post):

    void radListView1_SelectedItemChanged(object sender, Telerik.WinControls.UI.ListViewItemEventArgs e)
    {
        radListView1.CurrentItem = null;
        radListView1.SelectedItem = null;
    }

     Thanks,

      -Lou


  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 18 May 2015 Link to this post

    Hi Lou,

    Thank you for writing.

    You can disable the border and fill drawing in the VisualItemFormatting and CellFormatting events:
    void radListView1_VisualItemFormatting(object sender, Telerik.WinControls.UI.ListViewVisualItemEventArgs e)
    {
        e.VisualItem.DrawFill = false;
        e.VisualItem.DrawBorder = false;
    }
     
    void radListView1_CellFormatting(object sender, Telerik.WinControls.UI.ListViewCellFormattingEventArgs e)
    {
        
        e.CellElement.DrawBorder = false;
    }

    More information about this events is available here: Formatting Items.

    Please let me know if there is something else I can help you with. 
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 18 May 2015 in reply to Dimitar Link to this post

    Thanks, that worked.

     ( It might be a good idea for you to add a comment to the post http://www.telerik.com/forums/remove-selected-and-hover-states to direct users to this thread, to prevent them following the incorrect path that I followed. )

     -Lou

  5. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 19 May 2015 Link to this post

    Hi Lou,

    Thank you for writing back.

    The suggested approach is actually correct, and if you remove all the states styles from the theme the highlighting will disappear. However this requires some additional work.

    Do not hesitate to contact us if you have other questions.
     
    Regards,
    Dimitar
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. Lou
    Lou avatar
    61 posts
    Member since:
    Aug 2014

    Posted 19 May 2015 in reply to Dimitar Link to this post

    OK - thanks for that info.

     -Lou

Back to Top
UI for WinForms is Visual Studio 2017 Ready