ItemMouseHover When ViewType is DetailsView

6 posts, 0 answers
  1. Timothy
    Timothy avatar
    37 posts
    Member since:
    Nov 2012

    Posted 20 Jul 2013 Link to this post

    I have an issue with when the ItemMouseHover event is fired when the RadListView.ViewType is DetailsView.

    The event only fires when you hover in an area outside the columns (see the attached image). I'm trying to set up a tooltip that displays item specific information when hovering over a row (item). I can get the tooltip create, however, when moving the mouse around it does not change the tooltip (because the event is not being fired) when I hover over the columns in the row. As you can see in the image (sort of) the tooltip still displays the value for the second row even though I'm hovering over the first row.

    I have a sample project if you will tell me how to submit it.
  2. George
    Admin
    George avatar
    500 posts

    Posted 25 Jul 2013 Link to this post

    Hello Timothy,

    Thank you for contacting us.

    You should subscribe to the TooTipTextNeeded event of the RadListView. Then you can set the tooltip to whatever text you need. Please take a look at the code below:
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
     
            new RadControlSpyForm().Show();
     
            this.radListView1.ViewType = Telerik.WinControls.UI.ListViewType.DetailsView;
            var info = new DirectoryInfo(Environment.CurrentDirectory);
            FileInfo[] files = info.GetFiles();
            this.radListView1.DataSource = files;
            this.radListView1.ShowItemToolTips = true;
            this.radListView1.ToolTipTextNeeded += radListView1_ToolTipTextNeeded;
        }
     
        void radListView1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
        {
            DetailListViewDataCellElement element = sender as DetailListViewDataCellElement;
            if (element != null)
            {
                e.ToolTipText = element.Text;
            }
        }
    }

    Hope this helps, if you have any other questions or comments, please let me know.
     
    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Timothy
    Timothy avatar
    37 posts
    Member since:
    Nov 2012

    Posted 25 Jul 2013 Link to this post

    That works great for the DetailsView, thanks.

    Is ItemMouseHover the best way to handle tooltips when the ViewType is set to ListView? I tried to use the ToolTipTextNeeded event for this but the sender object is of type SimpleListViewElement and I couldn't figure out how to determine the row the cursor is over.
  4. George
    Admin
    George avatar
    500 posts

    Posted 30 Jul 2013 Link to this post

    Hi Timothy,

    Thank you for replying.

    Yes, I can confirm that the ItemMouseHover event is the best choice in this case if you want to determine the current row. Here is an example realization of the idea:
    void radListView1_ItemMouseHover(object sender, ListViewItemEventArgs e)
    {
        var item = e.Item;
        var element = this.radListView1.ListViewElement;
        if (element != null)
        {
            for (int i = 0; i < element.Items.Count; i++)
            {
                if (element.Items[i].Equals(item))
                {
                    Console.WriteLine(i); //the row
                }
            }
        }
    }

    Hope this helps, if you have any other questions or comments, please let me know.
     
    Regards,
    George
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Nidal
    Nidal avatar
    20 posts
    Member since:
    Apr 2019

    Posted 24 Apr 2019 in reply to George Link to this post

    dear GeorgeI have the the the following list view (with name mylist.png image) by radlistview how i can make it collapsible (hamburger menu) like the menu in black and orange (demo and demo 1 images )
  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3626 posts

    Posted 25 Apr 2019 Link to this post

    Hello, Nidal,    

    The Hamburger Menu is a UX paradigm incorporating a collapsible navigation pane and a sidebar menu. It is used in the modern Windows 10 applications such as Groove, Mail and Calendar. The pane works as a top-level container of other controls added to the form. We decided to implement it inside the RadPageView and add a new view to it, the Navigation View. The new view also supports four different display modes covering various use cases: Auto, Minimal, Compact, and Expanded. Additional information is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/pageview/navigation-view/overview

    You can also refer to our Demo application >> PageView >> Navigation view example. The Demo application can be found in the installation folder of the suite.

    I hope this information helps. Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top