Unable to display the data in dropdownlist in datagrid

Discussion in 'ASP .Net Datagrid Control' started by Thiyagarajan Natarajan, Oct 12, 2005.

  1. 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
    Thiyagarajan Natarajan, Oct 12, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mr2_93
    Replies:
    1
    Views:
    3,591
    mr2_93
    Oct 2, 2005
  2. Gerd B.
    Replies:
    0
    Views:
    158
    Gerd B.
    Sep 11, 2003
  3. Replies:
    0
    Views:
    198
  4. HartSA

    Unable to Display Data

    HartSA, Jan 8, 2005, in forum: ASP General
    Replies:
    6
    Views:
    153
    Morris
    Jan 10, 2005
  5. Jake Barnes
    Replies:
    6
    Views:
    386
    9.co.uk
    Feb 8, 2006
Loading...

Share This Page