Esempio n. 1
0
        public static void AddDropDownList(HtmlTable t, string columnName, bool isNullable, string tableSchema, string tableName, string tableColumn, string defaultValue, string displayFields, string displayViews, string selectedValues)
        {
            string label = LocalizationHelper.GetResourceString("FormResource", columnName);

            DropDownList dropDownList = GetDropDownList(columnName + "_dropdownlist");

            HtmlAnchor itemSelectorAnchor;

            using (System.Data.DataTable table = MixERP.Net.BusinessLayer.Helpers.FormHelper.GetTable(tableSchema, tableName))
            {
                SetDisplayFields(dropDownList, table, tableSchema, tableName, tableColumn, displayFields);
                itemSelectorAnchor = GetItemSelector(dropDownList.ClientID, table, tableSchema, tableName, tableColumn, displayViews);
            }

            SetSelectedValue(dropDownList, tableSchema, tableName, tableColumn, defaultValue, selectedValues);

            if (isNullable)
            {
                dropDownList.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                ScrudFactoryHelper.AddRow(t, label, dropDownList, itemSelectorAnchor);
            }
            else
            {
                RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(dropDownList);
                ScrudFactoryHelper.AddRow(t, label + Resources.ScrudResource.RequiredFieldIndicator, dropDownList, required, itemSelectorAnchor);
            }
        }
Esempio n. 2
0
        public static void AddNumberTextBox(HtmlTable t, string columnName, string defaultValue, bool isSerial, bool isNullable, int maxLength, string domain)
        {
            TextBox textBox = GetNumberTextBox(columnName + "_textbox", maxLength);
            string  label   = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName);

            if (!defaultValue.StartsWith("nextVal", StringComparison.OrdinalIgnoreCase))
            {
                textBox.Text = defaultValue;
            }

            textBox.Width = 200;

            if (isSerial)
            {
                textBox.ReadOnly = true;
            }
            else
            {
                if (!isNullable)
                {
                    CompareValidator       validator = GetNumberValidator(textBox, domain);
                    RequiredFieldValidator required  = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                    ScrudFactoryHelper.AddRow(t, label + Resources.ScrudResource.RequiredFieldIndicator, textBox, validator, required);
                    return;
                }
            }

            ScrudFactoryHelper.AddRow(t, label, textBox);
        }
Esempio n. 3
0
        public static void AddDateTextBox(HtmlTable t, string columnName, string defaultValue, bool isNullable, int maxLength)
        {
            string label = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName);

            TextBox textBox = ScrudTextBox.GetTextBox(columnName + "_textbox", maxLength);

            textBox.CssClass = "date";

            CompareValidator validator = GetDateValidator(textBox);

            AjaxControlToolkit.CalendarExtender extender = new AjaxControlToolkit.CalendarExtender();

            textBox.Width            = 70;
            extender.ID              = textBox.ID + "_calendar_extender";
            extender.TargetControlID = textBox.ID;
            extender.PopupButtonID   = textBox.ID;

            if (!string.IsNullOrWhiteSpace(defaultValue))
            {
                textBox.Text = MixERP.Net.Common.Conversion.TryCastDate(defaultValue).ToShortDateString();
            }


            if (!isNullable)
            {
                RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                ScrudFactoryHelper.AddRow(t, label + Resources.ScrudResource.RequiredFieldIndicator, textBox, validator, required, extender);
                return;
            }

            ScrudFactoryHelper.AddRow(t, label, textBox, validator, extender);
        }
Esempio n. 4
0
        internal static void AddDecimalTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string label, string description,
                                               string defaultValue, bool isNullable, int maxLength, string domain, string errorCssClass, bool disabled)
        {
            using (TextBox textBox = ScrudTextBox.GetTextBox(columnName + "_textbox", maxLength))
            {
                if (string.IsNullOrWhiteSpace(label))
                {
                    label = ScrudLocalizationHelper.GetResourceString(resourceClassName, columnName);
                }

                using (CompareValidator validator = GetDecimalValidator(textBox, domain, errorCssClass))
                {
                    textBox.Text     = defaultValue;
                    textBox.ReadOnly = disabled;
                    textBox.CssClass = "decimal";

                    if (!string.IsNullOrWhiteSpace(description))
                    {
                        textBox.CssClass += " activating element";
                        textBox.Attributes.Add("data-content", description);
                    }

                    if (!isNullable)
                    {
                        RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox,
                                                                                                       errorCssClass);
                        ScrudFactoryHelper.AddRow(htmlTable, label + Labels.RequiredFieldIndicator, textBox, validator,
                                                  required);
                        return;
                    }

                    ScrudFactoryHelper.AddRow(htmlTable, label, textBox, validator);
                }
            }
        }
