The error i am getting for the below code is:
Cannot implicitly convert System.Web.UI.WebControls.GridViewRow to System.Web.UI.WebControls.GridView
The code is as below:
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
GridView row = GridView1.SelectedRow;
strv1 = row.Cells[1].Text;
}
Am i missing out any namespace... PLZZZ HELP
Loading


Suthish NairRank #92 · 22.8K reputationPosted Jan 27, 2011, 11:35 PM EST
I remember i already replied your same post couple of days ago.
On SelectedIndexChanged you cannot call this property. Change your code like below.
Sam HobbsRank #107 · 20.5K reputationPosted Jan 27, 2011, 10:56 PM EST
Krishna GaradRank #191 · 12.8K reputationPosted Jan 27, 2011, 11:26 PM EST
Dataset ds=method.Dataset();
same as GridViewRow row= GridView1.SelectedRow;
B M SuchitraRank #2,922 · 492 reputationPosted Jan 28, 2011, 2:04 AM EST
But i want to know why my code is wrong...If u can explain plzzz
Suthish NairRank #92 · 22.8K reputationPosted Jan 28, 2011, 6:45 AM EST
Sam HobbsRank #107 · 20.5K reputationPosted Jan 28, 2011, 8:11 AM EST
B M SuchitraRank #2,922 · 492 reputationPosted Jan 28, 2011, 5:03 PM EST
Thanks Sam and Suthish:)