>1)'object' does not contain a definition for 'FindControl' and
>no extension method 'FindControl' accepting a first argument
>of type 'object' could be found (are you missing a using directive
>or an assembly reference?)----->sulla parola chiave FindControl
Problema di parentesi..
>2)Non-invocable member 'System.Web.UI.WebControls.GridView.Rows'
>cannot be used like a method.--->sulla parola chiave .Rows
Le chiavi per ricavare l'item dalle collezioni in C# vanno messe tra [...] e non tra (...).
>3)'object' does not contain a definition for 'RowIndex' and no
>extension method 'RowIndex' accepting a first argument of type
>'object' could be found (are you missing a using directive or
>an assembly reference?)sulla parola chiave .RowIndex
>valerik
Conseguenza dei precedenti. Eccoti il codice corretto:
foreach (GridViewRow GR in gwLiveUpdate.Rows)
{
if (((CheckBox)GR.FindControl("chk2")).Checked)
{
imei = gwLiveUpdate.Rows[GR.RowIndex].Cells[1].Text;
version = gwLiveUpdate.Rows[GR.RowIndex].Cells[7].Text;
}
}
--
Alessandro Alpi | SQL Server MVP
http://www.alessandroalpi.net
http://blogs.dotnethell.it/suxstellino
http://mvp.support.microsoft.com/profile/Alessandro.Alpi
http://italy.mvps.org