Esempio n. 5
0
        public static void AddTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string defaultValue, bool isNullable, int maxLength)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            using (var textBox = GetTextBox(columnName + "_textbox", maxLength))
            {
                var label = LocalizationHelper.GetResourceString(resourceClassName, columnName);

                textBox.Text = defaultValue;

                if (!isNullable)
                {
                    var required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                    ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, textBox, required);
                    return;
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, textBox);
            }
        }
Esempio n. 6
0
        public static void AddDropDownList(HtmlTable htmlTable, string resourceClassName, string itemSelectorPath, string columnName, bool isNullable, string tableSchema, string tableName, string tableColumn, string defaultValue, string displayFields, string displayViews, bool useDisplayViewsAsParent, string selectedValues)
        {
            var label = LocalizationHelper.GetResourceString(resourceClassName, columnName);

            var dropDownList = GetDropDownList(columnName + "_dropdownlist");

            HtmlAnchor itemSelectorAnchor;

            using (var table = GetTable(tableSchema, tableName, tableColumn, displayViews, useDisplayViewsAsParent))
            {
                SetDisplayFields(dropDownList, table, tableSchema, tableName, tableColumn, displayFields);
                itemSelectorAnchor = GetItemSelector(dropDownList.ClientID, table, itemSelectorPath, tableSchema, tableName, tableColumn, displayViews);
            }

            SetSelectedValue(dropDownList, tableSchema, tableName, tableColumn, defaultValue, selectedValues);

            if (isNullable)
            {
                dropDownList.Items.Insert(0, new ListItem(String.Empty, String.Empty));
                ScrudFactoryHelper.AddRow(htmlTable, label, dropDownList, itemSelectorAnchor);
            }
            else
            {
                var required = ScrudFactoryHelper.GetRequiredFieldValidator(dropDownList);
                ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, dropDownList, required, itemSelectorAnchor);
            }
        }
Esempio n. 7
0
        internal static void AddRadioButtonList(HtmlTable htmlTable, string resourceClassName, string columnName, bool isNullable, string keys, string values, string selectedValue, string errorCssClass, Assembly assembly, bool disabled)
        {
            if (htmlTable == null)
            {
                return;
            }

            using (RadioButtonList radioButtonList = GetRadioButtonList(columnName + "_radiobuttonlist", keys, values, selectedValue))
            {
                string label = ScrudLocalizationHelper.GetResourceString(assembly, resourceClassName, columnName);

                radioButtonList.Enabled = !disabled;

                if (!isNullable)
                {
                    using (RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(radioButtonList, errorCssClass))
                    {
                        ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, radioButtonList, required);
                        return;
                    }
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, radioButtonList);
            }
        }
Esempio n. 8
0
        internal static void AddTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string dataType, string defaultValue, bool isNullable, int maxLength, string errorCssClass, Assembly assembly, bool disabled)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            bool isPasswordField = columnName.ToUpperInvariant().Equals("PASSWORD");

            if (isPasswordField && disabled)
            {
                defaultValue = "fake-password";
            }

            using (TextBox textBox = GetTextBox(columnName + "_textbox", maxLength))
            {
                string label = ScrudLocalizationHelper.GetResourceString(assembly, resourceClassName, columnName);


                if (dataType.ToUpperInvariant().Equals("COLOR"))
                {
                    textBox.CssClass = "color";
                }

                if (isPasswordField)
                {
                    textBox.Attributes.Add("type", "password");
                }

                if (disabled && !isPasswordField)
                {
                    textBox.ReadOnly = true;
                }

                textBox.Text = defaultValue;


                if (!isNullable)
                {
                    using (RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox, errorCssClass))
                    {
                        ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, textBox, required);
                        return;
                    }
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, textBox);
            }
        }
