PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Framework Forms Looking for some help

Reply

Looking for some help

 
Thread Tools Rate Thread
Old 20-01-2004, 04:25 PM   #1
Arjen
Guest
 
Posts: n/a
Default Looking for some help


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



  Reply With Quote
Old 20-01-2004, 08:25 PM   #2
Arjen
Guest
 
Posts: n/a
Default Re: Looking for some help

Got it... set column with to 0.

"Arjen" <boah123@hotmail.com> schreef in bericht
news:bujkq0$epk$1@news3.tilbu1.nb.home.nl...
> 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
>
>
>



  Reply With Quote
Old 21-01-2004, 03:22 PM   #3
Arjen
Guest
 
Posts: n/a
Default Re: Looking for some help

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



"ClayB [Syncfusion]" <clayb@syncfusion.com> schreef in bericht
news:Orq9Q2A4DHA.2404@TK2MSFTNGP12.phx.gbl...
> You can add a DataGridtableStyle to your DataGrid to control what columns
> are visible. Attached is a little sample. The sample also shows the key

and
> value members of the clicked row when you double click the row header. To
> catch a double click of a normal cell in a datagrid takes more work. See

the
> FAQ referenced below.
>
>
> George Shepherd's Windows Forms FAQ contains an entry entitled:
>
> How do I catch a doubleclick in my datagrid?
>
> Check it out at:
> http://www.syncfusion.com/faq/winforms/search/869.asp
>
> =============================================
> Clay Burch, .NET MVP
>
> Syncfusion, Inc.
> visit http://www.syncfusion.com for .NET Essentials
>
>
> "Arjen" <boah123@hotmail.com> wrote in message
> news:bujkq0$epk$1@news3.tilbu1.nb.home.nl...
> > 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
> >
> >
> >

>
>
>



  Reply With Quote
Old 23-01-2004, 12:54 PM   #4
ClayB [Syncfusion]
Guest
 
Posts: n/a
Default Re: Looking for some help

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

"Arjen" <boah123@hotmail.com> wrote in message
news:bum5ga$7s8$1@news4.tilbu1.nb.home.nl...
> 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
>
>
>
> "ClayB [Syncfusion]" <clayb@syncfusion.com> schreef in bericht
> news:Orq9Q2A4DHA.2404@TK2MSFTNGP12.phx.gbl...
> > You can add a DataGridtableStyle to your DataGrid to control what

columns
> > are visible. Attached is a little sample. The sample also shows the key

> and
> > value members of the clicked row when you double click the row header.

To
> > catch a double click of a normal cell in a datagrid takes more work. See

> the
> > FAQ referenced below.
> >
> >
> > George Shepherd's Windows Forms FAQ contains an entry entitled:
> >
> > How do I catch a doubleclick in my datagrid?
> >
> > Check it out at:
> > http://www.syncfusion.com/faq/winforms/search/869.asp
> >
> > =============================================
> > Clay Burch, .NET MVP
> >
> > Syncfusion, Inc.
> > visit http://www.syncfusion.com for .NET Essentials
> >
> >
> > "Arjen" <boah123@hotmail.com> wrote in message
> > news:bujkq0$epk$1@news3.tilbu1.nb.home.nl...
> > > 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
> > >
> > >
> > >

> >
> >
> >

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off