Unable to display the data in dropdownlist in datagrid

  • Thread starter Thiyagarajan Natarajan
  • Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top