Wednesday, March 25, 2009

HOW TO BIND DROPDOWN LIST & ADD NEW VALUE

clsItemGroupMast_CDO ItemGroupMast_CDO = new clsItemGroupMast_CDO();
clsItemGroupMast_DA ItemGroupMast_DA = new clsItemGroupMast_DA();
DataSet ds = new DataSet();

ds = ItemGroupMast_DA.View_ItemGroupMast(ItemGroupMast_CDO);
ddlProductGroup .DataSource = ds;
ddlProductGroup.DataTextField = "GroupName";
ddlProductGroup.DataValueField = "GroupId";
ddlProductGroup.DataBind();
ddlProductGroup.Items.Add("--Select--");
ddlProductGroup.Items.FindByText("--Select--").Value = "0";
ddlProductGroup.SelectedIndex = -1

No comments:

ShareThis

Welcome

Welcome to Rajesh Prajapati, asp.net blog.
Here you can find some useful code and information about asp.net., c#, VB.net, SQL Server, Web Service, Web Designing etc