Last post Mar 30, 2016 06:25 PM by Ken Carter
Mar 18, 2016 05:56 PM|Ken Carter|LINK
Having an issue with the following as I convert my VB pages over to C# I tried to turn this to string instead of text but didn't' seem to like it no matter what I did.
The error is coming up on the 'Cell' in the two lines below:
Session["ArticleFocus"] = GridView1.SelectedRow.Cells(2).Text;
Session["GapDocument"] = GridView1.SelectedRow.Cells(3).Text;
The Error reads : "Non-invoocable member 'TableRow.Cells' cannot be used like a method."
Mar 18, 2016 06:56 PM|Rion Williams|LINK
C# uses square brackets to reference indices as opposed to parentheses :
Session["ArticleFocus"] = GridView1.SelectedRow.Cells.Text;
Session["GapDocument"] = GridView1.SelectedRow.Cells.Text;
Mar 18, 2016 08:41 PM|Ken Carter|LINK
Thank you so very much for clearing that matter up for me! I used a converter from Telerik to do the initial code conversion and I simply assumed that they had that covered. I totally glazed over it. I appreciate the assist! Have a great weekend!
Mar 30, 2016 06:25 PM|Ken Carter|LINK
Everyone has a gridview example and I'm doing individual controls not gridview. All my controls are being driven from code behind logic so I appreciate the reference but not going to help. I managed the conversion just fine.
Have a good one! Thanks again!