Пример #1
0
        public void Init(FlexDesignerHostServices provider, ReportParameter parameter)
        {
            _provider      = provider;
            _parameterName = parameter.Name;
            // _updating = true;

            var values     = parameter.AllowedValuesDefinition.Values;
            var labelIndex = c1FlexGrid1.Cols.Fixed;
            var valueIndex = labelIndex + 1;

            foreach (var value in values)
            {
                var row = c1FlexGrid1.Rows.Add();
                row[labelIndex] = ScriptValueHelper.ToString(value.Label);
                row[valueIndex] = ScriptValueHelper.ToString(value.Value);
            }

            c1FlexGrid1.Col = labelIndex;
            if (values.Count > 0)
            {
                c1FlexGrid1.Row = c1FlexGrid1.Rows.Fixed;
            }

            UpdateButtonsSatus();

            // _updating = false;
        }
Пример #2
0
        public void Init(FlexDesignerHostServices provider, ReportParameterValues parameterValues)
        {
            Debug.Assert(parameterValues != null);

            _provider = provider;
            C1FlexReport anotherReport;

            GetReportParameterValuesEnviroment(parameterValues, out _scriptNamePrefix, out anotherReport);
            _report = parameterValues.Report;

            _updating = true;

            _valueEditor = new ValueEditor(c1FlexGrid1);
            _valueEditor.Init(provider, _report.DataSourceName, "");
            C1ThemeController.ApplyThemeToControlTree(_valueEditor, MainForm.TheMainForm.CachedTheme);
            _nameEditor = new NameEditor(c1FlexGrid1);
            _nameEditor.Init(provider, anotherReport);
            C1ThemeController.ApplyThemeToControlTree(_nameEditor, MainForm.TheMainForm.CachedTheme);

            var labelIndex = c1FlexGrid1.Cols.Fixed;
            var valueIndex = labelIndex + 1;

            foreach (var item in parameterValues)
            {
                var row = c1FlexGrid1.Rows.Add();
                row[labelIndex] = ScriptValueHelper.ToString(item.Name);
                row[valueIndex] = ScriptValueHelper.ToString(item.Value);
            }

            c1FlexGrid1.Col = labelIndex;
            if (parameterValues.Count > 0)
            {
                c1FlexGrid1.Row = c1FlexGrid1.Rows.Fixed;
            }

            UpdateButtonsSatus();

            _updating = false;
        }