コード例 #1
0
        }        //end page_load

        protected void ShowGroupSelect(int userId)
        {
            groupMessage.Text = "";

            GroupDa gda = new GroupDa();

            //get users existing groups
            DataSet uds = gda.GetUserGroupsByUserId(userId);

            rptUserGroups.DataSource = uds.Tables[0].DefaultView;
            rptUserGroups.DataBind();

            if (uds.Tables[0].Rows.Count == 0)
            {
                groupMessage.Text = "No Groups Assigned";
            }

            //get groups
            DataSet gds = gda.GetGroups();

            UserGroup.DataSource     = gds.Tables[0].DefaultView;
            UserGroup.DataValueField = "GroupId";
            UserGroup.DataTextField  = "GroupName";
            UserGroup.DataBind();
            UserGroup.Items.Insert(0, new ListItem(""));

            SelectGroupTable.Visible = true;
        }