This post will illustrate you to create a Checkbox filed in C#. Just call this utility from your code and and pass the checkbox field properties as per requirement. you will get an checkbox filed as a results.
public static CheckBoxField GetCheckBoxField(string pDataTextField, string pHeaderText, bool pVisible, HorizontalAlign pHorizontalAlign, bool pWrapText, bool pSortable)
{
CheckBoxField chkField = new CheckBoxField();
chkField.DataField = pDataTextField;
chkField.SortExpression = (pSortable ? pDataTextField : "");
chkField.HeaderText = pHeaderText;
chkField.Visible = pVisible;
chkField.ItemStyle.HorizontalAlign = pHorizontalAlign;
chkField.ItemStyle.Wrap = pWrapText;
chkField.ReadOnly = false;
return chkField;
}
No comments:
Post a Comment