0
    private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
    {
        if (e.ColumnIndex == dataGridView1.Columns["RESER"].Index)
        {
            SelectedITEMID = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["ColumnITEMID"].Value.ToString());
            string ITEMNAME = dataGridView1.Rows[e.RowIndex].Cells["ColumnITEMNAME"].Value.ToString();
            string SERIALNO = dataGridView1.Rows[e.RowIndex].Cells["ColumnSERIALNO"].Value.ToString();

            frmSetup_RFIDItem_Update frmSRI_Update = new frmSetup_RFIDItem_Update();
            frmSRI_Update.setSelectedInfo1(SelectedITEMID, ITEMNAME, SERIALNO);
            frmSRI_Update.ShowDialog();
            frmSRI_Update.Dispose();

            getRegisteredRFIDItemList();
        }
    }
jmcilhinney
  • 50,448
  • 5
  • 26
  • 46
  • Please don't rely on your title to convey the entire question. Provide a proper explanation. Do you want to disable all buttons in the column? Just the current row? All rows that are selected? Something else? – jmcilhinney Apr 09 '14 at 01:58
  • i want to disable button column for the selected data. Yes, all row that are selected. Only the enable button can open the other winform page..thank you – beginner_programmer Apr 09 '14 at 02:04

1 Answers1

0

You already know how to get the row that contains the clicked button because you're already doing it. Simply test the Selected property of that row and only do something if it's false.

If you want to draw the buttons as disabled in those rows then that's something else and, I believe, would require you to create your own derived column and cell classes. This may be of interest in that case.

jmcilhinney
  • 50,448
  • 5
  • 26
  • 46
  • then, any idea to select the property of that row, to be false. only for selected row..because i already make this in 2 days and yet still not success..any idea..thank you – beginner_programmer Apr 09 '14 at 02:14
  • It's a property like any other. If you don't know how to get the value of a property then you've got far bigger problems. How is it that you are able to test the Index property of a column in your existing code yet for some reason you're unable to test the Selected property of a row? Don't try to turn this into more than it is. You know how to get a property value and compare it to something else because you're already doing it. – jmcilhinney Apr 09 '14 at 02:18
  • ok..thanks for the advice and support. i'll try 1st..thank you very much – beginner_programmer Apr 09 '14 at 02:25