private void LoadOwnerGroupList(int workflowId)
    {
        var wfOwnerGroups = new ENTWFOwnerGroupEOList();

        wfOwnerGroups.Load(workflowId);

        ddlWFOwnerGroup.DataSource     = wfOwnerGroups;
        ddlWFOwnerGroup.DataTextField  = "DisplayText";
        ddlWFOwnerGroup.DataValueField = "ID";
        ddlWFOwnerGroup.DataBind();

        ddlWFOwnerGroup.Items.Insert(0, new ListItem("", "0"));
    }
        private void CreateWFGroupOwnersTable()
        {
            var tr1 = new HtmlTableRow();
            var tc1 = new HtmlTableCell();

            tc1.Attributes.Add("class", "gridViewHeader");
            tc1.ColSpan   = 2;
            tc1.InnerText = "Users";
            tr1.Cells.Add(tc1);
            tblWFUserGroups.Rows.Add(tr1);

            //Get the workflow associated with this object.
            Workflow = new ENTWorkflowEO();
            Workflow.LoadByObjectName(WorkflowObjectName);

            //Get the groups associated with this workflow
            var entWFOwnerGroups = new ENTWFOwnerGroupEOList();

            entWFOwnerGroups.Load(Workflow.ID);

            //Create the table for all the owner groups
            foreach (var wfOwnerGroup in entWFOwnerGroups)
            {
                var tr     = new HtmlTableRow();
                var tcName = new HtmlTableCell();
                tcName.InnerText = wfOwnerGroup.OwnerGroupName + ":";
                tcName.Attributes.Add("ENTWFOwnerGroupId", wfOwnerGroup.ID.ToString());
                tr.Cells.Add(tcName);

                var tcUsers  = new HtmlTableCell();
                var ddlUsers = new DropDownList();
                ddlUsers.DataSource     = wfOwnerGroup.UserAccounts;
                ddlUsers.DataTextField  = "UserName";
                ddlUsers.DataValueField = "ENTUserAccountId";
                ddlUsers.DataBind();
                ddlUsers.Items.Insert(0, new ListItem("", "0"));
                tcUsers.Controls.Add(ddlUsers);
                tr.Cells.Add(tcUsers);
                tblWFUserGroups.Rows.Add(tr);
            }
            Controls.Add(tblWFUserGroups);
        }