Hi,
I tried the code as below
Hashtable ht = new Hashtable();
for (int x = 0; x < 10; x++)
{
Class1 a = new Class1();
a.a = x;
a.str = "ff";
ht.Add(a, a);
}
dataGridView1.SelectionMode =
DataGridViewSelectionMode.FullRowSelect;
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = ht;
When i run the above code,nothing is diaplayed in
datagridView.DatagridView is empty only
Mani
chanmm wrote:
Try this:
dataGridView1.SelectionMode =DataGridViewSelectionMode.FullRowSelect;
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = ht;
chanmm
<pl**********@gmail.comwrote in message
news:11**********************@d56g2000cwd.googlegr oups.com...
Hi,
I am using .net framework2.0,Visual Studio 2005.I need to bind the hash
table to datagridview.Is it possible
I am having class Person
class person
{
public int no;
public string name;
}
person a=new person();
a.no=100;
a.name="ffg";
I need to add obj a as both key and value
Hashtable ht = new Hashtable();
ht.add(a,a);
When I bind the Hashtable to datagridview,it is not showing anything in
datagridview.Is it possible to bind Hashtable to datagridview.Kindly
provide me the steps to bind hashtable to datagridview.
Regards,
Manikandan