Solved

Updating a datagridcolumn once excel lookup has been modified

Posted on 2014-03-26
3
104 Views
Last Modified: 2014-07-21
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
Comment
Question by:taviaf
  • 2
3 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39957323
You can call the code that binds the grid to rebind it.
0
 

Author Comment

by:taviaf
ID: 39957751
@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
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39961216
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now