magritton
4/29/2014 - 8:57 PM

This is a Dev Express example of catching the HTML Data Cell Prepared and getting the data from other columns. This also facilitates the cel

This is a Dev Express example of catching the HTML Data Cell Prepared and getting the data from other columns. This also facilitates the cell click on the client side

protected void gvInvoices_HtmlDataCellPrepared(object sender, DevExpress.Web.ASPxGridView.ASPxGridViewTableDataCellEventArgs e)
        {
            if (e.DataColumn.FieldName == "InvoiceNote")
            {
                string strCustomerNum = Convert.ToString(e.GetValue("CUSTOMER_NUMBER"));
                string strCompanyName = Convert.ToString(e.GetValue("Company_Name"));
                string strInvoiceNum = Convert.ToString(e.GetValue("Invoice_Number"));
                e.Cell.Attributes.Add("onclick", "onCellClick('" + strCustomerNum + "', '" + strCompanyName + "', '" + strInvoiceNum + "')");
            }
            if (e.DataColumn.FieldName == "InvoiceAttachment")
            {
                string strCustomerNum = Convert.ToString(e.GetValue("CUSTOMER_NUMBER"));
                string strCompanyName = Convert.ToString(e.GetValue("Company_Name"));
                string strInvoiceNum = Convert.ToString(e.GetValue("Invoice_Number"));
                e.Cell.Attributes.Add("onclick", "onAttCellClick('" + strCustomerNum + "', '" + strCompanyName + "', '" + strInvoiceNum + "')");
            }
        }