Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] passing datagrid as parameter..How?

Started by monchito Jun 27, 2009 at 6:22 PM 0 replies 900+ views
Original Post
monchito
monchito
Hi........using C#2008 Express Ed. I need to manipulate the grid in 2 different forms. How do i pass the datagrid created in one form to another form. I actually use some get/set's to get data from the 2nd form. Now they are too many gets... best if i can pass the grid. I know how to do it in VB6, but not in C# Thanks
Machaira
Machaira
Form2 frm = new Form2(this.grid);

Change the constructor for the 2nd form to accept the Datagrid as a parameter. Although I would not recommend doing this, you should pass the data in the grid instead if you have to or get the data from wherever it resides in the 2nd form.
Former Microsoft XNA and Xbox MVP | Check out my blog for random ramblings on game development

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.