473,747 Members | 2,736 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hashtable to windows form

Hello,

I have a hash table... some results from it I like to see in a windows form.
Which component must I use?

Users may select one item in the "list" (from the hash table)...
How can I see which item the user haves selected?

Thanks!
Arjen
Nov 15 '05 #1
3 2283
Arjen,

You can not bind directly to the hashtable. The reason for this is that
it does not implement IList. What you want to do is either copy the values
from the hashtable (both the key and the value) to a data table, using one
column for the key, and one for the value.

Or, if you want, you can return just the keys and the values as an array
(I believe) and then bind to those lists.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Arjen" <bo*****@hotmai l.com> wrote in message
news:bu******** **@news3.tilbu1 .nb.home.nl...
Hello,

I have a hash table... some results from it I like to see in a windows form. Which component must I use?

Users may select one item in the "list" (from the hash table)...
How can I see which item the user haves selected?

Thanks!
Arjen

Nov 15 '05 #2
Hi,

Thanks.

I have a hashtable which I converted to a datatable with "key" and "value"
as column names.
Now I want to fill the datagrid 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.

Can you/somebody show me how to connect the datatable to the datagrid?
And how to hide the "Key" column?

(With a sample or with a good URL)

Thanks!
Arjen

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> schreef
in bericht news:ut******** ******@TK2MSFTN GP11.phx.gbl...
Arjen,

You can not bind directly to the hashtable. The reason for this is that it does not implement IList. What you want to do is either copy the values from the hashtable (both the key and the value) to a data table, using one
column for the key, and one for the value.

Or, if you want, you can return just the keys and the values as an array (I believe) and then bind to those lists.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Arjen" <bo*****@hotmai l.com> wrote in message
news:bu******** **@news3.tilbu1 .nb.home.nl...
Hello,

I have a hash table... some results from it I like to see in a windows

form.
Which component must I use?

Users may select one item in the "list" (from the hash table)...
How can I see which item the user haves selected?

Thanks!
Arjen


Nov 15 '05 #3
Got it... set column with to 0.

"Arjen" <bo*****@hotmai l.com> schreef in bericht
news:bu******** **@news2.tilbu1 .nb.home.nl...
Hi,

Thanks.

I have a hashtable which I converted to a datatable with "key" and "value"
as column names.
Now I want to fill the datagrid 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.

Can you/somebody show me how to connect the datatable to the datagrid?
And how to hide the "Key" column?

(With a sample or with a good URL)

Thanks!
Arjen

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> schreef
in bericht news:ut******** ******@TK2MSFTN GP11.phx.gbl...
Arjen,

You can not bind directly to the hashtable. The reason for this is

that
it does not implement IList. What you want to do is either copy the

values
from the hashtable (both the key and the value) to a data table, using one column for the key, and one for the value.

Or, if you want, you can return just the keys and the values as an

array
(I believe) and then bind to those lists.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Arjen" <bo*****@hotmai l.com> wrote in message
news:bu******** **@news3.tilbu1 .nb.home.nl...
Hello,

I have a hash table... some results from it I like to see in a windows

form.
Which component must I use?

Users may select one item in the "list" (from the hash table)...
How can I see which item the user haves selected?

Thanks!
Arjen



Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
4037
by: Oberon | last post by:
My HashTable (Global.Games) is a static collection of objects of type Game. A Game object has 8 fields (exposed as properties). The key to the HashTable is also one of these fields (GameID, of type int). When I try to create a SortedList from the HashTable with the following: SortedList sortedGames = new SortedList(Global.Games); I get an error message:
3
9695
by: Fred | last post by:
I'm trying to build a hashtable and a arraylist as object value I'm not able to retrieve stored object from the hashtable. Hashtable mp = new Hashtable(); // THE HASHTABLE ArrayList atemp = new ArrayList(); // THE ARRAY StreamWriter sw = new StreamWriter(@"C:\temp\fred.html");
10
2094
by: Q | last post by:
Hi, I'm using a hashtable to store away a bunch of numbers from my array: The Hashtable should look like: Key Value 1 01234 2 01235
5
777
by: Vikas Kumar | last post by:
Hashtable 7/7/2006 2:37 AM I have this Hasttable windowList Hashtable windowList = new Hashtable(); To this Hashtable I add a form with a string as key in the following manner. The string is decided at runtime. FormX frm = new FormX(); frm.Show();
0
8979
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9307
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8233
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6067
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4588
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3296
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.