Click here to Skip to main content
15,911,142 members
Home / Discussions / C#
   

C#

 
AnswerRe: Creating a Report from XML/Array data in C# Pin
Ashfield13-May-08 21:25
Ashfield13-May-08 21:25 
GeneralRe: Creating a Report from XML/Array data in C# Pin
Andy Rama13-May-08 21:33
Andy Rama13-May-08 21:33 
GeneralRe: Creating a Report from XML/Array data in C# Pin
Andy Rama14-May-08 19:39
Andy Rama14-May-08 19:39 
Questionfisheye image Pin
selvarajanlatha13-May-08 19:18
selvarajanlatha13-May-08 19:18 
AnswerRe: fisheye image Pin
Christian Graus13-May-08 20:10
protectorChristian Graus13-May-08 20:10 
Questionhow can i read a black pixel in binary image and displays it on a test box?? Pin
syarmiza13-May-08 19:03
syarmiza13-May-08 19:03 
AnswerRe: how can i read a black pixel in binary image and displays it on a test box?? Pin
Christian Graus13-May-08 19:04
protectorChristian Graus13-May-08 19:04 
QuestionEvent firing in selectIndexChanged event Pin
steve_rm13-May-08 18:36
steve_rm13-May-08 18:36 
Hello,

VS 2008.

I have the following code in the SelectedIndexChanged event of a combo box.

 <br />
DataRowView drv;  <br />
                        drv = (DataRowView) this.bsRedialedNumbers.Current;<br />
<br />
                        if (!drv.Row.IsNull("Number"))<br />
                        {<br />
                            phoneNumber = drv["Number"].ToString();<br />
                            name = drv["Name"].ToString();<br />
                        } 


I have the combo box and a button. The user will select a name from the comb box and click a button to do something with that name. However, I have noticed that when I click to change an item in the combo box the event will fire once. Which is correct. However, when I click the button, this event will fire twice.

When the event fires for the second time it will give a -1 for the row. Which is not what I expect. As an item has been selected.

To do a quick fix for this problem I check for IsNull on the number column. Which works. However, I would like to find a complete solution for this problem. At the moment I haven't found one.

The reason I think the event fires twice when the button is click, is because the combo box has lost focus. But cannot see why this would fire the combo box. And why it would return a -1 for the row.

Many thanks for any suggestions and help,

Steve
AnswerRe: Event firing in selectIndexChanged event Pin
Christian Graus13-May-08 19:05
protectorChristian Graus13-May-08 19:05 
QuestionGet Member Reference Pin
csharpguy7613-May-08 16:15
csharpguy7613-May-08 16:15 
QuestionDataGridView and Control Box Closing Pin
paas13-May-08 9:07
paas13-May-08 9:07 
QuestionAvoid contextmenustrip pop-up Pin
baranils13-May-08 9:00
baranils13-May-08 9:00 
AnswerRe: Avoid contextmenustrip pop-up Pin
cocoonwls13-May-08 17:38
cocoonwls13-May-08 17:38 
GeneralRe: Avoid contextmenustrip pop-up Pin
baranils13-May-08 19:05
baranils13-May-08 19:05 
GeneralRe: Avoid contextmenustrip pop-up Pin
cocoonwls13-May-08 22:50
cocoonwls13-May-08 22:50 
GeneralRe: Avoid contextmenustrip pop-up Pin
baranils13-May-08 23:01
baranils13-May-08 23:01 
GeneralRe: Avoid contextmenustrip pop-up Pin
cocoonwls14-May-08 15:09
cocoonwls14-May-08 15:09 
GeneralRe: Avoid contextmenustrip pop-up Pin
baranils14-May-08 18:59
baranils14-May-08 18:59 
GeneralRe: Avoid contextmenustrip pop-up Pin
cocoonwls14-May-08 22:14
cocoonwls14-May-08 22:14 
QuestionProblem with C# 3.0 Collection and Object Initializers [modified] Pin
User 665813-May-08 7:58
User 665813-May-08 7:58 
AnswerRe: Problem with C# 3.0 Collection and Object Initializers Pin
Gareth H13-May-08 9:06
Gareth H13-May-08 9:06 
GeneralRe: Problem with C# 3.0 Collection and Object Initializers Pin
User 665813-May-08 9:13
User 665813-May-08 9:13 
GeneralRe: Problem with C# 3.0 Collection and Object Initializers Pin
Gareth H13-May-08 9:36
Gareth H13-May-08 9:36 
AnswerRe: Problem with C# 3.0 Collection and Object Initializers Pin
Ed.Poore13-May-08 10:20
Ed.Poore13-May-08 10:20 
GeneralRe: Problem with C# 3.0 Collection and Object Initializers Pin
User 665813-May-08 10:39
User 665813-May-08 10:39 

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.