المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : dataGridView and columns.add



C# Programming
09-26-2009, 07:00 AM
Hi guys,
I am in a bit of dilemma and need some help please!!!

Here is my scenario
I have a couple datagridviews which populate data from a dataset
I have cell_click event which is used to move data from one grid to another. If there is no empty cell in my grid2 then I add a column in the cell click event and populate data into the new column cell.

I also have a drag drop event which I use to move data across grid2, after I do the cell click for some reason it doesn't let me do drag drop, it says object reference not set to an instance of an object in the new cell where the data is being dropped. My assumption is that after I add the column, for some reason there is a null reference on all cells except the added data cell. How do I add the column, update the dataset and the datagridview without reloading the data in the grid.

Hope I make sense. Please helppppp

Sameer