• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 120
  • 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?
0
taviaf
Asked:
taviaf
  • 2
1 Solution
 
CodeCruiserCommented:
You can call the code that binds the grid to rebind it.
0
 
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.Add()
                    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
            Next
...
0
 
CodeCruiserCommented:
Move this code into a method. Call that method from the combobox_cellvaluechanged event as well as where you need to refresh it.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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