Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Everyone,

I have two forms let say "Form1","Form2". In Form1 created object for form2 and
getting all the controls present in form2.

Am able to read all the lables,textbox,buttons.But unable to get the datagridview header columns.how to typecast a control(ctrl) as datagridview.

please help me anyone.

here is my bit of code.


Hide Copy Codeforeach (Control ctrl in C.Controls)
{


if (ctrl.GetType() == typeof(System.Windows.Forms.DataGridView))
{}
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900