protected void StockOperationGrid_CustomButtonCallback(object sender, ASPxGridViewCustomButtonCallbackEventArgs e) { var row = (StockOperationGrid.GetRow(e.VisibleIndex) as StockOperation); if (row == null) { return; } if (e.ButtonID == "Approve") { var xml = string.Format(@"<data> <stock_operation_id> {0} </stock_operation_id> </data>", row.ID); row.TX_StockOperations(2, xml); } if (e.ButtonID == "Undo") { var xml = string.Format(@"<data> <stock_operation_id> {0} </stock_operation_id> </data>", row.ID); row.TX_StockOperations(3, xml); } StockOperationGrid.DataBind(); }
protected void GoodsComboBox_OnSelectedIndexChanged(object sender, EventArgs e) { var goodsComboBox = sender as ASPxComboBox; var pseudoUnitComboBox = StockOperationGrid.FindEditRowCellTemplateControl(StockOperationGrid.Columns["PseudoUnitName"] as GridViewDataComboBoxColumn, "PseudoUnitComboBox") as ASPxComboBox; pseudoUnitComboBox.SelectedIndex = -1; pseudoUnitComboBox.DataSource = new PseudoUnit().ListPseudoUnitsByGoodsID(Convert.ToInt32(goodsComboBox.Value)); pseudoUnitComboBox.DataBind(); }
protected void StockOperationGrid_HtmlRowCreated(object sender, ASPxGridViewTableRowEventArgs e) { var row = (StockOperationGrid.GetRow(e.VisibleIndex) as StockOperation); if (row == null) { return; } if (!row.NeedsConfirmation) { e.Row.Cells[9].Controls[0].Visible = false; } if (!row.IsUndoAllowed) { e.Row.Cells[9].Controls[1].Visible = false; } }
private object GetStockOperationComboBoxColumnValue(string ColumnFieldName, string ComboBoxID) { var comboBox = StockOperationGrid.FindEditRowCellTemplateControl((StockOperationGrid.Columns[ColumnFieldName] as GridViewDataColumn), ComboBoxID) as ASPxComboBox; return(comboBox.Value); }