Esempio n. 9
0
        internal static void AddDateTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string label, string description,
                                            string defaultValue, bool isNullable, string validatorCssClass, bool disabled)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            string id = columnName + "_textbox";

            using (TextBox textBox = ScrudTextBox.GetTextBox(id, 100))
            {
                jQueryUI.AddjQueryUIDatePicker(null, id, null, null);

                if (string.IsNullOrWhiteSpace(label))
                {
                    label = ScrudLocalizationHelper.GetResourceString(resourceClassName, columnName);
                }

                textBox.Text     = GetLocalizedDate(defaultValue);
                textBox.ReadOnly = disabled;
                textBox.CssClass = "date";

                if (!string.IsNullOrWhiteSpace(description))
                {
                    textBox.CssClass += " activating element";
                    textBox.Attributes.Add("data-content", description);
                }

                using (CompareValidator dateValidator = GetDateValidator(textBox, validatorCssClass))
                {
                    if (!isNullable)
                    {
                        using (
                            RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox,
                                                                                                           validatorCssClass))
                        {
                            ScrudFactoryHelper.AddRow(htmlTable, label + Labels.RequiredFieldIndicator, textBox,
                                                      dateValidator, required);
                            return;
                        }
                    }

                    ScrudFactoryHelper.AddRow(htmlTable, label, textBox, dateValidator);
                }
            }
        }
Esempio n. 10
0
        public static void AddCheckBoxList(HtmlTable htmlTable, string resourceClassName, string columnName, bool isNullable, string keys, string values, string selectedValues)
        {
            var checkBoxList = GetCheckBoxList(columnName + "_radiobuttonlist", keys, values, selectedValues);
            var label        = LocalizationHelper.GetResourceString(resourceClassName, columnName);

            if (!isNullable)
            {
                var required = ScrudFactoryHelper.GetRequiredFieldValidator(checkBoxList);
                ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, checkBoxList, required);
                return;
            }

            ScrudFactoryHelper.AddRow(htmlTable, label, checkBoxList);
        }
Esempio n. 11
0
        public static void AddCheckBoxList(HtmlTable t, string columnName, bool isNullable, string keys, string values, string selectedValues)
        {
            CheckBoxList checkBoxList = GetCheckBoxList(columnName + "_radiobuttonlist", keys, values, selectedValues);
            string       label        = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName);

            if (!isNullable)
            {
                RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(checkBoxList);
                ScrudFactoryHelper.AddRow(t, label + Resources.ScrudResource.RequiredFieldIndicator, checkBoxList, required);
                return;
            }

            ScrudFactoryHelper.AddRow(t, label, checkBoxList);
        }
Esempio n. 12
0
        internal static void AddNumberTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string defaultValue, bool isSerial, bool isNullable, int maxLength, string domain, string errorCssClass, Assembly assembly, bool disabled)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            using (TextBox textBox = ScrudTextBox.GetTextBox(columnName + "_textbox", maxLength))
            {
                using (CompareValidator numberValidator = GetNumberValidator(textBox, domain, errorCssClass))
                {
                    string label = ScrudLocalizationHelper.GetResourceString(assembly, resourceClassName, columnName);

                    if (!string.IsNullOrWhiteSpace(defaultValue))
                    {
                        if (!defaultValue.StartsWith("nextVal", StringComparison.OrdinalIgnoreCase))
                        {
                            textBox.Text = defaultValue;
                        }
                    }

                    textBox.ReadOnly = disabled;

                    if (isSerial)
                    {
                        textBox.ReadOnly = true;
                    }
                    else
                    {
                        if (!isNullable)
                        {
                            using (RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox, errorCssClass))
                            {
                                ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, textBox, numberValidator, required);
                                return;
                            }
                        }
                    }

                    ScrudFactoryHelper.AddRow(htmlTable, label, textBox, numberValidator);
                }
            }
        }
Esempio n. 13
0
        public static void AddTextBox(HtmlTable t, string columnName, string defaultValue, bool isNullable, int maxLength)
        {
            TextBox textBox = GetTextBox(columnName + "_textbox", maxLength);
            string  label   = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName);

            textBox.Text = defaultValue;

            if (!isNullable)
            {
                RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                ScrudFactoryHelper.AddRow(t, label + Resources.ScrudResource.RequiredFieldIndicator, textBox, required);
                return;
            }

            ScrudFactoryHelper.AddRow(t, label, textBox);
        }
