• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 124
  • Last Modified:

Updating a datagridcolumn once excel lookup has been modified

with using
thisgrid.Rows(i).Cells("columnName").value and an excel lookup

I am able to right click on the dataGrid and click edit Excel spreadsheet for this grid.
Once I make a change to the excel spreadsheet I want the dataGrid to update immediately without having to close and reopen.

I am using .cellvaluechanged and . cellclick events

What is the procedure to do this?
  • 2
1 Solution
You can call the code that binds the grid to rebind it.
taviafAuthor Commented:
@CodeCruiser, what do you mean? And how... The grid gets its data on the cellvaluechanged event of another tab...

 Private Sub controlEventComboBox_CellValueChanged(sender As Object, e As DataGridViewCellEventArgs) Handles gridTab1.CellValueChanged

For Each thisEvent In mLookupRecords.ExcelList

                If Trim(UCase(thisEvent.ProbeEvent)) = Trim(UCase(probeEvents)) Then
                    gridTab2.Rows(gridTab2.RowCount - 1).Cells("csdnamonnumber").Value = gridTab1.Rows(e.RowIndex).Cells("controleventmonnumber").Value
                    gridTab2.Rows(gridTab2.RowCount - 1).Cells("csProbeDescription").Value = thisEvent.Description
                End If
Move this code into a method. Call that method from the combobox_cellvaluechanged event as well as where you need to refresh it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now