2015-12-29 76 views
0

我想用aspx網格來做這樣的事情。 創建網格的對象,並設置其屬性形成背後 代碼這是一個asp電網如何從後面的代碼訪問aspx網格?

GridView obj1=(GridView)sender; 
BoundField col = (BoundField)grid.Columns[1]; 
col1.DataFormatString="{0:N2}"; 

你的想法嗎?

如果你願意進一步幫助,我將不勝感激你對我發佈的這個問題的想法。我一直在等待這個問題的一些建議。

How to Set the column properties of DevEx Grid form code behind

回答

0
foreach (GridDataItem item in grdInvoiceItems.Items) 
{ 
      //object id = (object)item.OwnerTableView.DataKeyValues[item.ItemIndex]["Id"]; 
      object value = item["Id"].Text; 
      id = (item["Id"].FindControl("lblId") as RadTextBox).Text; 
      string lineItem = (item["Item"].FindControl("ddlItems") as RadComboBox).Text; 
      string description = (item["Description"].FindControl("txtDescription") as RadTextBox).Text; 
      double? price = (item["Price"].FindControl("txtPrice") as RadNumericTextBox).Value; 
      double? qty = (item["Qty"].FindControl("txtQty") as RadNumericTextBox).Value; 
      double? discount = (item["Discount"].FindControl("txtDiscount") as RadNumericTextBox).Value; 
      //double tax = double.Parse(lblTaxes.Text); 
      //Label amount1 = (item["Amount"].FindControl("lblAmount") as Label); 
      //string amount = item["Amount"].Text; 
      //Label amount1 = (item.FindControl("lblAmount") as Label); 
      double? amounnt = (item["Amount"].FindControl("lblAmount") as RadNumericTextBox).Value; 

      if (!string.IsNullOrEmpty(lineItem)) 
      { 
       Invoice.UpdateInvoiceItems(Convert.ToInt32(id), lineItem, description, Convert.ToDouble(price), 
        Convert.ToInt32(qty), Convert.ToDouble(discount), 0, Convert.ToDouble(amounnt)); 
      } 
     } 
相關問題