Esempio n. 14
0
        public static void AddDecimalTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string defaultValue, bool isNullable, int maxLength, string domain)
        {
            var textBox = ScrudTextBox.GetTextBox(columnName + "_textbox", maxLength);
            var label   = LocalizationHelper.GetResourceString(resourceClassName, columnName);

            var validator = GetDecimalValidator(textBox, domain);

            textBox.Text = defaultValue;

            if (!isNullable)
            {
                var required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, textBox, validator, required);
                return;
            }

            ScrudFactoryHelper.AddRow(htmlTable, label, textBox, validator);
        }
Esempio n. 15
0
        public static void AddFileUpload(HtmlTable htmlTable, string resourceClassName, string columnName, bool isNullable)
        {
            var label      = LocalizationHelper.GetResourceString(resourceClassName, columnName);
            var fileUpload = GetFileUpload(columnName + "_fileupload");
            var validator  = GetImageValidator(fileUpload);

            //Todo: One of the following:
            //1. Ask the script manager to do a synchronous postback on save button click event.
            //2. Implement a handler to upload image using AJAX.

            if (!isNullable)
            {
                var required = ScrudFactoryHelper.GetRequiredFieldValidator(fileUpload);
                ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, fileUpload, required, validator);
                return;
            }

            ScrudFactoryHelper.AddRow(htmlTable, label, fileUpload, validator);
        }
Esempio n. 16
0
        public static void AddFileUpload(HtmlTable t, string columnName, bool isNullable)
        {
            string     label      = MixERP.Net.Common.Helpers.LocalizationHelper.GetResourceString("FormResource", columnName);
            FileUpload fileUpload = GetFileUpload(columnName + "_fileupload");
            RegularExpressionValidator validator = GetImageValidator(fileUpload);

            //Todo: One of the following:
            //1. Ask the script manager to do a synchronous postback on save button click event.
            //2. Implement a handler to upload image using AJAX.

            if (!isNullable)
            {
                RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(fileUpload);
                ScrudFactoryHelper.AddRow(t, label + Resources.ScrudResource.RequiredFieldIndicator, fileUpload, required, validator);
                return;
            }

            ScrudFactoryHelper.AddRow(t, label, fileUpload, validator);
        }
Esempio n. 17
0
        public static void AddNumberTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string defaultValue, bool isSerial, bool isNullable, int maxLength, string domain)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            var textBox         = GetNumberTextBox(columnName + "_textbox", maxLength);
            var numberValidator = GetNumberValidator(textBox, domain);
            var label           = LocalizationHelper.GetResourceString(resourceClassName, columnName);

            if (!string.IsNullOrWhiteSpace(defaultValue))
            {
                if (!defaultValue.StartsWith("nextVal", StringComparison.OrdinalIgnoreCase))
                {
                    textBox.Text = defaultValue;
                }
            }

            textBox.Width = 200;

            if (isSerial)
            {
                textBox.ReadOnly = true;
            }
            else
            {
                if (!isNullable)
                {
                    var required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox);
                    ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, textBox, numberValidator, required);
                    return;
                }
            }

            ScrudFactoryHelper.AddRow(htmlTable, label, textBox, numberValidator);
        }
Esempio n. 18
0
        public static void AddFileUpload(HtmlTable htmlTable, string resourceClassName, string columnName, bool isNullable, string errorCssClass, Assembly assembly)
        {
            string     label      = ScrudLocalizationHelper.GetResourceString(assembly, resourceClassName, columnName);
            FileUpload fileUpload = GetFileUpload(columnName + "_fileupload");
            RegularExpressionValidator validator = GetImageValidator(fileUpload, errorCssClass);

            //Todo: One of the following:
            //1. Ask the script manager to do a synchronous postback on save button click event.
            //2. Implement a handler to upload image using AJAX.

            if (!isNullable)
            {
                RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(fileUpload, errorCssClass);
                ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, fileUpload, required,
                                          validator);
                return;
            }

            ScrudFactoryHelper.AddRow(htmlTable, label, fileUpload, validator);
        }
Esempio n. 19
0
        public static void AddDateTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string defaultValue, bool isNullable)
        {
            var label = LocalizationHelper.GetResourceString(resourceClassName, columnName);

            var textBox = GetDateTextBox(columnName + "_textbox", !isNullable);

            textBox.CssClass = "date";

            if (!string.IsNullOrWhiteSpace(defaultValue))
            {
                textBox.Text = Conversion.TryCastDate(defaultValue).ToShortDateString();
            }


            if (!isNullable)
            {
                ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, textBox);
                return;
            }

            ScrudFactoryHelper.AddRow(htmlTable, label, textBox);
        }
