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

Custom list view not selecting

3 Answers 118 Views
ListView
This is a migrated thread and some comments may be shown as answers.
eSimSE
Top achievements
Rank 1
eSimSE asked on 28 Aug 2012, 11:09 PM
Hello,

How do you enable things like row borders, or to show the select item as selected, when dealing with a custom visual item?

Best regards.

3 Answers, 1 is accepted

Sort by
0
eSimSE
Top achievements
Rank 1
answered on 28 Aug 2012, 11:22 PM
I've checked the VisualItem is Enabled (true). Only no change in display.

My visual item only contains an Image (Bitmap) and a couple of Labels elements.

Nothing fancy. But how do I give the user ability to select (or show that it's selected)?
0
eSimSE
Top achievements
Rank 1
answered on 28 Aug 2012, 11:44 PM
Kind of at a loss. I'm even checking things like, are the containing controls enabled. Yes, yes, yes, etc.
0
Ivan Todorov
Telerik team
answered on 30 Aug 2012, 12:14 PM
Hi Michael,

Thank you for contacting us.

You need to override the ThemeEffectiveType property in order to get the same look and feel as the base item:
protected override Type ThemeEffectiveType
{
    get
    {
        return typeof(SimpleListViewVisualItem);
    }
}

This is also demonstrated in the online documentation.

Additionally, you might need to allow the label and the image elements to pass the mouse input to their parent. This can be achieved by setting the following properties:
myLabelElement.ShouldHandleMouseInput = false;
myLabelElement.NotifyParentOnMouseInput = true;

I hope you find this useful. Do not hesitate to write back if you have any additional questions.

All the best,
Ivan Todorov
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
ListView
Asked by
eSimSE
Top achievements
Rank 1
Answers by
eSimSE
Top achievements
Rank 1
Ivan Todorov
Telerik team
Share this question
or