Resolved C# datagrid

Mre14

New member
Joined
Oct 14, 2021
Messages
1
Programming Experience
Beginner
I have two forms. One form has a datagrid with a csv file I imported. The second form I want to use to show/ hide columns of the datagrid, but keep getting errors that the column names don't exist When I try to hide them. How would I go about being able to access a datagrids properties on form 1 from form 2. Thank you.
 
You need to be much more specific in your explanation. You are talking about forms so I assume that this is a Windows Forms app. In that case, you should have posted in the Windows Forms forum. Don't just post in C# General because it's easy. Do so if and only if you have a C# language question that doesn't fit in any other more specific forum.

Also, if you are using Windows Forms then you are most likely using a DataGridView, because that's the one in the Toolbox. There is an old DataGrid control though, and it's also possible that you're actually using WPF and its DataGrid control.

Finally, you need to actually show us what you're doing and explain exactly what and where it does other than you expect. Maybe we need to write something from scratch but maybe the best solution is a simple tweak to your code. We can't know if we can't see what you've done.

Please provide a FULL and CLEAR explanation of the problem, we'll move the thread to the most appropriate forum and then we can look at solving the problem, once we know what the problem actually is.
 
Back
Top Bottom