Click here to Skip to main content
15,880,967 members
Home / Discussions / C#
   

C#

 
AnswerRe: regarding listbox C# Pin
Sandeep Akhare3-May-07 20:02
Sandeep Akhare3-May-07 20:02 
QuestionDisplay a web control Link button in a html tag Pin
minlynn3-May-07 16:52
minlynn3-May-07 16:52 
AnswerRe: Display a web control Link button in a html tag Pin
Sandeep Akhare3-May-07 20:11
Sandeep Akhare3-May-07 20:11 
GeneralRe: Display a web control Link button in a html tag Pin
minlynn6-May-07 18:27
minlynn6-May-07 18:27 
QuestionSorting a collection of classes [modified] Pin
hpjchobbes3-May-07 16:34
hpjchobbes3-May-07 16:34 
AnswerRe: Sorting a collection of classes Pin
Stefan Troschuetz3-May-07 21:07
Stefan Troschuetz3-May-07 21:07 
AnswerRe: Sorting a collection of classes Pin
Jon Hulatt3-May-07 21:11
Jon Hulatt3-May-07 21:11 
AnswerRe: Sorting a collection of classes Pin
AFSEKI7-May-07 4:01
AFSEKI7-May-07 4:01 
1) Your "class to be sorted" should implement IComparable<t> interface with you T = your class name.

2) You should add an event handler to fire property change events of your "class to be sorted" objects

3) Catch these events in your collection and use Array.Sort(myCollection)

OR

1) you can use a SortedList<tkey, tvalue=""> or SortedDisctionary<tkey, tvalue=""> as the collection of your "class to be sorted" objects and set TKey to the property of your "class to be sorted" but this property should be IComparable!

2) then when this property changes, your collection is automatically sorted

BUT these 2 options fails in your need to do a batch update and then sort + the ability to lock sorting, SO:

1) You should use a BatchUpdate after a number of updates are done for any "class to be sorted" object by keeping a int _updatecount static property in your Collection which is increased by each update to any of your object( if you use my 1st way, then you can increase this value in the property change event handler in your collection )

OR

2) The easiest and best way, do whatever update you want, then call Array.Sort(myCollection) where myCollection is ICollection Wink | ;)

Hope this helps...
QuestionC#, DWM, and Window Image Capture (Vista) Pin
surrealmadrid3-May-07 12:22
surrealmadrid3-May-07 12:22 
Questionimage to string and backwords.. Pin
Seishin#3-May-07 11:33
Seishin#3-May-07 11:33 
AnswerRe: image to string and backwords.. Pin
Luc Pattyn3-May-07 11:47
sitebuilderLuc Pattyn3-May-07 11:47 
GeneralRe: image to string and backwords.. Pin
Seishin#3-May-07 19:13
Seishin#3-May-07 19:13 
AnswerRe: image to string and backwords.. Pin
Stefan Prodan3-May-07 12:30
Stefan Prodan3-May-07 12:30 
GeneralRe: image to string and backwords.. Pin
Seishin#3-May-07 19:14
Seishin#3-May-07 19:14 
GeneralRe: image to string and backwords.. Pin
Stefan Prodan4-May-07 0:42
Stefan Prodan4-May-07 0:42 
AnswerRe: image to string and backwords.. Pin
AFSEKI7-May-07 4:08
AFSEKI7-May-07 4:08 
QuestionSuggestion for C# compatible language Pin
bfoo753-May-07 9:45
bfoo753-May-07 9:45 
AnswerRe: Suggestion for C# compatible language Pin
pbraun3-May-07 10:54
pbraun3-May-07 10:54 
AnswerRe: Suggestion for C# compatible language Pin
PIEBALDconsult3-May-07 11:51
mvePIEBALDconsult3-May-07 11:51 
GeneralRe: Suggestion for C# compatible language Pin
J4amieC3-May-07 22:02
J4amieC3-May-07 22:02 
AnswerRe: Suggestion for C# compatible language Pin
Stefan Prodan3-May-07 11:52
Stefan Prodan3-May-07 11:52 
AnswerRe: Suggestion for C# compatible language Pin
AFSEKI7-May-07 4:12
AFSEKI7-May-07 4:12 
QuestionArrays in C# Pin
LCI3-May-07 9:36
LCI3-May-07 9:36 
AnswerRe: Arrays in C# Pin
Jimmanuel3-May-07 9:41
Jimmanuel3-May-07 9:41 
GeneralRe: Arrays in C# Pin
LCI3-May-07 9:53
LCI3-May-07 9:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.