Grid View Footer

To show the details at the footer like the sum of the whole amount , any text  and any formatting.

Code-   

string s= "select sum(amount) from Table_name; 
 
cm =new SqlCommand(s,cn); 

GridView1.FooterRow.Cells[Index].Text = cm.ExecuteReader().ToString();  

GridView1.FooterRow.Cells[index].Text = "Some text you wanna print"; 

GridView1.FooterRow.Cells[index].ForeColor = System.Drawing.Color.Yellow; 

Note- In order to do the formatting stuff with footer we need to assign the 'Show Footer' attribute to true in grid view[Go to source].

 
 





Comments

Popular posts from this blog

Parameter Query

Final Project

Grid View Paging