Ejemplo n.º 1
0
 /// <summary>
 /// Model-Independent function
 /// </summary>
 /// <param name="htmlHelper">MVC Html helper class that is being extended</param>
 /// <param name="listName">Name of each checkbox in a list (use this name to POST list values array back to the controller)</param>
 /// <param name="dataList">List of name/value pairs to be used as source data for the list</param>
 /// <param name="htmlAttributes">Each checkbox HTML tag attributes (e.g. 'new { class="somename" }')</param>
 /// <param name="disabledValues">String array of values to disable</param>
 /// <param name="position">Direction of the list (e.g. 'Position2.Horizontal' or 'Position2.Vertical')</param>
 /// <returns>HTML string containing checkbox list</returns>
 public static MvcHtmlString CheckBoxList
     (this HtmlHelper htmlHelper, string listName, List<SelectListItem> dataList,
      object htmlAttributes, string[] disabledValues, Position position = Position.Horizontal)
 {
     return htmlHelper.CheckBoxList
         (listName, dataList, htmlAttributes, null, disabledValues, position);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Model-Independent function
 /// </summary>
 /// <param name="htmlHelper">MVC Html helper class that is being extended</param>
 /// <param name="listName">Name of each checkbox in a list (use this name to POST list values array back to the controller)</param>
 /// <param name="dataList">List of name/value pairs to be used as source data for the list</param>
 /// <param name="wrapInfo">Settings for HTML wrapper of the list (e.g. 'new HtmlListInfo2(HtmlTag2.vertical_columns, 2, new { style="color:green;" })')</param>
 /// <param name="disabledValues">String array of values to disable</param>
 /// <returns>HTML string containing checkbox list</returns>
 public static MvcHtmlString CheckBoxList
     (this HtmlHelper htmlHelper, string listName, List<SelectListItem> dataList,
      HtmlListInfo wrapInfo, string[] disabledValues)
 {
     return htmlHelper.CheckBoxList
         (listName, dataList, null, wrapInfo, disabledValues);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Model-Independent function
 /// </summary>
 /// <param name="htmlHelper">MVC Html helper class that is being extended</param>
 /// <param name="listName">Name of each checkbox in a list (use this name to POST list values array back to the controller)</param>
 /// <param name="dataList">List of name/value pairs to be used as source data for the list</param>
 /// <param name="position">Direction of the list (e.g. 'Position2.Horizontal' or 'Position2.Vertical')</param>
 /// <returns>HTML string containing checkbox list</returns>	
 public static MvcHtmlString CheckBoxList
     (this HtmlHelper htmlHelper, string listName, List<SelectListItem> dataList,
      Position position = Position.Horizontal)
 {
     return htmlHelper.CheckBoxList
         (listName, dataList, null, null, null, position);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// CheckBoxList.
        /// </summary>
        /// <param name="htmlHelper">The HTML helper.</param>
        /// <param name="name">The name.</param>
        /// <param name="listInfo">SelectListItem.</param>
        /// <returns></returns>
        public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper,

            string name,

            IEnumerable<SelectListItem> listInfo)
        {
            return htmlHelper.CheckBoxList(name, listInfo, (IDictionary<string, object>)null, 0);
        }
 /// <summary>
 /// CheckBoxList.
 /// </summary>
 /// <param name="htmlHelper">The HTML helper.</param>
 /// <param name="name">The name.</param>
 /// <param name="listInfo">SelectListItem.</param>
 /// <param name="htmlAttributes">The HTML attributes.</param>
 /// <returns></returns>
 public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper,
     string name,
     IEnumerable<SelectListItem> listInfo,
     object htmlAttributes)
 {
     return htmlHelper.CheckBoxList(
         name,
         listInfo,
         (IDictionary<string, object>)new RouteValueDictionary(htmlAttributes),
         0);
 }
Ejemplo n.º 6
0
 public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper, string name, MultiSelectList listInfo, object htmlAttributes)
 {
     return htmlHelper.CheckBoxList(name, listInfo, ((IDictionary<string, object>)new RouteValueDictionary(htmlAttributes)));
 }
