DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Bind Dropwdown In Gridview

  • submit to reddit
        // Bind dropwdown in gridview

protected void GvTestGrid_RowDataBound(object sender, GridViewRowEventArgs e)
        if (e.Row.RowType == DataControlRowType.DataRow)
            DataTable dtData= new DataTable();
            dtData= GetData(); // Get your data to be binded to dropdown
            DropDownList ddlFileData= (DropDownList)e.Row.FindControl("DdlFileData");
            ddlFileData.Datasource = dtData;