//In editing the dropdownlist is filling On DataGrid
<asp:TemplateField HeaderText="Business Type">
<EditItemTemplate>
<asp:DropDownList ID="DDLedit" runat="server" ></asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# Bind("username") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
//**Gridview1_RowDataBound
DataSet Ds;
if (e.Row.RowType == DataControlRowType.DataRow)
{
//if (Gridview1.EditIndex == e.Row.RowIndex)
if((e.Row.RowState & DataControlRowState.Edit)>0)
{
DropDownList dx = new DropDownList();
dx = (DropDownList)e.Row.FindControl("DDLedit");
Ds1 = getUserDetails(); //Get username and userid
dx.DataSource = Ds1;
dx.DataTextField = "username";
dx.DataValueField = "userid";
dx.DataBind();
}
Thursday, October 8, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment