Click here to Skip to main content
15,894,182 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi all I have written a code to display the textbox text which is outside aspxgridview by performing some operation under HtmlRowPrepared event of aspxgridview. This is my sample code

C#
double lPrice=0;
 protected void ASPxGrd_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e)
 {
     if (e.VisibleIndex >= 0)
     {
        for (int i = 0; i < ASPxGrd.VisibleRowCount; i++)
        {
            ASPxTextBox txtPrice= ASPxGrd.FindRowCellTemplateControl(i,
               ASPxGrd.Columns["Price"] as GridViewDataColumn, "txtPrice") as ASPxTextBox;
            lPrice+= double.Parse(txtTotLinePrice.Text);
        }
          txtOutTax.Text=lPrice.ToString(); // Text box which is out side the gridview
     }
 }


I tried in many ways but still unable to assign the text box text but when I debug it and see I am able to see the text assigning to the text box, but when coming to form I couldn't. I also set EnableCallBack=False for the ASPXGridview even though issue remains same. Can some one help me
Posted
Comments
Prasad Khandekar 7-May-13 3:27am    
Hello,

The HtmlRowPrepared event is raised for each grid row (data row, group row, etc.) within the ASPxGridView. You can handle this event to change the style settings of individual rows. So this may not be the good idea. But if you want to do it this way then ensure that the e.RowType is equal to GridViewRowType.Data and also e.Row.Cells.Count > 1.

Regards,
demouser743 7-May-13 4:24am    
Is there any other event where I can handle this scenario

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900