Пример #1
0
        private void DefineDGStructure()
        {
            int       ObjectTypeId = int.Parse(pc["GlobalSubscription_ObjectType"]);
            DataTable source       = SystemEvents.GetGlobalSubscriptionsDT(ObjectTypeId);

            // Data Grid definition
            grdMain.Columns.Clear();

            BoundColumn idCol = new BoundColumn();

            idCol.DataField = "EventTypeId";
            idCol.Visible   = false;
            grdMain.Columns.Add(idCol);

            BoundColumn titleCol = new BoundColumn();

            titleCol.DataField            = "Title";
            titleCol.HeaderStyle.CssClass = "ibn-vh2";
            titleCol.ItemStyle.CssClass   = "ibn-vb2";
            titleCol.HeaderText           = LocRM.GetString("SystemEvent");
            grdMain.Columns.Add(titleCol);

            foreach (DataColumn roleCol in source.Columns)
            {
                if (!roleCol.ColumnName.ToLower().StartsWith("role_"))
                {
                    continue;
                }

                TemplateColumn checkBoxCol = new TemplateColumn();
                checkBoxCol.HeaderStyle.Width    = Unit.Pixel(75);
                checkBoxCol.ItemStyle.Width      = Unit.Pixel(75);
                checkBoxCol.ItemTemplate         = new DataGridCheckBoxTemplate(roleCol.ColumnName);
                checkBoxCol.HeaderStyle.CssClass = "ibn-vh2";
                checkBoxCol.ItemStyle.CssClass   = "ibn-vb2";
                checkBoxCol.HeaderText           = LocRM.GetString(roleCol.ColumnName);
                grdMain.Columns.Add(checkBoxCol);
            }
            BindData(source);
        }
Пример #2
0
        private void btnCancel_ServerClick(object sender, EventArgs e)
        {
            int ObjectTypeId = int.Parse(pc["GlobalSubscription_ObjectType"]);

            BindData(SystemEvents.GetGlobalSubscriptionsDT(ObjectTypeId));
        }