Esempio n. 20
0
        internal static void AddDecimalTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string defaultValue, bool isNullable, int maxLength, string domain, string errorCssClass, Assembly assembly, bool disabled)
        {
            using (TextBox textBox = ScrudTextBox.GetTextBox(columnName + "_textbox", maxLength))
            {
                string label = ScrudLocalizationHelper.GetResourceString(assembly, resourceClassName, columnName);

                using (CompareValidator validator = GetDecimalValidator(textBox, domain, errorCssClass))
                {
                    textBox.Text     = defaultValue;
                    textBox.ReadOnly = disabled;

                    if (!isNullable)
                    {
                        RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox, errorCssClass);
                        ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, textBox, validator, required);
                        return;
                    }

                    ScrudFactoryHelper.AddRow(htmlTable, label, textBox, validator);
                }
            }
        }
Esempio n. 21
0
        internal static void AddDateTextBox(HtmlTable htmlTable, string resourceClassName, string columnName, string defaultValue, bool isNullable, string validatorCssClass, Assembly assembly, bool disabled)
        {
            if (htmlTable == null)
            {
                return;
            }

            if (string.IsNullOrWhiteSpace(columnName))
            {
                return;
            }

            string id = columnName + "_textbox";

            using (TextBox textBox = ScrudTextBox.GetTextBox(id, 100))
            {
                Net.Common.jQueryHelper.jQueryUI.AddjQueryUIDatePicker(null, id, null, null);

                string label = ScrudLocalizationHelper.GetResourceString(assembly, resourceClassName, columnName);

                textBox.Text     = GetLocalizedDate(defaultValue);
                textBox.ReadOnly = disabled;
                textBox.CssClass = "date";

                using (CompareValidator dateValidator = GetDateValidator(textBox, validatorCssClass))
                {
                    if (!isNullable)
                    {
                        using (RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(textBox, validatorCssClass))
                        {
                            ScrudFactoryHelper.AddRow(htmlTable, label + Titles.RequiredFieldIndicator, textBox, dateValidator, required);
                            return;
                        }
                    }

                    ScrudFactoryHelper.AddRow(htmlTable, label, textBox, dateValidator);
                }
            }
        }
Esempio n. 22
0
        internal static void AddRadioButtonList(HtmlTable htmlTable, string resourceClassName, string columnName, string label, string description,
                                                bool isNullable, string keys, string values, string selectedValue, string errorCssClass, bool disabled)
        {
            if (htmlTable == null)
            {
                return;
            }

            using (RadioButtonList radioButtonList = GetRadioButtonList(columnName + "_radiobuttonlist", keys, values, selectedValue))
            {
                if (!string.IsNullOrWhiteSpace(description))
                {
                    radioButtonList.CssClass += " activating element";
                    radioButtonList.Attributes.Add("data-content", description);
                }

                if (string.IsNullOrWhiteSpace(label))
                {
                    label = ScrudLocalizationHelper.GetResourceString(resourceClassName, columnName);
                }

                radioButtonList.Enabled = !disabled;

                if (!isNullable)
                {
                    using (
                        RequiredFieldValidator required = ScrudFactoryHelper.GetRequiredFieldValidator(radioButtonList,
                                                                                                       errorCssClass))
                    {
                        ScrudFactoryHelper.AddRow(htmlTable, label + Labels.RequiredFieldIndicator, radioButtonList,
                                                  required);
                        return;
                    }
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, radioButtonList);
            }
        }
Esempio n. 23
0
        public static void AddRadioButtonList(HtmlTable htmlTable, string resourceClassName, string columnName, bool isNullable, string keys, string values, string selectedValue)
        {
            if (htmlTable == null)
            {
                return;
            }

            using (var radioButtonList = GetRadioButtonList(columnName + "_radiobuttonlist", keys, values, selectedValue))
            {
                var label = LocalizationHelper.GetResourceString(resourceClassName, columnName);

                if (!isNullable)
                {
                    using (var required = ScrudFactoryHelper.GetRequiredFieldValidator(radioButtonList))
                    {
                        ScrudFactoryHelper.AddRow(htmlTable, label + ScrudResource.RequiredFieldIndicator, radioButtonList, required);
                        return;
                    }
                }

                ScrudFactoryHelper.AddRow(htmlTable, label, radioButtonList);
            }
        }