private void LoadParentFunction() { List <functions> list = objFunction.LoadChildNodes(0, 0); ListItem item1 = new ListItem("---- Root ----", "0"); item1.Attributes.CssStyle.Add("font-weight", "bold"); ddlParent.Items.Add(item1); foreach (functions f in list) { ListItem item = new ListItem(); item.Text = f.FunctionName; item.Value = f.FunctionID.ToString(); if (f.ParentID == 0) { item.Attributes.CssStyle.Add("font-weight", "bold"); } ddlParent.Items.Add(item); } }