Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Does not contain a definition for 'rowindex'

Status
Not open for further replies.

taree

Technical User
May 31, 2008
316
US
I get Does not contain a definition for 'rowindex' error.any clue will be appreciated.



Code:
protected void btnConAd_Click(object sender, EventArgs e)
        {
            string valStr;
            foreach (GridView gvRows in gvConAd.Rows)
            {

                CheckBox chkSelect = (CheckBox)gvRows.FindControl("chkSelect");
               if (chkSelect.Checked)
                {

                    valStr = valStr + gvConAd.DataKeys[gvRows.RowIndex].Values["contid"].ToString();
                  

                    

                }
            }
        }
 
thank you all. I found the problem. Here is the problem ...GridView gvRows

should be GridViewRow gvRows.....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top