RadListview Selection Rectangle

4 posts, 0 answers
  1. Cesar
    Cesar avatar
    6 posts
    Member since:
    Apr 2014

    Posted 10 Apr 2014 Link to this post

    Hello 
    Can anyone tell me, how to select the items using 
    RECTANGLE SELECTION 


    / / Draws the backgrounds for Entire ListView items. 
    private void listView1_DrawItem (object sender, 
         DrawListViewItemEventArgs e) 
    {
         if ((e.State & ListViewItemStates.Selected)! = 0) 
         {
             / / Draw the background and focus rectangle for a selected item. 
             e.Graphics.FillRectangle (Brushes.Maroon, e.Bounds); 
             e.DrawFocusRectangle (); 
         } 
         else 
         {
             / / Draw the background for an unselected item. 
             using (LinearGradientBrush brush = 
                 new LinearGradientBrush (e.Bounds, Color.Orange, 
                 Color.Maroon, LinearGradientMode.Horizontal)) 
             {
                 e.Graphics.FillRectangle (brush, e.Bounds); 
             } 
         } 

         / / Draw the item text for views other than the Details view. 
         if (listView1.View! = View.Details) 
         {
             e.DrawText (); 
         } 
    }
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 14 Apr 2014 Link to this post

    Hello Cesar,

    Thank you for writing.

    This forum concerns the UI for WinForms suite from Telerik, not the standard Microsoft controls. Our alternative of the standard ListView is called RadListView and it does support such a selection rectangle out of the box. Here is how it can be turned on:
    radListView1.MultiSelect = true;
    radListView1.EnableLassoSelection = true;

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Cesar
    Cesar avatar
    6 posts
    Member since:
    Apr 2014

    Posted 14 Apr 2014 in reply to Stefan Link to this post

    Thanks for the tip!!

    Now with that event works

    radListView1.EnableLassoSelection = true;

    I want to tell you selected

    this.radListView1.SelectedItems.Count;
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 16 Apr 2014 Link to this post

    Hello,

    From your post I understand that my post has helped, however, I am not able to determine whether you have another question or not?

    Regards,
    Stefan
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top