protected void ASPxGridView1_CustomColumnDisplayText(object sender, ASPxGridViewColumnDisplayTextEventArgs e) { if (e.VisibleRowIndex >= 0) { AccountingPeriod CurrentDataRow = ASPxGridView1.GetRow(e.VisibleRowIndex) as AccountingPeriod; if (e.Column.FieldName == "AccountingPeriodTypeId!Key") { if (CurrentDataRow.AccountingPeriodTypeId == null) { return; } e.DisplayText = CurrentDataRow.AccountingPeriodTypeId.Name; } if (e.Column.Caption == "Chu kì trực thuộc") { string displayText = ""; CriteriaOperator criteria_0 = new BinaryOperator("AccountingPeriodId", CurrentDataRow, BinaryOperatorType.Equal); CriteriaOperator criteria_1 = new BinaryOperator("RowStatus", Constant.ROWSTATUS_ACTIVE, BinaryOperatorType.GreaterOrEqual); CriteriaOperator criteria = new GroupOperator(GroupOperatorType.And, criteria_0, criteria_1); XPCollection <AccountingPeriodComposite> collection = new XPCollection <AccountingPeriodComposite>(session, criteria); foreach (AccountingPeriodComposite cp in collection) { displayText = displayText + cp.ChildrenAccountingPeriodId.Code + "; "; } e.DisplayText = displayText; } } }
protected void Viwe_check_Click(object sender, EventArgs e) { for (int i = 0; i < this.ASPxGridView1.VisibleRowCount; i++) { if (this.ASPxGridView1.Selection.IsRowSelected(i)) { DataRowView checkinfo = (DataRowView)ASPxGridView1.GetRow(i); Session["Checkid"] = checkinfo.Row.ItemArray[0]; } } }
protected void Page_PreRender(object sender, EventArgs e) { List <nwind.Products> list = new List <nwind.Products>(); for (int i = ASPxGridView1.VisibleStartIndex; i < ASPxGridView1.SettingsPager.PageSize + ASPxGridView1.VisibleStartIndex; i++) { if (!ASPxGridView1.IsGroupRow(i)) { list.Add((nwind.Products)ASPxGridView1.GetRow(i)); } } WebChartControl1.DataSource = list; WebChartControl1.DataBind(); }
protected void ASPxGridView1_CustomButtonCallback(object sender, DevExpress.Web.ASPxGridViewCustomButtonCallbackEventArgs e) { String id = e.ButtonID; switch (id) { case "Delete": this.ASPxGridView1.DeleteRow(e.VisibleIndex); break; case "Edit": this.ASPxGridView1.StartEdit(e.VisibleIndex); break; case "New": this.ASPxGridView1.AddNewRow(); break; case "Viwe_check": for (int i = 0; i < this.ASPxGridView1.VisibleRowCount; i++) { if (this.ASPxGridView1.Selection.IsRowSelected(i)) { DataRowView checkinfo = (DataRowView)ASPxGridView1.GetRow(i); Session["Checkid"] = checkinfo.Row.ItemArray[0]; } } break; case "Download": for (int i = 0; i < this.ASPxGridView1.VisibleRowCount; i++) { if (this.ASPxGridView1.Selection.IsRowSelected(i)) { DataRowView checkinfo = (DataRowView)ASPxGridView1.GetRow(i); String path = checkinfo.Row.ItemArray[5].ToString(); path = path.Replace("H:/MRI_Data", ""); //path.Split(' '); String[] paths = path.Split('/'); Session["root"] = paths[0]; path = path + "/"; Session["path"] = path; } } break; } }
protected BootstrapChartDataItem[] GetBootstrapChartData() { DataRow gridDataRow; BootstrapChartDataItem[] BootstrapChartDataItems = new BootstrapChartDataItem[ASPxGridView1.VisibleRowCount]; for (int i = 0; i < ASPxGridView1.VisibleRowCount; i++) { gridDataRow = (ASPxGridView1.GetRow(i) as DataRowView).Row; BootstrapChartDataItems[i] = new BootstrapChartDataItem(gridDataRow.Field <string>("ProductName"), gridDataRow.Field <string>("QuantityPerUnit"), gridDataRow.Field <decimal>("UnitPrice")); } return(BootstrapChartDataItems); }
protected void WebChartControl1_CustomCallback(object sender, DevExpress.XtraCharts.Web.CustomCallbackEventArgs e) { var list = new List <DataRowView>(); for (int i = 0; i < ASPxGridView1.VisibleRowCount; i++) { if (!ASPxGridView1.IsGroupRow(i)) { list.Add((DataRowView)ASPxGridView1.GetRow(i)); } } Session["DataSource"] = list; WebChartControl1.DataSource = list; WebChartControl1.DataBind(); }
protected void ASPxGridView1_CustomButtonInitialize(object sender, ASPxGridViewCustomButtonEventArgs e) { if (e.VisibleIndex >= 0) { AccountingPeriod CurrentDataRow = ASPxGridView1.GetRow(e.VisibleIndex) as AccountingPeriod; if (e.ButtonID == "btUnder") { if (CurrentDataRow.AccountingPeriodTypeId == null) { return; } if (CurrentDataRow.AccountingPeriodTypeId.IsDefault == true) { e.Enabled = false; } } } }
protected void Download_Click(object sender, EventArgs e) { for (int i = 0; i < this.ASPxGridView1.VisibleRowCount; i++) { if (this.ASPxGridView1.Selection.IsRowSelected(i)) { DataRowView checkinfo = (DataRowView)ASPxGridView1.GetRow(i); String path = checkinfo.Row.ItemArray[5].ToString(); path = path.Replace("H:/MRI_Data", ""); //path.Split(' '); String[] paths = path.Split('/'); Session["root"] = paths[0]; path = path + "/"; Session["path"] = path; } } }
protected void ASPxGridView1_CustomCallback(object sender, DevExpress.Web.ASPxGridViewCustomCallbackEventArgs e) { switch (e.Parameters) { case "ClearGrid": Session["CurrentField"] = string.Empty; ASPxGridView1.DataBind(); break; case "InvertFilter": List <object> selectedValues = ASPxGridView1.GetSelectedFieldValues(new string[] { "FilterValue" }); ASPxGridView1.Selection.SelectAll(); foreach (object val in selectedValues) { ASPxGridView1.Selection.UnselectRowByKey(val); } break; case "ShowAll": ASPxGridView1.Selection.SelectAll(); break; case "HideAll": ASPxGridView1.Selection.UnselectAll(); break; default: Session["CurrentField"] = e.Parameters; ASPxGridView1.DataBind(); ASPxGridView1.PageIndex = 0; ASPxGridView1.Selection.UnselectAll(); ASPxGridView1.FilterExpression = string.Empty; ASPxGridView1.JSProperties.Add("cpFieldName", e.Parameters); object[] valuesIncludedStr = CurrentField.FilterValues.ValuesIncluded; for (int i = 0; i < ASPxGridView1.VisibleRowCount; i++) { FilterInfo fi = (FilterInfo)ASPxGridView1.GetRow(i); ASPxGridView1.Selection.SetSelection(i, ContainItem(valuesIncludedStr, fi.FilterValue)); } break; } }