Results 1 to 12 of 12

Thread: Weird Exception when showing Data in DataGridView

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2017
    Posts
    18

    Resolved Weird Exception when showing Data in DataGridView

    Hi everyone! I'm new as a registered user but I've been reading this forum for help for the last 2 months, I have the following issue:

    I have a Form, where I load a Query stored in my DataSet, I use a DataGridView to show the query (my idea is to use the selected index on the DataGridView in order to allow the user to edit that row), I use the following code:

    Public Table As DataTable

    When the form loads I run this code:

    Table = DetProdConsultaTableAdapter.GetDetalleProductos(ID_Orden)
    DataGridView1.DataSource = Table


    But when the form loads, I get the following exception:
    Unable to cast object 'System.EventArgs' to type 'System.Windows.Forms.DataGridViewCellEventArgs'

    on the line where I set the DataGridView's Data Source

    I hope I've been clear enough

    Thanks a lot!
    Last edited by nicomanzur; Jan 4th, 2017 at 10:53 AM. Reason: Solution found

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width