2

I am trying to reload the datagridview on change of the combobox value in on of that datagridview columns. I know how to do the reload, but I am having trouble triggering the action. Should I be looking for value change in this particular cell or is there a change in comobobox action?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
bobek
  • 8,003
  • 8
  • 39
  • 75

2 Answers2

0

Do a DataGridView1.Refresh() on the combobox change event.

roymustang86
  • 8,054
  • 22
  • 70
  • 101
  • Shouldn't it be column combobox change event? I can't find one. Can you please give me the name of the exact event. I think I could do that by cell value change, but I thought there is easier way to do it buy getting the column combo box change event. – bobek Aug 26 '11 at 14:53
  • If you want to get the event of an element change, right click on that element, and click properties, and click on the "lightning" button, you will see a whole list of events. And when you see the column combo box value change, double click on that, and it will generate the event function you needed. – roymustang86 Aug 26 '11 at 15:33
  • Yes, that's good for regular combo box. But this combo box is inside a column in a data grid view, so I can't just select it. I have to select the whole data grid view. – bobek Aug 26 '11 at 16:14
  • Is it of datatype DataGridViewComboBoxCell or DataGridViewComboBoxcolumn? – roymustang86 Aug 26 '11 at 18:37
  • Did you figure out the solution? – roymustang86 Aug 30 '11 at 13:14
  • Working on it. I might tie it into another part of the project. – bobek Aug 30 '11 at 13:30
0

I typically use ComboBox_TextChanged events and you can use those within a datagridview as well, as you add them:

comboBox1.TextChanged += delegate(object sender, EventArgs e) { // Do Whatever }

crlanglois
  • 3,537
  • 2
  • 14
  • 18