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

ItemMouseHover When ViewType is DetailsView

5 Answers 354 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Timothy
Top achievements
Rank 1
Timothy asked on 20 Jul 2013, 09:08 PM
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.

5 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 25 Jul 2013, 06:05 AM
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 >>
0
Timothy
Top achievements
Rank 1
answered on 25 Jul 2013, 10:24 PM
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.
0
George
Telerik team
answered on 30 Jul 2013, 03:43 PM
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 >>
0
Nidal
Top achievements
Rank 1
answered on 24 Apr 2019, 03:25 PM
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 )
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 25 Apr 2019, 08:21 AM
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.
Tags
ListView
Asked by
Timothy
Top achievements
Rank 1
Answers by
George
Telerik team
Timothy
Top achievements
Rank 1
Nidal
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or