PC Review


Reply
Thread Tools Rate Thread

combobox.SelectedIndexChanged fires twice ??

 
 
Steve F.
Guest
Posts: n/a
 
      19th Nov 2004
I have a problem. I use a combobox in my datagrid, but I noticed, as soon as
the user clicks on the field where the combobox, the event fires with a
index value of 0, then of course with the selected index value as it should.

But why is it firing the first time. How do I make it stop. Please advice.
Thank You,

Steve
http://www.ItsMoreThanSoftware.com


 
Reply With Quote
 
 
 
 
Mohamoss
Guest
Posts: n/a
 
      21st Nov 2004
Hi steve
Is it webfrom or windows form, would you post a snippet of your code ?
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

 
Reply With Quote
 
Steve F.
Guest
Posts: n/a
 
      23rd Nov 2004
Windows form, and here is some code. Thank you for your help.

Private Sub mycombo2_SelectedIndexChanged(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles mycombo2.SelectedIndexChanged
IDvalue = Me.DG_punch.Item(Me.DG_punch.CurrentRowIndex, 1)

If mycombo2.Text = "Closed" Then
Dim currentCell As DataGridCell
Dim currentCellData As String
currentCell = DG_punch.CurrentCell
currentCell.ColumnNumber = 8
DG_punch(currentCell.RowNumber, currentCell.ColumnNumber) = Now

Else
Dim currentCell As DataGridCell
Dim currentCellData As String
currentCell = DG_punch.CurrentCell
currentCell.ColumnNumber = 8
DG_punch(currentCell.RowNumber, currentCell.ColumnNumber) =
System.DBNull.Value

End If

Steve

"Mohamoss" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi steve
> Is it webfrom or windows form, would you post a snippet of your code ?
> Mohamed Mahfouz
> MEA Developer Support Center
> ITworx on behalf of Microsoft EMEA GTSC
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse roller changes combobox SelectedItem not visible, wich fires SelectedIndexChanged event Joćo Araśjo Microsoft Dot NET Framework Forms 1 22nd Jul 2007 04:55 AM
ASP.NEt 2.0 GridView: OnDataBound fires after SelectedIndexChanged =?Utf-8?B?U3RlcGhlbg==?= Microsoft Dot NET 0 3rd Aug 2005 09:56 PM
ListView SelectedIndexChanged fires when e.Cancel set in Validatin =?Utf-8?B?UGVhY0Vycm9y?= Microsoft C# .NET 0 8th Jul 2005 07:52 PM
SelectedIndexChanged fires erroneously in OwnerDraw ListBox felix Microsoft Dot NET Framework Forms 0 25th Jan 2005 10:19 PM
comboBox SelectedIndexChanged fires 4 time on load Anthony Microsoft C# .NET 0 6th May 2004 12:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:50 AM.