Custom list view not selecting

4 posts, 0 answers
  1. Chupacabra
    Chupacabra avatar
    7 posts
    Member since:
    Aug 2012

    Posted 28 Aug 2012 Link to this post

    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.
  2. Chupacabra
    Chupacabra avatar
    7 posts
    Member since:
    Aug 2012

    Posted 28 Aug 2012 Link to this post

    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)?
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Chupacabra
    Chupacabra avatar
    7 posts
    Member since:
    Aug 2012

    Posted 28 Aug 2012 Link to this post

    Kind of at a loss. I'm even checking things like, are the containing controls enabled. Yes, yes, yes, etc.
  5. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 30 Aug 2012 Link to this post

    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 >>
Back to Top