Here i have used Dummy table to create one sample.
HTML
<asp:DropDownList ID="ddlBuilders" runat="server">
</asp:DropDownList>
Namespace
using System.Data;
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dtBuliders = new DataTable();
dtBuliders.Columns.AddRange(new DataColumn[2] { new DataColumn("ID", typeof(int)),
new DataColumn("Name", typeof(string )) });
dtBuliders.Rows.Add(1, "Nancy Davolio");
dtBuliders.Rows.Add(2, "Andrew Fuller");
dtBuliders.Rows.Add(3, "Janet Leverling");
dtBuliders.Rows.Add(4, "Anne Dodsworth");
dtBuliders.Rows.Add(5, "Steven Buchanan");
dtBuliders.Rows.Add(6, "Michael Suyama");
dtBuliders.Rows.Add(7, "Robert King");
dtBuliders.Rows.Add(8, "Laura Callahan");
this.ddlBuilders.DataValueField = "ID";
this.ddlBuilders.DataTextField = "Name";
this.ddlBuilders.DataSource = dtBuliders;
this.ddlBuilders.DataBind();
DataTable dtProjects = new DataTable();
dtProjects.Columns.AddRange(new DataColumn[3] { new DataColumn("ID", typeof(int)),
new DataColumn("BuilderName", typeof(int)),
new DataColumn("ProjectName", typeof(string )) });
dtProjects.Rows.Add(1, 1, "Abc");
dtProjects.Rows.Add(1, 3, "PQR");
dtProjects.Rows.Add(1, 4, "XYZ");
foreach (DataRow row in dtProjects.Rows)
{
this.ddlBuilders.Items.FindByValue(row["BuilderName"].ToString()).Attributes["disabled"] = "disabled";
}
}
}
Screenshot