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

Prevent hot-tracking and cell formatting of selected row?

4 Answers 233 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Lou
Top achievements
Rank 1
Lou asked on 15 May 2015, 08:05 PM

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


4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 18 May 2015, 12:10 PM
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
0
Lou
Top achievements
Rank 1
answered on 18 May 2015, 01:42 PM

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

0
Dimitar
Telerik team
answered on 19 May 2015, 10:39 AM
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
0
Lou
Top achievements
Rank 1
answered on 19 May 2015, 01:16 PM

OK - thanks for that info.

 -Lou

Tags
ListView
Asked by
Lou
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Lou
Top achievements
Rank 1
Share this question
or