Click here to Skip to main content
16,016,263 members
Home / Discussions / C#
   

C#

 
QuestionClose Pop Up windows Pin
SatyaKeerthi1522-Oct-10 3:11
SatyaKeerthi1522-Oct-10 3:11 
AnswerRe: Close Pop Up windows Pin
Not Active22-Oct-10 3:22
mentorNot Active22-Oct-10 3:22 
QuestionAnnoying ListBox problem [SOLVED] Pin
Henry Minute22-Oct-10 3:10
Henry Minute22-Oct-10 3:10 
AnswerRe: Annoying ListBox problem Pin
Luc Pattyn22-Oct-10 4:35
sitebuilderLuc Pattyn22-Oct-10 4:35 
GeneralRe: Annoying ListBox problem Pin
OriginalGriff22-Oct-10 4:42
mveOriginalGriff22-Oct-10 4:42 
GeneralRe: Annoying ListBox problem Pin
Luc Pattyn22-Oct-10 5:16
sitebuilderLuc Pattyn22-Oct-10 5:16 
GeneralRe: Annoying ListBox problem Pin
Henry Minute22-Oct-10 4:46
Henry Minute22-Oct-10 4:46 
AnswerRe: Annoying ListBox problem Pin
Luc Pattyn22-Oct-10 5:13
sitebuilderLuc Pattyn22-Oct-10 5:13 
I see nothing wrong with ClearSelected(), here is a little test:
public override void Test(int arg) {
    ListBox lb=new ListBox();
    lb.SelectionMode=SelectionMode.MultiExtended;
    for (int i=0; i<10; i++) lb.Items.Add(i.ToString());
    show(lb);
    lb.SetSelected(4,true);
    show(lb);
    for (int i=0; i<10; i+=3) lb.SetSelected(i, true);
    show(lb);
    lb.ClearSelected();
    show(lb);
    lb.Items.Add("aha");
    lb.SetSelected(lb.Items.Count-1, true);
    show(lb);
}

private void show(ListBox lb) {
    string s="lb holds "+lb.Items.Count+" items; selected indices: ";
    foreach (int index in lb.SelectedIndices) s+=" "+index;
    log(s+".");
}


yielding:
17:09:03.395    CPTest.log-59                        lb holds 10 items; selected indices: .
17:09:03.415    CPTest.log-59                        lb holds 10 items; selected indices:  4.
17:09:03.437    CPTest.log-59                        lb holds 10 items; selected indices:  0 3 4 6 9.
17:09:03.462    CPTest.log-59                        lb holds 10 items; selected indices: .
17:09:03.481    CPTest.log-59                        lb holds 11 items; selected indices:  10.


so I can only suggest your RefreshDataBoundControls() of which no details were revealed, must be the culprit.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Annoying ListBox problem Pin
OriginalGriff22-Oct-10 5:14
mveOriginalGriff22-Oct-10 5:14 
GeneralRe: Annoying ListBox problem Pin
Luc Pattyn22-Oct-10 5:17
sitebuilderLuc Pattyn22-Oct-10 5:17 
GeneralRe: Annoying ListBox problem Pin
OriginalGriff22-Oct-10 5:24
mveOriginalGriff22-Oct-10 5:24 
GeneralRe: Annoying ListBox problem Pin
Luc Pattyn22-Oct-10 5:19
sitebuilderLuc Pattyn22-Oct-10 5:19 
GeneralRe: Annoying ListBox problem Pin
Henry Minute22-Oct-10 5:30
Henry Minute22-Oct-10 5:30 
GeneralRe: Annoying ListBox problem Pin
Luc Pattyn22-Oct-10 5:59
sitebuilderLuc Pattyn22-Oct-10 5:59 
GeneralRe: Annoying ListBox problem Pin
Henry Minute22-Oct-10 6:06
Henry Minute22-Oct-10 6:06 
GeneralRe: Annoying ListBox problem Pin
Henry Minute22-Oct-10 6:48
Henry Minute22-Oct-10 6:48 
GeneralRe: Annoying ListBox problem Pin
Henry Minute22-Oct-10 7:08
Henry Minute22-Oct-10 7:08 
GeneralRe: Annoying ListBox problem Pin
Luc Pattyn22-Oct-10 7:33
sitebuilderLuc Pattyn22-Oct-10 7:33 
GeneralRe: Annoying ListBox problem Pin
Henry Minute22-Oct-10 7:41
Henry Minute22-Oct-10 7:41 
GeneralRe: Annoying ListBox problem Pin
Luc Pattyn22-Oct-10 14:36
sitebuilderLuc Pattyn22-Oct-10 14:36 
GeneralRe: Annoying ListBox problem Pin
Henry Minute22-Oct-10 5:31
Henry Minute22-Oct-10 5:31 
QuestionCrystal Report Formula needed Pin
Nikhil Bhivgade22-Oct-10 1:29
professionalNikhil Bhivgade22-Oct-10 1:29 
AnswerRe: Crystal Report Formula needed [modified] Pin
Sivaraman Dhamodharan22-Oct-10 2:51
Sivaraman Dhamodharan22-Oct-10 2:51 
GeneralRe: Crystal Report Formula needed Pin
Nikhil Bhivgade22-Oct-10 21:35
professionalNikhil Bhivgade22-Oct-10 21:35 
QuestionHost WPF application on WEB Pin
VisualLive22-Oct-10 0:15
VisualLive22-Oct-10 0:15 

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.