Hi stephen,

I gone through your code... It's nice...

 I have a work around for this...

Pls try this...

 Dim DT As New DataTable
        DT.Columns.Add("S.N")
        For i As Integer = 0 To 5
            DT.Rows.Add()
            DT.Rows(DT.Rows.Count - 1).Item(0) = i + 1
        Next


        Dim grd As New DataGridView
        grd.DataSource = DT

        grd.Name = "grd1"

        Form1.Panel1.Controls.Add(grd)
        Form1.Panel1.Controls.Item("grd1").Refresh()

        Form1.ShowDialog()

It works fine... Hope it helps for you..

Thanks,
Manikandan.T

On Mon, May 16, 2011 at 10:45 PM, Stephen Russell <[email protected]>wrote:

> I have a complex form with three panels 1,2,3 1&2 contain textboxes
> galore and are visible.  Panel3 is in the middle of the form(dock =
> fill)
>
> I get an error here in .Refresh().  The table has 5+ rows and is
> visible in the debugger with data.
>
> Dim dgvcharges As DataGridView = New DataGridView()
>        dgvcharges.DataSource = invTable
>        ShowForm.Controls.Item("Panel3").Controls.Add(dgvcharges)
>
>  ShowForm.Controls.Item("Panel3").Controls.Item("dgvcharges").Refresh()
>  <<< error here is "Object reference not set to an instance of an
> object."
>
> Any ideas about what I am missing?
>
> TIA
>
> --
> Stephen Russell
>
> Unified Health Services
> 60 Germantown Court
> Suite 220
> Cordova, TN 38018
>
> Telephone: 888.510.2667
>
> 901.246-0159 cell
>
> --
> You received this message because you are subscribed to the Google
> Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
> Web Services,.NET Remoting" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
> or visit the group website at http://megasolutions.net
>

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to