PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Looking for some help
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Framework Forms
Looking for some help
![]() |
Looking for some help |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 > > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 > > > > > > > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
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 > > > > > > > > > > > > > > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

