Solved

Updating a datagridcolumn once excel lookup has been modified

Posted on 2014-03-26
3
111 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

688 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