public List<HtmlTableCell> BuildCheckbox(string fieldtext, string id, string SkinID, int length, bool isReadOnly, string controlValue) { List<HtmlTableCell> c = new List<HtmlTableCell>(); try { HtmlTableCell cell = new HtmlTableCell(); cell.Attributes.Add("class", "tblFormViewtdLabel"); cell.Style.Add("Width", "20%"); ASPxLabel lb = new ASPxLabel(); lb.Text = fieldtext; cell.Controls.Add(lb); HtmlTableCell celledit = new HtmlTableCell(); celledit.Attributes.Add("class", "tblFormViewtdValue"); celledit.Style.Add("Width", "30%"); ASPxCheckBox cb = new ASPxCheckBox() { SkinID = SkinID, Text = "", ID = id, Checked = true, Width = Unit.Percentage(100), ReadOnly = isReadOnly }; cb.Theme = "DevEx"; cb.AutoPostBack = false; if (controlValue == "1") cb.Checked = true; celledit.Controls.Add(cb); c.Add(cell); c.Add(celledit); cot += 2; } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), Guid.NewGuid().ToString(), "<script> alert('buildCheckbox fieldname" + id + "'); </script>", false); } return c; }
private WebControl CreateCheckBox(Control container) { ASPxCheckBox chk = new ASPxCheckBox(); templateContainer = (GridViewDataItemTemplateContainer)container; chk.ID = string.Format("{0}_{1}", (templateContainer.Column).FieldName, templateContainer.VisibleIndex); chk.ClientInstanceName = string.Format("{0}_{1}", (templateContainer.Column).FieldName, templateContainer.VisibleIndex); chk.Value = templateContainer.Grid.GetRowValues(templateContainer.VisibleIndex, (templateContainer.Column).FieldName).ToString(); object clientevent = SqlHelper.ExecuteScalar( DataServices.ConnectString, "SY_modulefields_getClientevent", _moduleID, _tableName, (templateContainer.Column).FieldName); if (clientevent != null) { Dictionary<string, string> valueclientevent = JsonConvert.DeserializeObject<Dictionary<string, string>>(clientevent.ToString()); if (valueclientevent != null) { chk.ClientSideEvents.CheckedChanged = valueclientevent["checkedchanged"]; chk.ClientSideEvents.GotFocus = valueclientevent["gotfocus"]; chk.ClientSideEvents.Init = valueclientevent["init"]; chk.ClientSideEvents.LostFocus = valueclientevent["lostfocus"]; chk.ClientSideEvents.Validation = valueclientevent["validation"]; chk.ClientSideEvents.ValueChanged = valueclientevent["valuechanged"]; //{"checkedchanged":"","gotfocus":"","init":"","lostfocus":"","validation":"","valuechanged":""} } } return chk; }
public void InstantiateIn(Control container) { ASPxCheckBox checkbox = new ASPxCheckBox(); container.Controls.Add(checkbox); checkbox.ID = this.Id; checkbox.ClientInstanceName = this.ClientName; checkbox.ClientSideEvents.CheckedChanged = "function(s, e) {"+gridView.ClientInstanceName+".PerformCallback('SelectAll'+s.GetChecked());}"; }
protected override WebControl CreateEditModeControlCore() { var placeHolder = new Panel(); controlsHash.Clear(); foreach (object enumValue in enumDescriptor.Values) { if ((int)enumValue != 0) { var checkBox = new ASPxCheckBox(); controlsHash.Add(checkBox, (int)enumValue); checkBox.Text = enumDescriptor.GetCaption(enumValue); checkBox.CheckedChanged += checkBox_CheckedChanged; placeHolder.Controls.Add(checkBox); } } return placeHolder; }
public XafBootstrapErrorInfoControl() : base() { Controls.Add(new HTMLText(@"<div class=""row""><div class=""col-sm-12""><div class=""alert alert-danger alert-dismissible""><button type=""button"" class=""close"" data-dismiss=""alert"" aria-label=""Close""><span aria-hidden=""true"">×</span></button>")); element = new Table(); Controls.Add(element); ErrorImageName = "Error"; checkIgnore = new ASPxCheckBox(); Controls.Add(checkIgnore); checkIgnore.ID = "Ch"; checkIgnore.CheckedChanged += new EventHandler(checkbox_CheckedChanged); checkIgnore.Visible = false; Controls.Add(new HTMLText(@"</div></div></div>")); }
private void CreateControlCheckBoxes() { if (string.IsNullOrEmpty(this.GridID)) throw new NullReferenceException("GridID property is null."); grid = NamingContainer.FindControl(GridID) as ASPxGridView; if (grid == null) throw new InvalidOperationException("ASPxGridView control was not found in NamingContainer."); foreach (GridViewDataColumn column in this.grid.Columns) { ASPxCheckBox columnCheckBox = new ASPxCheckBox(); columnCheckBox.ID = "chb" + column.VisibleIndex.ToString(); ASPxPopupControlDemo.Controls.Add(columnCheckBox); columnCheckBox.AutoPostBack = true; columnCheckBox.Text = column.Caption;//FieldName; columnCheckBox.Checked = column.Visible; columnCheckBox.CheckedChanged += new EventHandler(columnCheckBox_CheckedChanged); } }
public void InstantiateIn(System.Web.UI.Control container) { ASPxCheckBox CheckAll = new ASPxCheckBox(); GridViewHeaderTemplateContainer gridContainer = (GridViewHeaderTemplateContainer)container; CheckAll.ID = "chkAll"; CheckAll.ClientInstanceName = "chkAll"; CheckAll.CssClass = "tourCheckAll"; CheckAll.EnableViewState = false; CheckAll.ToolTip = "Chọn tất cả bản ghi trong trang này"; if (_isgridView) { CheckAll.ClientSideEvents.CheckedChanged += "function(s, e) {" + _gridName + ".SelectAllRowsOnPage(s.GetChecked());}"; } else { CheckAll.ClientSideEvents.CheckedChanged += "function(s, e) {" + _gridName + ".GetGridView().SelectAllRowsOnPage(s.GetChecked());}"; } container.Controls.Add(CheckAll); }
public List<WebControl> RenderControl(XmlNode xmlControl) { base.Initialize(xmlControl); XmlNode valuesNode = _PropertyMapper.GetValuesNode(); foreach (XmlNode xmlValueNode in valuesNode.ChildNodes) { ASPxCheckBox aspxCheckBox= new ASPxCheckBox { ID = "chk" + xmlValueNode.GetAttribute("CCLAVE"), Text = xmlValueNode.GetAttribute("CTEXTO") }; _Controls.Add(aspxCheckBox); } return _Controls; }
protected void grdUsers_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { string strName = grdUsers.GetRowValues(grdUsers.EditingRowVisibleIndex, "UserName").ToString(); MembershipUser newuser = Membership.GetUser(strName); string newemail = e.NewValues["Email"].ToString(); newuser.Email = newemail; GridViewDataColumn dc = grdUsers.Columns["IsApproved"] as GridViewDataColumn; ASPxCheckBox cb = grdUsers.FindEditRowCellTemplateControl(dc, "chkIsApproved") as ASPxCheckBox; newuser.IsApproved = cb.Checked; GridViewDataColumn dc2 = grdUsers.Columns["IsLockeOut"] as GridViewDataColumn; ASPxCheckBox cb2 = grdUsers.FindEditRowCellTemplateControl(dc2, "chkIsLockedout") as ASPxCheckBox; if (newuser.IsLockedOut && !cb2.Checked) { newuser.UnlockUser(); } Membership.UpdateUser(newuser); //Update Branch ID if one is selected string query = "UPDATE aspnet_Users SET BranchID = @BranchID WHERE UserId = @UserId"; List <SqlParameter> sp = new List <SqlParameter>() { new SqlParameter() { ParameterName = "@BranchID", SqlDbType = SqlDbType.Int, Value = e.NewValues["BranchID"] }, new SqlParameter() { ParameterName = "@UserId", SqlDbType = SqlDbType.UniqueIdentifier, Value = new Guid(newuser.ProviderUserKey.ToString()) } }; int aux = DataBase.UpdateDB(sp, query, "ApplicationServices"); e.Cancel = true; grdUsers.CancelEdit(); }
//---------------------------------------------------------总成零件回冲显示维护-------------------------------------------------------- //修改 protected void ASPxGridView3_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxComboBox ljdm = ASPxGridView3.FindEditFormTemplateControl("comboLJDM3") as ASPxComboBox; ASPxCheckBox chHCXSFlag = ASPxGridView3.FindEditFormTemplateControl("chHCFlag") as ASPxCheckBox; string hcFlag = ""; if (chHCXSFlag.Checked == true) { hcFlag = "1"; } else { hcFlag = "0"; } ASPxCheckBox chHCZCFlag = ASPxGridView3.FindEditFormTemplateControl("chHCZCFlag") as ASPxCheckBox; string hcZCFlag = ""; if (chHCZCFlag.Checked == true && chHCXSFlag.Checked == true) { hcZCFlag = "1"; } else { hcZCFlag = "0"; } string Sql = "UPDATE ATPUBOMKZB SET SFHC='" + hcFlag + "', SFZC='" + hcZCFlag + "' " + " WHERE abom_comp = '" + ljdm.Value.ToString() + "'"; dc.ExeSql(Sql); //记录操作start string logSql = "insert into atpubomkzb_log(abom_comp,zdrq,rqbegin,rqend,rqsj,yhmc,czms) " + " select abom_comp,zdrq,rqbegin,rqend,sysdate,'" + theUserName + "','修改了该零件的回冲属性' " + " from atpubomkzb where abom_comp='" + ljdm.Value.ToString() + "' "; dc.ExeSql(logSql); //记录操作end e.Cancel = true; ASPxGridView3.CancelEdit(); setCondition3(); }
private void OnLoad() { int start = 0; int end = 10000; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxLabel id = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "lbl_Id") as ASPxLabel; if (id != null && isPay != null && isPay.Checked) { list.Add(new Record(id.Text)); } else if (id == null) { break; } ; } }
public void InstantiateIn(Control container) { GridViewDataItemTemplateContainer dataItemContainer = container as GridViewDataItemTemplateContainer; ASPxEdit cellEditor; if (dataItemContainer.Column is GridViewDataCheckColumn) { cellEditor = new ASPxCheckBox(); } else { cellEditor = new ASPxTextBox(); } cellEditor.ID = "edDataItem"; dataItemContainer.Controls.Add(cellEditor); cellEditor.Init += new EventHandler(cellEditor_Init); }
private void OnLoad() { int start = 0; int end = count; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox id = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Id"], "txt_Id") as ASPxTextBox; if (id != null && isPay != null && isPay.Checked) { list.Add(new Record(SafeValue.SafeInt(id.Text, 0))); } else if (id == null) { break; } } }
protected void CountNumSelectedRecords(object sender, EventArgs e) { ASPxLabel lblNumSelected = (ASPxLabel)sender; // gvM.FindEditFormLayoutItemTemplateControl("lblNumSelected"); int num = gvM.GetSelectedFieldValues("StudyMeasSubjID").Count(); GridViewEditFormLayoutItemTemplateContainer template = (GridViewEditFormLayoutItemTemplateContainer)lblNumSelected.NamingContainer; ASPxGridView gv = (ASPxGridView)template.Grid; ASPxCheckBox chkall = (ASPxCheckBox)gv.FindControlRecursive("chkUpdateAllSelected"); if (lblNumSelected != null & num > 0) { lblNumSelected.Text = num.ToString() + " records"; chkall.ClientVisible = true; } else { lblNumSelected.Text = ""; chkall.ClientVisible = false; } }
protected void gridPersonDet3_HtmlEditFormCreated(object sender, ASPxGridViewEditFormEventArgs e) { if (this.grid.EditingRowVisibleIndex > -1) { ASPxGridView grd = sender as ASPxGridView; ASPxCheckBox isPayroll = grd.FindEditFormTemplateControl("ckb_IsPayroll") as ASPxCheckBox; bool oldIsPayroll = SafeValue.SafeBool(grid.GetRowValues(this.grid.EditingRowVisibleIndex, new string[] { "IsPayroll" }), false); if (isPayroll != null) { if (oldIsPayroll) { isPayroll.Checked = true; } else { isPayroll.Checked = false; } } } }
protected void grdSitemap_HtmlRowPrepared(object sender, DevExpress.Web.ASPxTreeList.TreeListHtmlRowEventArgs e) { ASPxTreeList treeList = (ASPxTreeList)sender; ASPxCheckBox selectionCheckbox = null; foreach (TableCell cell in e.Row.Cells) { TreeListSelectionCell selectionCell = cell as TreeListSelectionCell; if (selectionCell != null) { selectionCheckbox = (ASPxCheckBox)selectionCell.Controls[0]; break; } } if (selectionCheckbox != null) { TreeListNode node = treeList.FindNodeByKeyValue(e.NodeKey); selectionCheckbox.Checked = true; } }
private void OnLoad() { int start = 0; // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize; int end = 1000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxLabel Id = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["Id"], "lbl_Id") as ASPxLabel; ASPxLabel JobNo = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["JobNo"], "lbl_JobNo") as ASPxLabel; ASPxComboBox txt_ContNo = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContainerNo"], "cbbContainer") as ASPxComboBox; ASPxLabel lbl_ContIndex = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContainerNo"], "lbl_ContIndex") as ASPxLabel; ASPxDateEdit date_ScheduleDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ScheduleDate"], "date_ScheduleDate") as ASPxDateEdit; ASPxTextBox txt_SealNo = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["SealNo"], "txt_SealNo") as ASPxTextBox; ASPxComboBox cbbContType = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ContainerType"], "cbbContType") as ASPxComboBox; ASPxDateEdit date_CustomsClearDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["CustomsClearDate"], "date_CustomsClearDate") as ASPxDateEdit; ASPxComboBox cmb_CustomsClearStatus = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["CustomsClearStatus"], "cmb_CustomsClearStatus") as ASPxComboBox; ASPxComboBox cmb_CustomsVerifyInd = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["CustomsVerifyInd"], "cmb_CustomsVerifyInd") as ASPxComboBox; ASPxDateEdit date_CustomsVerifyDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["CustomsVerifyDate"], "date_CustomsVerifyDate") as ASPxDateEdit; ASPxMemo memo_CustomsRemark = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["CustomsRemark"], "memo_CustomsRemark") as ASPxMemo; ASPxDateEdit date_ValiDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ValiDate"], "date_ValiDate") as ASPxDateEdit; ASPxDateEdit date_ScheduleStartDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["ScheduleStartDate"], "date_ScheduleStartDate") as ASPxDateEdit; ASPxDateEdit date_BillingDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["BillingDate"], "date_BillingDate") as ASPxDateEdit; ASPxDateEdit date_DispatchDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["DispatchDate"], "date_DispatchDate") as ASPxDateEdit; ASPxDateEdit date_EtaDate = this.grid.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid.Columns["EtaDate"], "date_EtaDate") as ASPxDateEdit; if (Id != null) { list.Add(new Record(SafeValue.SafeInt(Id.Text, 0), JobNo.Text, txt_ContNo.Text, date_ScheduleDate.Date, txt_SealNo.Text, SafeValue.SafeString(cbbContType.Value), SafeValue.SafeString(cmb_CustomsClearStatus.Value), date_CustomsClearDate.Date, SafeValue.SafeString(cmb_CustomsVerifyInd.Value), date_CustomsVerifyDate.Date, memo_CustomsRemark.Text, lbl_ContIndex.Text, date_ValiDate.Date, date_ScheduleStartDate.Date, date_ValiDate.Date, date_DispatchDate.Date, date_EtaDate.Date)); insert_container(txt_ContNo.Text, SafeValue.SafeString(cbbContType.Value)); } else { if (Id == null) { break; } } } }
protected void HeaderCheckBox_Init(object sender, EventArgs e) { DataView view = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty); var expression = view.Table.Rows.OfType <DataRow>(); int selectedRowsCount = expression.Count(r => (bool?)r["Discontinued"] == true); int allRowsCount = view.Count; ASPxCheckBox checkBox = sender as ASPxCheckBox; if (selectedRowsCount == 0) { checkBox.CheckState = CheckState.Unchecked; } else if (selectedRowsCount == allRowsCount) { checkBox.CheckState = CheckState.Checked; } else { checkBox.CheckState = CheckState.Indeterminate; } }
//Metodo del checkbox por fila protected void chkConsultar_Init(object sender, EventArgs e) { try { ASPxCheckBox chb = sender as ASPxCheckBox; GridViewDataItemTemplateContainer container = chb.NamingContainer as GridViewDataItemTemplateContainer; chb.ClientInstanceName = String.Format("chkConsultar{0}", container.VisibleIndex); chb.ClientSideEvents.CheckedChanged = String.Format("function (s, e) {{ chkConsultarClick(s, e, {0}); }}", container.VisibleIndex); } catch (Exception ex) { string mensaje = string.Empty; int idusuario = 0; if (Session["IdUsuario"] != null) { idusuario = int.Parse(Session["IdUsuario"].ToString()); } excepcion.RegistrarExcepcion(idusuario, "DescargaExpediente-chkConsultar_Init", ex, lblCadena.Text, ref mensaje); } }
protected void gridPersonDet3_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { ASPxTextBox id = this.grid.FindEditFormTemplateControl("txt_Id") as ASPxTextBox; e.NewValues["Person"] = SafeValue.SafeInt(id.Text, 0); ASPxGridView grd = sender as ASPxGridView; ASPxCheckBox isPayroll = grd.FindControl("ckb_IsPayroll") as ASPxCheckBox; if (isPayroll.Checked) { e.NewValues["IsPayroll"] = true; } else { e.NewValues["IsPayroll"] = false; } e.NewValues["CreateBy"] = HttpContext.Current.User.Identity.Name; e.NewValues["CreateDateTime"] = DateTime.Now; }
protected void chkIsLockedout_Load(object sender, EventArgs e) { ASPxCheckBox cb = sender as ASPxCheckBox; if (grdUsers.IsNewRowEditing) { cb.Enabled = false; } else { MembershipUser newuser = Membership.GetUser(grdUsers.GetRowValues(grdUsers.EditingRowVisibleIndex, "UserName").ToString()); if (newuser.IsLockedOut) { cb.Checked = true; } else { cb.Enabled = false; } } }
private void OnLoad1() { int start = 0; int end = 100; for (int i = start; i < end; i++) { ASPxCheckBox isOk = this.grid_Cost.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Cost.Columns["Id"], "ack_IsOk") as ASPxCheckBox; ASPxTextBox id = this.grid_Cost.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Cost.Columns["Id"], "txt_wh_Id") as ASPxTextBox; ASPxLabel lbl_ChgCode = this.grid_Cost.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Cost.Columns["ChgCodeDes"], "lbl_ChgCode") as ASPxLabel; if (id != null && isOk != null && isOk.Checked) { list1.Add(new Record1(SafeValue.SafeInt(id.Text, 0), lbl_ChgCode.Text)); } else if (id == null) { break; } } }
private void OnLoad() { int start = 0; int end = count; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxLabel lb_Id = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Id"], "lb_Id") as ASPxLabel; ASPxDateEdit txt_search_dateFrom = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["ScheduleStartDate"], "txt_search_dateFrom") as ASPxDateEdit; ASPxTextBox date_ScheduleStartTime = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["ScheduleStartDate"], "date_ScheduleStartTime") as ASPxTextBox; if (lb_Id != null && isPay != null && isPay.Checked) { list.Add(new Record(SafeValue.SafeInt(lb_Id.Text, 0), txt_search_dateFrom.Date, date_ScheduleStartTime.Text)); } else if (lb_Id == null) { break; } } }
protected void POGrid_BeforeGetCallbackResult(object sender, EventArgs e) { ASPxGridView grid = sender as ASPxGridView; DesignBehavior.SetBehaviorGrid(grid); if (grid.IsEditing) { if (!grid.IsNewRowEditing) { ASPxPageControl pageControl = POGrid.FindEditFormTemplateControl("GridPageControl") as ASPxPageControl; ASPxCheckBox checkbox = pageControl.FindControl("AllowPassword") as ASPxCheckBox; ASPxLabel lbl = pageControl.FindControl("AllowLbl") as ASPxLabel; //ASPxTextBox pword = pageControl.FindControl("Pword") as ASPxTextBox; checkbox.Checked = true; checkbox.ClientVisible = true; lbl.ClientVisible = true; } } }
private void OnLoad() { int start = 0; // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize; int end = 10000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize; for (int i = start; i < end; i++) { ASPxTextBox docId = this.ASPxGridView1.FindRowTemplateControl(i, "txt_oid") as ASPxTextBox; ASPxTextBox docType = this.ASPxGridView1.FindRowTemplateControl(i, "txt_docType") as ASPxTextBox; ASPxCheckBox bankRec = this.ASPxGridView1.FindRowTemplateControl(i, "ck_bankRec") as ASPxCheckBox; ASPxDateEdit bankDate = this.ASPxGridView1.FindRowTemplateControl(i, "date_bankDate") as ASPxDateEdit; if (null != docId && null != docType && null != bankDate && null != bankRec) { list.Add(new Record(docId.Text, docType.Text, bankRec.Checked, bankDate.Date) ); } } }
private void LimpiarPermisos(bool enable) { //Desmarca todos los permisos for (int i = 0; i < Grid2.VisibleRowCount; i++) { //Session["GET"] = Grid.GetDataRow(i).ToString().Trim(); //Grid2.GetRowValues() ASPxCheckBox chkTodo = Grid2.FindRowCellTemplateControl(i, (GridViewDataColumn)Grid2.Columns["Todo"], "chkTodo") as ASPxCheckBox; ASPxCheckBox chkConsultar = Grid2.FindRowCellTemplateControl(i, (GridViewDataColumn)Grid2.Columns["Consultar"], "chkConsultar") as ASPxCheckBox; ASPxCheckBox chkAgregar = Grid2.FindRowCellTemplateControl(i, (GridViewDataColumn)Grid2.Columns["Agregar"], "chkAgregar") as ASPxCheckBox; ASPxCheckBox chkEditar = Grid2.FindRowCellTemplateControl(i, (GridViewDataColumn)Grid2.Columns["Editar"], "chkEditar") as ASPxCheckBox; ASPxCheckBox chkEliminar = Grid2.FindRowCellTemplateControl(i, (GridViewDataColumn)Grid2.Columns["Eliminar"], "chkEliminar") as ASPxCheckBox; ASPxCheckBox chkExportar = Grid2.FindRowCellTemplateControl(i, (GridViewDataColumn)Grid2.Columns["Exportar"], "chkExportar") as ASPxCheckBox; if (chkTodo != null) { chkTodo.Checked = false; chkTodo.Enabled = enable; } if (chkConsultar != null) { chkConsultar.Checked = false; chkConsultar.Enabled = enable; } if (chkAgregar != null) { chkAgregar.Checked = false; chkAgregar.Enabled = enable; } if (chkEditar != null) { chkEditar.Checked = false; chkEditar.Enabled = enable; } if (chkEliminar != null) { chkEliminar.Checked = false; chkEliminar.Enabled = enable; } if (chkExportar != null) { chkExportar.Checked = false; chkExportar.Enabled = enable; } } }
protected void gridRecruitmentDet_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { ASPxGridView grd = sender as ASPxGridView; ASPxTextBox name = grd.FindEditFormTemplateControl("txt_Name") as ASPxTextBox; if (SafeValue.SafeString(name.Text).Length < 1) { throw new Exception("Name not be null !!!"); return; } ASPxCheckBox married = grd.FindEditFormTemplateControl("ckb_Married") as ASPxCheckBox; if (married.Checked) { e.NewValues["Married"] = "Y"; } else { e.NewValues["Married"] = "N"; } e.NewValues["InterviewId"] = SafeValue.SafeString(e.NewValues["InterviewId"], ""); e.NewValues["RecruitId"] = SafeValue.SafeString(e.NewValues["RecruitId"], ""); e.NewValues["Gender"] = SafeValue.SafeString(e.NewValues["Gender"]); e.NewValues["IcNo"] = SafeValue.SafeString(e.NewValues["IcNo"]); e.NewValues["BirthDay"] = SafeValue.SafeDate(e.NewValues["BirthDay"], new DateTime(1753, 1, 1)); e.NewValues["Country"] = SafeValue.SafeString(e.NewValues["Country"]); e.NewValues["Race"] = SafeValue.SafeString(e.NewValues["Race"]); e.NewValues["Religion"] = SafeValue.SafeString(e.NewValues["Religion"]); e.NewValues["Telephone"] = SafeValue.SafeString(e.NewValues["Telephone"]); e.NewValues["Email"] = SafeValue.SafeString(e.NewValues["Email"]); e.NewValues["Address"] = SafeValue.SafeString(e.NewValues["Address"]); e.NewValues["Remark"] = SafeValue.SafeString(e.NewValues["Remark"]); e.NewValues["Remark1"] = SafeValue.SafeString(e.NewValues["Remark1"]); e.NewValues["Remark2"] = SafeValue.SafeString(e.NewValues["Remark2"]); e.NewValues["Remark3"] = SafeValue.SafeString(e.NewValues["Remark3"]); e.NewValues["Remark4"] = SafeValue.SafeString(e.NewValues["Remark4"]); }
private void OnLoad() { int start = 0; int end = count; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox id = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Id"], "txt_Id") as ASPxTextBox; ASPxSpinEdit amt = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Price"], "txt_Amt") as ASPxSpinEdit; if (id != null && isPay != null && isPay.Checked) { //throw new Exception(amt.Text); list.Add(new Record(S.Int(id.Text), S.Dec(amt.Text))); } else if (id == null) { break; } } }
private void OnLoad(string t) { int start = 0; // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize; int end = 10000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns[0], "ack_IsPay") as ASPxCheckBox; ASPxButtonEdit driver = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Driver"], "btn_DriverCode") as ASPxButtonEdit; ASPxButtonEdit towhead = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["VehicleNo"], "btn_vehicle") as ASPxButtonEdit; ASPxTextBox Id = this.grid_Transport.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid_Transport.Columns["Driver"], "lb_Id") as ASPxTextBox; if (Id != null && driver != null & towhead != null && isPay != null && isPay.Checked) { list.Add(new Record(Id.Text, driver.Text, towhead.Text)); } else if (Id == null) { break; } } }
private void OnLoad() { int start = 0; int end = 10000; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxLabel title = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["Title"], "lbl_Title") as ASPxLabel; ASPxLabel content = this.ASPxGridView1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.ASPxGridView1.Columns["CenterContent"], "lbl_CenterContent") as ASPxLabel; if (title != null && isPay != null && isPay.Checked) { list.Add(new Record(title.Text, content.Text )); } else if (title == null) { break; } ; } }
private void CreateControlCheckBoxes() { if (string.IsNullOrEmpty(this.GridID)) { throw new NullReferenceException("GridID property is null."); } grid = NamingContainer.FindControl(GridID) as ASPxGridView; if (grid == null) { throw new InvalidOperationException("ASPxGridView control was not found in NamingContainer."); } foreach (GridViewDataColumn column in this.grid.Columns) { ASPxCheckBox columnCheckBox = new ASPxCheckBox(); columnCheckBox.ID = "chb" + column.VisibleIndex.ToString(); ASPxPopupControlDemo.Controls.Add(columnCheckBox); columnCheckBox.AutoPostBack = true; columnCheckBox.Text = column.FieldName; columnCheckBox.Checked = column.Visible; columnCheckBox.CheckedChanged += new EventHandler(columnCheckBox_CheckedChanged); } }
public void InstantiateIn(Control container) { GridViewDataItemTemplateContainer c = container as GridViewDataItemTemplateContainer; if (c.Column is GridViewDataCheckColumn) { object o = DataBinder.Eval(c.DataItem, c.Column.FieldName); if ((o != null) && ((bool)o)) { ASPxCheckBox cb = new ASPxCheckBox { ID = "myCB", Checked = true }; c.Controls.Add(cb); } } else { c.Controls.Add( new LiteralControl(DataBinder.Eval(c.DataItem, c.Column.FieldName).ToString()) ); } }
private void OnLoad(string r) { int start = 0; // this.ASPxGridView1.PageIndex * ASPxGridView1.SettingsPager.PageSize; int end = 10000; // (ASPxGridView1.PageIndex + 1) * ASPxGridView1.SettingsPager.PageSize; for (int i = start; i < end; i++) { ASPxTextBox docId = this.ASPxGridView1.FindRowTemplateControl(i, "txt_docId") as ASPxTextBox; ASPxSpinEdit payAmt = this.ASPxGridView1.FindRowTemplateControl(i, "spin_Amt") as ASPxSpinEdit; ASPxSpinEdit balanceAmt = this.ASPxGridView1.FindRowTemplateControl(i, "spin_BalanceAmt") as ASPxSpinEdit; ASPxCheckBox isPay = this.ASPxGridView1.FindRowTemplateControl(i, "ack_IsPay") as ASPxCheckBox; if (docId != null && payAmt != null && isPay != null && isPay.Checked) { if (SafeValue.SafeDecimal(payAmt.Value, 0) > 0 && SafeValue.SafeDecimal(payAmt.Value, 0) <= SafeValue.SafeDecimal(balanceAmt.Value, 0)) { totPayAmt += SafeValue.SafeDecimal(payAmt.Value, 0); list.Add(new Record(docId.Text, SafeValue.SafeDecimal(payAmt.Value, 0) )); } } } }
private void OnLoad() { int start = 0; int end = 1000; for (int i = start; i < end; i++) { ASPxCheckBox isPay = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Id"], "ack_IsPay") as ASPxCheckBox; ASPxTextBox id = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Id"], "txt_Id") as ASPxTextBox; ASPxSpinEdit spin_Price = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Price"], "spin_Price") as ASPxSpinEdit; ASPxSpinEdit spin_Qty = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Qty"], "spin_Qty") as ASPxSpinEdit; ASPxTextBox txt_Unit = this.grid1.FindRowCellTemplateControl(i, (DevExpress.Web.ASPxGridView.GridViewDataColumn) this.grid1.Columns["Unit"], "txt_Unit") as ASPxTextBox; if (id != null && isPay != null && isPay.Checked) { list.Add(new Record(SafeValue.SafeInt(id.Text, 0), SafeValue.SafeDecimal(spin_Price.Value), SafeValue.SafeDecimal(spin_Qty.Value), txt_Unit.Text)); } else if (id == null) { break; } } }
protected void gridMainMonitor_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { try { //select all functionality if (e.Parameters.StartsWith("SelectAll")) { string value = e.Parameters.Replace("SelectAll", ""); int count = gridMainMonitor.VisibleRowCount; for (int i = 0; i < count; i++) { if (value.ToLower() == "true") { gridMainMonitor.Selection.SelectRow(i); } else { gridMainMonitor.Selection.UnselectRow(i); } } //check header's checkbox if (value.ToLower() == "true") { ASPxCheckBox checkbox = (ASPxCheckBox)gridMainMonitor.FindHeaderTemplateControl(gridMainMonitor.Columns[0], "selCheckbox"); if (checkbox != null) { checkbox.Checked = true; } } } } catch (Exception ex) { Logger.Log(string.Format("exception {0}", ex.ToString()), LogLevel.Error); } }
//protected void LogFileGridView_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) //{ // if (e.RowType == GridViewRowType.EditForm) // { // ASPxLabel LogFileLabel = (sender as ASPxGridView).FindEditFormTemplateControl("LogFileLabel") as ASPxLabel; // LogFileLabel.Text = "VitalSigns will search the log file(log.nsf) for this word or phrase. If you would like to be alerted everytime the word is found. do not check the limitbox."; // } //} protected DataRow GetRowEditTemplate(ASPxGridView gridView, string Mode) { HiddenField LogFileIDHiddenField = (HiddenField)gridView.FindEditFormTemplateControl("LogFileIDHiddenField"); ASPxTextBox LogFileTextBox = (ASPxTextBox)gridView.FindEditFormTemplateControl("LogFileTextBox"); ASPxCheckBox LogFileCheckBox = (ASPxCheckBox)gridView.FindEditFormTemplateControl("LogFileCheckBox"); ASPxCheckBox logCheckBox = (ASPxCheckBox)gridView.FindEditFormTemplateControl("logCheckBox"); ASPxCheckBox AgentlogCheckBox = (ASPxCheckBox)gridView.FindEditFormTemplateControl("AgentlogCheckBox"); ASPxTextBox NotLogFileTextBox = (ASPxTextBox)gridView.FindEditFormTemplateControl("NotLogFileTextBox"); DataTable LogFiledatatable = (DataTable)Session["LogFile"]; DataTable dataTable = LogFiledatatable; if (dataTable != null) { DataRow DRRow = dataTable.NewRow(); if (Mode == "Update") { DRRow["ID"] = LogFileIDHiddenField.Value; } DRRow["Keyword"] = LogFileTextBox.Text; DRRow["NotRequiredKeyword"] = NotLogFileTextBox.Text; DRRow["RepeatOnce"] = LogFileCheckBox.Checked; DRRow["Log"] = logCheckBox.Checked; DRRow["AgentLog"] = AgentlogCheckBox.Checked; return(DRRow); } else { DataRow dr = null; return(dr); } }
protected void grid_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { needToSelectAll = false; bool.TryParse(e.Parameters, out needToSelectAll); ASPxGridView gridView = (ASPxGridView)sender; int startIndex = gridView.PageIndex * gridView.SettingsPager.PageSize; int endIndex = Math.Min(gridView.VisibleRowCount, startIndex + gridView.SettingsPager.PageSize); for (int i = startIndex; i < endIndex; i++) { if (needToSelectAll) { ASPxCheckBox cb = (ASPxCheckBox)gridView.FindRowCellTemplateControl(i, (GridViewDataColumn)gridView.Columns["#"], "cbCheck"); DataRow row = gridView.GetDataRow(i); gridView.Selection.SetSelection(i, IsCheckBoxVisibleCriteria(row)); } else { gridView.Selection.SetSelection(i, needToSelectAll); } } }
protected void cb_Load(object sender, EventArgs e) { ASPxCheckBox checkBox = sender as ASPxCheckBox; GridViewGroupRowTemplateContainer container = checkBox.NamingContainer as GridViewGroupRowTemplateContainer; if (ASPxGridView1.Selection.Count != 0) { int rowInGroupCount = ASPxGridView1.GetChildRowCount(container.VisibleIndex); int countToCompare = 0; for (int j = 0; j < rowInGroupCount; j++) { DataRow row = ASPxGridView1.GetChildDataRow(container.VisibleIndex, j); var key = row["ProductID"]; if (ASPxGridView1.Selection.IsRowSelectedByKey(key)) { countToCompare++; } } if (rowInGroupCount == countToCompare) { checkBox.CheckState = CheckState.Checked; } else if (rowInGroupCount > countToCompare && countToCompare != 0) { checkBox.CheckState = CheckState.Indeterminate; } else if (countToCompare == 0) { checkBox.CheckState = CheckState.Unchecked; } } else { checkBox.CheckState = CheckState.Unchecked; } }
public void InstantiateIn(Control container) { Control control = new Control(); control.ID = "GroupDetectorEditForm"; container.Controls.Add(control); DataTable dt = datafield; string db_name = ""; string desc_name = ""; string auth = ""; string cell_type = ""; ASPxFormLayout editform_GroupDetector = new ASPxFormLayout(); editform_GroupDetector.ID = "editform_GroupDetector"; //editform_GroupDetector.Border.BorderWidth = Unit.Pixel(1); //editform_GroupDetector.SettingsItems.VerticalAlign = FormLayoutVerticalAlign.Middle; //editform_GroupDetector.SettingsItems.HorizontalAlign = FormLayoutHorizontalAlign.Center; editform_GroupDetector.Paddings.Padding = Unit.Pixel(8); foreach (DataRow dr in dt.Select("AUTH <> 'System'", "VIEW_SEQ")) { db_name = dr["DB_NAME"].ToString(); desc_name = dr["DESC_NAME"].ToString(); auth = dr["AUTH"].ToString(); cell_type = dr["SEL_TYPE"].ToString(); LayoutItem li = new LayoutItem(desc_name); li.FieldName = db_name; editform_GroupDetector.Items.Add(li); LayoutItemNestedControlContainer li_container = li.LayoutItemNestedControlContainer; if (auth == "Manager") { li.CaptionStyle.Font.Bold = true; li.CaptionStyle.ForeColor = Color.Red; } if (cell_type == "DropDown List") { ASPxDropDownEdit dropdownEdit = new ASPxDropDownEdit(); dropdownEdit.ID = db_name; ASPxComboBox comboBox = new ASPxComboBox(); comboBox.DataSource = Srch_DropDownItem(db_name); comboBox.TextField = "LOOKUPDETDESC"; comboBox.DataBind(); comboBox.IncrementalFilteringMode = IncrementalFilteringMode.StartsWith; comboBox.DropDownStyle = DropDownStyle.DropDown; comboBox.EnableSynchronization = DevExpress.Utils.DefaultBoolean.False; li_container.Controls.Add(comboBox); } else if (cell_type == "Note") { ASPxMemo textMemo = new ASPxMemo(); textMemo.ID = db_name; textMemo.Width = Unit.Percentage(91); li_container.Controls.Add(textMemo); } else { ASPxTextBox textBox = new ASPxTextBox(); textBox.ID = db_name; li_container.Controls.Add(textBox); //Suffix 증가 유무 체크 (15.10.16) if (db_name == "CNT") { li = new LayoutItem("Suffix"); li.FieldName = "DETECTOR_SUFFIX"; editform_GroupDetector.Items.Add(li); li_container = li.LayoutItemNestedControlContainer; ASPxCheckBox chkBox = new ASPxCheckBox(); chkBox.ID = "DETECTOR_SUFFIX"; li_container.Controls.Add(chkBox); } } } container.Controls.Add(editform_GroupDetector); //container.Controls.Add(editform_GroupDetector); //Button ASPxFormLayout btn_lo = new ASPxFormLayout(); btn_lo.ID = "button_GroupDetector"; btn_lo.ColCount = 1; btn_lo.Width = Unit.Percentage(90); btn_lo.SettingsItems.HorizontalAlign = FormLayoutHorizontalAlign.Right; btn_lo.Paddings.Padding = Unit.Pixel(1); LayoutItem btn_li = new LayoutItem("btn_li"); btn_li.ShowCaption = DevExpress.Utils.DefaultBoolean.False; btn_lo.Items.Add(btn_li); LayoutItemNestedControlContainer btn_li_container = btn_li.LayoutItemNestedControlContainer; ASPxGridViewTemplateReplacement btn_add = new ASPxGridViewTemplateReplacement(); btn_add.ReplacementType = GridViewTemplateReplacementType.EditFormUpdateButton; btn_add.ID = "btn_add"; btn_li_container.Controls.Add(btn_add); //LayoutItem btn_li2 = new LayoutItem("btn_li2"); //btn_li2.ShowCaption = DevExpress.Utils.DefaultBoolean.False; //btn_lo.Items.Add(btn_li2); //LayoutItemNestedControlContainer btn_li_container2 = btn_li2.LayoutItemNestedControlContainer; ASPxGridViewTemplateReplacement btn_cancel = new ASPxGridViewTemplateReplacement(); btn_cancel.ReplacementType = GridViewTemplateReplacementType.EditFormCancelButton; btn_cancel.ID = "btn_cancel"; btn_li_container.Controls.Add(btn_cancel); //btn_li.HorizontalAlign = FormLayoutHorizontalAlign.Right; container.Controls.Add(btn_lo); }
protected void Page_Load(object sender, EventArgs e) { m_Table = new HtmlTable(); fullList = GetData(); m_Table.Border = 1; HtmlTableRow row = GetHeader(); m_Table.Rows.Add(row); String currentAction = null; foreach (UserManagement.Data.Permission p in fullList) { HtmlTableCell cell; if (currentAction == null || currentAction != p.Name) { currentAction = p.Name; row = new HtmlTableRow(); for (int i = 0; i < 5; i++) row.Cells.Add(new HtmlTableCell()); cell = new HtmlTableCell(); ASPxLabel label = new ASPxLabel { Text = p.Name }; cell.Controls.Add(label); row.Cells.RemoveAt(0); row.Cells.Insert(0, cell); } cell = new HtmlTableCell(); ASPxCheckBox chk = new ASPxCheckBox(); chk.ClientSideEvents.CheckedChanged = "function(s, e) {document.getElementById('" + ((DetailComponent)Parent).linkSubmit.ClientID + "').className = 'btnSubmitChanged'}"; chk.ID = "chk_" + p.Action + "_" + p.PermissionID.ToString(); cell.Controls.Add(chk); SelectionPermission sp = new SelectionPermission(p.PermissionID, p.Name, p.Action); if (selectedList.Contains(sp)) chk.Checked = true; if (p.Action.Equals('R')) { row.Cells.RemoveAt(1); row.Cells.Insert(1, cell); } else if (p.Action.Equals('C')) { row.Cells.RemoveAt(2); row.Cells.Insert(2, cell); } else if (p.Action.Equals('U')) { row.Cells.RemoveAt(3); row.Cells.Insert(3, cell); } else if (p.Action.Equals('D')) { row.Cells.RemoveAt(4); row.Cells.Insert(4, cell); } m_Table.Rows.Add(row); } Controls.Add(m_Table); }
/// <summary> /// Creates HiddenField child control. /// </summary> protected override void CreateChildControls() { base.CreateChildControls(); Table table = new Table(); table.CellPadding = 0; table.CellSpacing = 0; table.BorderWidth = 0; foreach (KeyValuePair<string, string> value in Values) { ASPxCheckBox checkBox = new ASPxCheckBox(); checkBox.ID = String.Concat("CheckBox", value.Key); checkBox.Text = value.Value; checkBox.ClientSideEvents.CheckedChanged = CheckedChangedScript; TableRow tableRow = new TableRow(); TableCell checkBoxCell = new TableCell(); checkBoxCell.Controls.Add(checkBox); tableRow.Cells.Add(checkBoxCell); table.Rows.Add(tableRow); } Controls.Add(table); }
public static void AddCheckQuestionAdvanced(BusinessLogicLayer.Entities.Conference.ConferenceRegistrationType Q, Panel QuestionPanel) { Table table = new Table(); table.Style.Add("width", "100%"); #region Date Row TableRow rowDate = new TableRow(); TableCell cellDate = new TableCell(); cellDate.ColumnSpan = 2; cellDate.Style.Add("font-weight","bold"); //cellDate.Style.Add("text-align", "center"); //string hijriDate = ""; //string miladyDate = ""; //if(Q.CurrentSchedule != null) //{ // hijriDate = Code.RbmCommon.ConferenceBasePage.GregToHijri(Q.CurrentSchedule.StartTime); // miladyDate = Q.CurrentSchedule.StartTime.ToShortDateString(); //} //else //{ // hijriDate = Code.RbmCommon.ConferenceBasePage.GregToHijri(Q.StartDate); // miladyDate = Q.StartDate.ToShortDateString(); //} //cellDate.Text = String.Format("{0} - {1}", miladyDate, hijriDate); rowDate.Cells.Add(cellDate); table.Rows.Add(rowDate); #endregion #region Header Row TableRow rowHeader = new TableRow(); rowHeader.Style.Add("background-color", "#18335F"); rowHeader.Style.Add("color", "#FFFFFF"); TableCell cellTime = new TableCell(); //cellTime.Style.Add("text-align", "center"); cellTime.Style.Add("width", "185px"); cellTime.Text += CommonWeb.Resources.CommonResource.RegistrationForm_Time; TableCell cellTitle = new TableCell(); //cellTitle.Style.Add("text-align", "center"); cellTitle.Text = Q.DescriptionLanguage; rowHeader.Cells.Add(cellTime); rowHeader.Cells.Add(cellTitle); table.Rows.Add(rowHeader); #endregion #region Content Row TableRow rowContent = new TableRow(); TableCell cellTimeContent = new TableCell(); string hijriDate = ""; string miladyDate = ""; if (Q.CurrentSchedule != null) { hijriDate = BasePage.GregToHijri(Q.CurrentSchedule.StartTime); miladyDate = Q.CurrentSchedule.StartTime.ToShortDateString(); } else { hijriDate = BasePage.GregToHijri(Q.StartDate); miladyDate = Q.StartDate.ToShortDateString(); } cellTimeContent.Text = String.Format("{0} - {1}<br/>", miladyDate, hijriDate); if (Q.CurrentSchedule == null) cellTimeContent.Text += ""; else { if(Q.LanguageID == 2) cellTimeContent.Text += Q.CurrentSchedule.StartTime.ToShortTimeString().Replace("AM", "ص").Replace("PM", "م") + " - " + Q.CurrentSchedule.EndTime.ToShortTimeString().Replace("AM", "ص").Replace("PM", "م"); else cellTimeContent.Text += Q.CurrentSchedule.StartTime.ToShortTimeString() + " - " + Q.CurrentSchedule.EndTime.ToShortTimeString(); } TableCell cellTitleContent = new TableCell(); cellTitleContent.Style.Add("text-align", CommonWeb.Resources.CommonResource.Direction); cellTitleContent.Style.Add("font-weight", "bold"); ASPxCheckBox checkBox = new ASPxCheckBox(); checkBox.Text = Q.NameLanguage; checkBox.ID = "CheckList" + Q.ConferenceRegistrationTypeId; if (Q.MustRegister) { checkBox.ValidationSettings.CausesValidation = true; checkBox.ValidationSettings.Display = Display.Dynamic; checkBox.ValidationSettings.ErrorDisplayMode = ErrorDisplayMode.Text; checkBox.ValidationSettings.RequiredField.ErrorText = "*"; checkBox.ValidationSettings.RequiredField.IsRequired = true; checkBox.ValidationSettings.ValidationGroup = "WizardValidation"; } cellTitleContent.Controls.Add(checkBox); rowContent.Cells.Add(cellTimeContent); rowContent.Cells.Add(cellTitleContent); table.Rows.Add(rowContent); #endregion QuestionPanel.Controls.Add(table); }
private void CreateControlCheckBoxes() { foreach (GridViewDataColumn column in this.grid.Columns) { ASPxCheckBox columnCheckBox = new ASPxCheckBox(); columnCheckBox.ID = "chb" + column.VisibleIndex.ToString(); ASPxPopupControlDemo.Controls.Add(columnCheckBox); columnCheckBox.AutoPostBack = true; columnCheckBox.Text = column.Caption; columnCheckBox.Checked = column.Visible; columnCheckBox.CheckedChanged += new EventHandler(columnCheckBox_CheckedChanged); if (column.Caption.ToString().Equals(" ") || column.Caption.ToString().Equals("Edt")) { break; } } }
public static string getCheckBoxValue(ASPxCheckBox chk) { string result = ""; try { result = chk.Value.ToString(); } catch (Exception ex) { SiAuto.Main.LogString("Lỗi getCheckBoxValue :", ex.ToString()); } return result; }
public static void SetCheckBoxValue(ASPxCheckBox chk, object objects) { try { if (objects != null) { bool state = false; bool.TryParse(objects.ToString(), out state); chk.Checked = state; } } catch (Exception ex) { SiAuto.Main.LogString("Lỗi SetCheckBoxValue :", ex.ToString()); } }