Following code snippet shows how to convert HashTable into ArrayList and Bind to DataControls.
Class MyClass
{
public static ArrayList HashTableToArrayList(Hashtable hTable)
{
ArrayList list = new ArrayList();
foreach (int key in hTable.Keys)
{
list.Add(hTable[key]);
}
return list;
}
}
Now you can use above function to Bind any DataControls like GridView.
GridView1.DataSource = MyClass.HashTableToArrayList(myhashTable);
GridView1.DataBind();