title: how to check first row and column of grid view using asp.net
body: <p>I have a gridview with two columns. I want to check first row and first column should be mandatory. If first column is blank it should not allow to save and it should display message as </p>
  
  <blockquote>
    <p>one row should be compulsary.</p>
  </blockquote>
  
  <p>How to check this?</p>
  
  <p>My save button click coding is as below </p>
  
  <pre><code>Dim row As GridViewRow 
  For Each row In GridView1.Rows 
  If row.RowType = DataControlRowType.DataRow Then 
      Dim t1 As String = CType(row.FindControl("TextBox2"), TextBox).Text 
      Dim dd As String = CType(row.FindControl("DropDownList3"), DropDownList).SelectedItem.Text 
      If Trim(t1) = "" Or (Trim(dd)= "" then 
          label6.Text = "HospNo,Date,SurgeryCode/Method are Mandatory" 
      End If 
  </code></pre>
  
  <p>but this checks all grid columns, i want to check only first row and column.</p>