I have created a simple form (Name RapidSales) in vb.net winform using visual studio 2010. I have datagridview1 on this form. Whenever i call to it by using the following code its successfully works:-
RapidSales.rgv.CurrentRow.Cells("ProductId").Value = myvalue
But whenever i create in instance of this 'RapidSales' form and then write and run the following code it gives me an error:
Dim winform As New RapidSales()
winform.rgv.CurrentRow.Cells("ProductId").Value = myvalue
Error message is following:-
Object reference not set to an instance of an object.
Please anyone help that how can i avoid this error and run my code successfully.
Thanks in advance