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

RadListview Selection Rectangle

3 Answers 34 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Cesar
Top achievements
Rank 1
Cesar asked on 10 Apr 2014, 05:57 PM
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 (); 
     } 
}

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 14 Apr 2014, 11:52 AM
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.

 
0
Cesar
Top achievements
Rank 1
answered on 14 Apr 2014, 03:26 PM
Thanks for the tip!!

Now with that event works

radListView1.EnableLassoSelection = true;

I want to tell you selected

this.radListView1.SelectedItems.Count;
0
Stefan
Telerik team
answered on 16 Apr 2014, 01:34 PM
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.

 
Tags
ListView
Asked by
Cesar
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Cesar
Top achievements
Rank 1
Share this question
or