开发者

details view with Dropdownn control

in the modal pop up i am using detailsview control by default all the data would be shown in labe开发者_运维百科l. there will be an edit button down once the user clicks edit button all the lablel would be gone and text box and dropdown control should be present so that user can change the values and again update into database

looking forward for a solution. i dnt want to use sqlDatasource. i wanted it to do in .cs thank you


here is how to:

<EditItemTemplate>
    <asp:DropDownList ID="DropDownList1" runat="server" />
</EditItemTemplate>


protected void DetailsView1_DataBound(object sender, EventArgs e)
{

    if (DetailsView1.CurrentMode == DetailsViewMode.Edit)
    {
        DropDownList ddl = DetailsView1.FindControl("DropDownList1") as DropDownList;
        if (ddl != null)
        {

            ddl.DataSource = dataSource;
            ddl.DataBind();

        }
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