T
Thiyagarajan Natarajan
Hi all,
I am unable to display the data in dropdown list in datagrid control.
can anybody help me please?
my ItemDataBound code is here.....
private void dgResearchCalls_ItemDataBound_1(object sender, System.Web.UI.
WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.
AlternatingItem)
{
e.Item.Cells[0].Text = "<a tabindex='-1' class='" + e.Item.CssClass +
"'href='../AppPages/AddEditCustomer.Aspx?CustomerID=" + e.Item.Cells[0].Text
+ "'><img style='cursor:hand' border=0 alt='Edit Company' src=..
/images/edit_icon.gif></a>";
e.Item.Cells[1].Text = e.Item.Cells[1].Text.ToString();
e.Item.Cells[2].Text= e.Item.Cells[2].Text.ToString();
DropDownList ddlst=(DropDownList)e.Item.Cells[3].FindControl("ddlstContact2")
;
ddlst.DataSource=DataHelper.GetddlstContacts();
ddlst.DataTextField="ContactName";
ddlst.DataValueField="ContactName";
ddlst.DataBind();
e.Item.Cells[4].Text = e.Item.Cells[4].Text.ToString();
e.Item.Cells[5].Text=e.Item.Cells[5].Text.ToString();
e.Item.Cells[6].Text=e.Item.Cells[6].Text.ToString();
}
}
this is my code...........
advanced thanks for all
I am unable to display the data in dropdown list in datagrid control.
can anybody help me please?
my ItemDataBound code is here.....
private void dgResearchCalls_ItemDataBound_1(object sender, System.Web.UI.
WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.
AlternatingItem)
{
e.Item.Cells[0].Text = "<a tabindex='-1' class='" + e.Item.CssClass +
"'href='../AppPages/AddEditCustomer.Aspx?CustomerID=" + e.Item.Cells[0].Text
+ "'><img style='cursor:hand' border=0 alt='Edit Company' src=..
/images/edit_icon.gif></a>";
e.Item.Cells[1].Text = e.Item.Cells[1].Text.ToString();
e.Item.Cells[2].Text= e.Item.Cells[2].Text.ToString();
DropDownList ddlst=(DropDownList)e.Item.Cells[3].FindControl("ddlstContact2")
;
ddlst.DataSource=DataHelper.GetddlstContacts();
ddlst.DataTextField="ContactName";
ddlst.DataValueField="ContactName";
ddlst.DataBind();
e.Item.Cells[4].Text = e.Item.Cells[4].Text.ToString();
e.Item.Cells[5].Text=e.Item.Cells[5].Text.ToString();
e.Item.Cells[6].Text=e.Item.Cells[6].Text.ToString();
}
}
this is my code...........
advanced thanks for all