Jes Sie

Jes Sie

  • 691
  • 1.2k
  • 262.5k

Check If All Values in a Column of a Gridview are the same

Aug 26 2019 3:18 AM
Hello guys I need your help again.
 
I have a gridview and one column has a boolean value. Now, If all rows in that column equals to TRUE, I will do my stuff.
 
  1. protected void gvQuotationDetails_RowDataBound(object sender, GridViewRowEventArgs e)  
  2.         {  
  3.             if(e.Row.RowType == DataControlRowType.DataRow)  
  4.             {  
  5.                 CheckBox cbNego = (CheckBox)e.Row.FindControl("cbNegotiate");  
  6.                 CheckBox cbApp = (CheckBox)e.Row.FindControl("cbApprove");  
  7.   
  8.                 if (cbNego.Checked)  
  9.                 {  
  10.                     cbNego.Enabled = false;  
  11.                 }  
  12.   
  13.                 if (cbApp.Checked)  
  14.                 {  
  15.                     cbApp.Enabled = false;  
  16.                     cbNego.Enabled = false;  
  17.                 }  
  18.   
  19.                 // if all row values in cbApp == true,  
  20.                 //update quotation header  
  21.             }  
  22.         }  
 
 
Thanks a lot. 

Answers (2)