Ejemplo n.º 7
0
 public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper, string name, MultiSelectList listInfo)
 {
     return htmlHelper.CheckBoxList(name, listInfo, ((IDictionary<string, object>)null));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Checks the box list.
 /// </summary>
 /// <param name="htmlHelper">The HTML helper.</param>
 /// <param name="name">The named instance.</param>
 /// <param name="listInfo">The list info.</param>
 /// <returns>List of checkbox list items.</returns>
 public static string CheckBoxList(this HtmlHelper htmlHelper, string name, List<CheckBoxListInfo> listInfo)
 {
     return htmlHelper.CheckBoxList(name, listInfo, ((IDictionary<string, object>)null));
 }
 public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper, string name, IEnumerable<SelectListItem> listInfo)
 {
     return htmlHelper.CheckBoxList(name, listInfo, null);
 }
        public static string Control(this Tk5FieldInfoEx field, DataRow dataRow, DataSet dataSet, bool needId = true)
        {
            TkDebug.AssertArgumentNull(field, "field", null);

            ControlType ctrlType = field.InternalControl.SrcControl;
            string result = string.Empty;

            switch (ctrlType)
            {
                case ControlType.TextArea:
                    result = field.Textarea(dataRow, needId);
                    break;
                case ControlType.Combo:
                    result = field.Combo(dataRow, dataSet, needId);
                    break;
                case ControlType.RadioGroup:
                    result = field.RadioGroup(dataRow, dataSet, needId);
                    break;
                case ControlType.CheckBoxList:
                    result = field.CheckBoxList(dataRow, dataSet, needId);
                    break;
                case ControlType.Text:
                case ControlType.Password:
                    result = field.Input(dataRow, needId);
                    break;
                case ControlType.CheckBox:
                    result = field.Switcher(dataRow, needId);
                    break;
                case ControlType.Date:
                    result = field.Date(dataRow, needId);
                    break;
                case ControlType.DateTime:
                    result = field.DateTime(dataRow, needId);
                    break;
                case ControlType.Time:
                    result = field.Time(dataRow, needId);
                    break;
                case ControlType.EasySearch:
                    result = field.EasySearch(dataRow, needId);
                    break;
                case ControlType.MultipleEasySearch:
                    result = field.MultipleEasySearch(dataRow, needId);
                    break;
                case ControlType.Label:
                    result = field.Detail(dataRow, true, needId);
                    break;
                case ControlType.RichText:
                    result = field.RichText(dataRow, needId);
                    break;
                case ControlType.Upload:
                    result = field.Upload(dataRow, needId);
                    break;
            }
            return result;
        }
Ejemplo n.º 11
0
 public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper, string listName, List<SelectListItem> dataList, object htmlAttributes, Position position = 0)
 {
     return htmlHelper.CheckBoxList(listName, dataList, htmlAttributes, null, null, position);
 }
Ejemplo n.º 12
0
 public static MvcHtmlString CheckBoxList(this HtmlHelper htmlHelper, string listName, List<SelectListItem> dataList, HtmlListInfo wrapInfo)
 {
     return htmlHelper.CheckBoxList(listName, dataList, null, wrapInfo, null, Position.Horizontal);
 }
Ejemplo n.º 13
0
 /// <summary>
 ///  renders the checkboxlist
 /// </summary>
 /// <param name="htmlHelper"></param>
 /// <param name="name"> name of the checkboxlist</param>
 /// <param name="listInfo">object with value of ID, checked status and InnerHtml </param>
 /// <param name="htmlAttributes">other style attributes </param>
 /// <returns>string containg checkboxlist tags </returns>
 public static string CheckBoxList(this HtmlHelper<DomainModel.Entities.User> htmlHelper, string name, List<details> listInfo, object htmlAttributes)
 {
     return htmlHelper.CheckBoxList(name, listInfo,
         ((IDictionary<string, object>)new RouteValueDictionary(htmlAttributes)));
 }
Ejemplo n.º 14
0
 /// <summary>
 /// renders the checkboxlist
 /// </summary>
 /// <param name="name"> name of the checkboxlist</param>
 /// <param name="listInfo">object with value of ID, checked status and InnerHtml </param>
 /// <param name="htmlAttributes">other style attributes </param>
 /// <returns>string containg checkboxlist tags </returns>
 public static string CheckBoxList(this HtmlHelper<DomainModel.Entities.User> htmlHelper, string name, List<details> listInfo)
 {
     return htmlHelper.CheckBoxList(name, listInfo,
         ((IDictionary<string, object>)null));
 }
Ejemplo n.º 15
0
 public static string CheckBoxList(this HtmlHelper htmlHelper, string name, CheckValues values)
 {
     return htmlHelper.CheckBoxList(name, values, new RouteValueDictionary());
 }