Example #1
0
    /// <summary>
    /// Reloads the site groups.
    /// </summary>
    /// <param name="siteName">Name of the site</param>
    private void LoadSiteGroups(string siteName)
    {
        if (communityLoaded && mediaLoaded && !(drpGroups.Items.Count > 0))
        {
            drpGroups.Items.Clear();

            if (siteName != null)
            {
                DataSet dsGroups = ModuleCommands.CommunityGetSiteGroups(siteName);
                if (!DataHelper.DataSourceIsEmpty(dsGroups))
                {
                    dsGroups.Tables[0].DefaultView.Sort = "GroupDisplayName";
                    drpGroups.DataValueField            = "GroupName";
                    drpGroups.DataTextField             = "GroupDisplayName";
                    drpGroups.DataSource = dsGroups.Tables[0].DefaultView;
                    drpGroups.DataBind();
                }
            }
            drpGroups.Items.Insert(0, new ListItem(GetString("general.selectall"), ""));
            drpGroups.Items.Insert(1, new ListItem(GetString("general.selectnone"), "#none#"));
            drpGroups.Items.Insert(2, new ListItem(GetString("dialogs.config.currentgroup"), "#current#"));
        }
    }