Interviews2 answers
2 Answers
Say for example your arr adding a text from textbox to Listbox that can be displayed from listbox to datagrid.
private void Button1_Click(object sender, System.EventArgs e)
{
ListBox1.Items.Add(TextBox1.Text);
ArrayList arr = new ArrayList();
foreach(ListItem item in ListBox1.Items)
{
arr.Add(item.ToString());
}
if(ListBox1.Items.Count>0)
{
DataGrid1.DataSource = arr;
DataGrid1.DataBind();
}
}
manikantaPosted Nov 21, 2006, 10:56 PM EST
Can anybody help me, hoow to bind data from list to a data grid? thanks
jamesPosted Nov 14, 2006, 3:23 PM EST