Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ListView Single Range Selection

Status
Not open for further replies.

Echilon

Programmer
Feb 22, 2007
54
GB
I have a ListView, and I'd like to only allow a single range to be selected. I need the equivalent of Java's SINGLE_SELECTION_INTERVAL ( ). For example:

If a ListView has 5 rows, #1,#2 could be selected, or #3,#4,#5, or just #3, but not #1,#3,#4.

Is there any way of adding this functionality in C# without getting heavily into rewriting the control?
 
the control will need to be extended. i don't think the framework offers this out of the box (i could be wrong, i work in the web world, not desktop).

you may be able to create an attribute which would decorate the control to add your functionality. I say that, but have no idea how to do it:)

could you build a validator which verifies the range? with web I use the ValidatorBase object and override methods to validate the proper control is selected and the value(s) valid.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top