开发者

details view with Dropdownn control

开发者 https://www.devze.com 2022-12-11 12:49 出处:网络
in the modal pop upi amusing detailsview controlby default all the datawould beshown in labe开发者_运维百科l.

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

精彩评论

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