Looking for some help

  • Thread starter Thread starter Arjen
  • Start date Start date
A

Arjen

Hello,

Can somebody please help me with this?

I have a hashtable which I converted to a datatable with "key" and "value"
as column names.
I also have a windows form with two datagrids.

Now I want to fill datagrid 1 with the datatable, but I only want to see the
"value" column.
The user may select (double click) one recod inside this datagrid, I want to
know the value inside the "Key" column of the selected column. Remember, the
column "Key" you cannot see on the screen.

Thats it!

Can somebody show me how to connect the datatable to the datagrid?
How to hide the "Key" column?
How to retriev the selected record with the value of that "Key" column?
Can you give me some sample code?

Thanks!
Arjen
 
Thanks, this helps a lot!

Maybe you can tell me this also...
I have a from with the name From1.
And also a main form.

Now I want to switch from main form to From1.
(And back, just click in the control box of From1)

Now I have made a button with this:
Form1 frm1 = new Form1();
frm1.show();

When I do this al the time... then I have multiple frm1 objects???
Or not? I don't think that this is good for the performance.

Can you tell me more about this?
Are there other options?

Thanks!
Arjen
 
Make frm1 a member of the form holding the button.

private Form1 frm1 = null;

Then in your button handler have code like:

if(frm1 == null)
{
frm1 = new Form1();
}
frm1.show();

This way, the first time you click the button, a new form1 will be created
and shown. Thereafter when you click this button, only the old form1 will be
shown (no form will be created).


======================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools
 
Back
Top