Click here to Skip to main content
15,890,336 members
Home / Discussions / C#
   

C#

 
GeneralRe: String format for MAC-address Pin
fjdiewornncalwe25-Mar-11 2:55
professionalfjdiewornncalwe25-Mar-11 2:55 
QuestionControl forms of an app Pin
dj_jeff24-Mar-11 3:43
dj_jeff24-Mar-11 3:43 
AnswerRe: Control forms of an app Pin
BobJanova24-Mar-11 5:23
BobJanova24-Mar-11 5:23 
AnswerRe: Control forms of an app Pin
Nitheesh George24-Mar-11 20:30
Nitheesh George24-Mar-11 20:30 
GeneralRe: Control forms of an app Pin
dj_jeff24-Mar-11 21:28
dj_jeff24-Mar-11 21:28 
GeneralRe: Control forms of an app Pin
Nitheesh George24-Mar-11 22:45
Nitheesh George24-Mar-11 22:45 
GeneralRe: Control forms of an app Pin
dj_jeff25-Mar-11 0:11
dj_jeff25-Mar-11 0:11 
QuestionDatagridviewcomboboxcolumn SelectedIndexChanged not work properly Pin
Davey_guan24-Mar-11 3:34
Davey_guan24-Mar-11 3:34 
I am using following code:

dgTrans.EditingControlShowing += new DataGridViewEditingControlShowingEventHandler(dgTrans_EditingControlShowing);
private void dgTrans_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
        {
            ComboBox combo = e.Control as ComboBox;
            System.Diagnostics.Debug.WriteLine(dgTrans.CurrentCell.ColumnIndex + "EditControlShowing");
            if (combo != null)
            {
                combo.SelectedIndexChanged -= new EventHandler(dgcboDocNo_SelectedIndexChanged);
                combo.SelectedIndexChanged += new EventHandler(dgcboDocNo_SelectedIndexChanged);
            }
        }

        private void dgcboDocNo_SelectedIndexChanged(object sender, EventArgs e)
        {
            System.Diagnostics.Debug.WriteLine(dgTrans.CurrentCell.ColumnIndex + "SelectedIndexChanged");

            string docno = ((ComboBox)sender).Text.ToString();
            DataRow[] dr = myDs.Tables["DetailDocRegister"].Select("DocNo = '" + docno + "'");
            int y = dgTrans.CurrentCellAddress.Y;
            dgTrans.Rows[y].Cells[1].Value = dr[0]["DocTitle"];
        }


But it not work properly. the first column is combobox. second is textbox, which will show the value according to what selected in combobox column. the first time select one item in combobox, it is ok. when you continue select items in second row. one error comes out.But if you select combobox column, then click another column, then select items in another row, it works.

how to solve this problem? thanks for your help.
AnswerRe: Datagridviewcomboboxcolumn SelectedIndexChanged not work properly Pin
Henry Minute24-Mar-11 17:12
Henry Minute24-Mar-11 17:12 
GeneralRe: Datagridviewcomboboxcolumn SelectedIndexChanged not work properly Pin
Davey_guan25-Mar-11 19:48
Davey_guan25-Mar-11 19:48 
GeneralRe: Datagridviewcomboboxcolumn SelectedIndexChanged not work properly Pin
Henry Minute26-Mar-11 5:03
Henry Minute26-Mar-11 5:03 
GeneralRe: Datagridviewcomboboxcolumn SelectedIndexChanged not work properly Pin
Davey_guan26-Mar-11 20:01
Davey_guan26-Mar-11 20:01 
GeneralRe: Datagridviewcomboboxcolumn SelectedIndexChanged not work properly Pin
Henry Minute26-Mar-11 5:40
Henry Minute26-Mar-11 5:40 
Questionneed help in c# coding Pin
ULKA RAMAKRISHNAN24-Mar-11 2:16
ULKA RAMAKRISHNAN24-Mar-11 2:16 
AnswerRe: need help in c# coding Pin
Ravi Bhavnani24-Mar-11 2:19
professionalRavi Bhavnani24-Mar-11 2:19 
AnswerRe: need help in c# coding Pin
RobCroll24-Mar-11 2:26
RobCroll24-Mar-11 2:26 
Question.resources Edit Pin
obi.bin24-Mar-11 1:00
obi.bin24-Mar-11 1:00 
QuestionNew Version Update Pin
sachees12323-Mar-11 23:00
sachees12323-Mar-11 23:00 
AnswerRe: New Version Update Pin
RobCroll23-Mar-11 23:54
RobCroll23-Mar-11 23:54 
AnswerRe: New Version Update Pin
PIEBALDconsult26-Mar-11 5:47
mvePIEBALDconsult26-Mar-11 5:47 
QuestionHow do I defined property in C#? Pin
baisak23-Mar-11 19:03
baisak23-Mar-11 19:03 
AnswerRe: How do I defined property in C#? Pin
JF201523-Mar-11 19:05
JF201523-Mar-11 19:05 
AnswerRe: How do I defined property in C#? Pin
Pravin Patil, Mumbai23-Mar-11 22:18
Pravin Patil, Mumbai23-Mar-11 22:18 
AnswerRe: How do I defined property in C#? Pin
Nitheesh George24-Mar-11 2:50
Nitheesh George24-Mar-11 2:50 
AnswerRe: How do I defined property in C#? Pin
fjdiewornncalwe24-Mar-11 4:29
professionalfjdiewornncalwe24-Mar-11 4:29 

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.