Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8523061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:18:10+00:00 2026-06-11T07:18:10+00:00

I am trying to update a datagridview and a chart. I have a class

  • 0

I am trying to update a datagridview and a chart.
I have a class and in that class I have a function that returns a datatable from database.
I need the bindingSource because this is how I update chart (bar)
Unfortunately when the chart is Pie I need to use a datatable for updating
So when I load the form I have:

gbsGraph.DataSource = graphFunctions.prepareData() 'gbsGraph is a BindingSource
gdtGraphData = graphFunctions.prepareData() 'gdtGraphData  isDataTable
gdv.DataSource = gbsGraph 'gdv is my datagridview
AddHandler gdtGraphData.RowChanged, AddressOf gdtGraphData_RowChanged 'add event for update piechart
fillChart()'code to fill the chart

When the user press the refresh button:

Private Sub tsmiRefresh_Click(sender As System.Object, e As System.EventArgs) Handles tsmiRefresh.Click
  gbsGraph.DataSource = graphFunctions.prepareData()' this works and dgv and my bar charts are updated
  gdtGraphData = graphFunctions.prepareData()  'this is should trigger the event gdtGraphData.RowChanged but it doesn't   
End Sub

My custom event for DataRowChange:

Private Sub gdtGraphData_RowChanged(ByVal sender As Object, ByVal e As DataRowChangeEventArgs)
    'Here is code to refill the Pie chart
    'but the event isn't fired
End Sub

So my question is how I can update my datatable and fire the gdtGraphData_RowChanged event?

Thanks
T

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:18:11+00:00Added an answer on June 11, 2026 at 7:18 am

    The row changed event is raised when a value inside a row inside a datatable is changed, not when you put a new instance of a datatable into a variable …

    An example:

    ' This will raise the rowchanged event
    gdtGraphData.Rows(0)("someField") = 123
    
    ' This will not!
    gdtGraphData = graphFunctions.prepareData()
    

    You will have to put the code to refill the Pie chart inside the tsmiRefresh_Click …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DataGridView that displays data from a MS Access database. I'm using
I'm trying to update one textfield from another class: I have two classes: @interface
I am trying to update a database with values from a csv file, the
I am trying to update individual record in SQL table. So, I have DataGridView
We're working with a DataGridView bound to a database. We are trying to have
pstrjds, From the code you have provided I am trying to implement that code
I am trying update my table from c# ado.net with this function.I am using
I have been trying to use OleDbDataAdapter to update a DataTable but got confused
When trying to update a subversion working copy from Netbeans, I get the following
I'm trying to create a windows form application that manipulates data from several tables

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.