data grid error

  • Thread starter Thread starter IndyChris
  • Start date Start date
I

IndyChris

I'm getting the following error.
'System.Web.UI.WebControls.TableRow.Cells' denotes a 'property' where a
'method' was expected

It's happening on two lines of code.
PlaceHolder ExpandedContent = e.Item.Cells(ConfGrid.Columns.Count -
1).FindControl("ExpandedContent");

-AND-
ImageButton btnExpand = e.Item.Cells(0).FindControl("btnExpand");

I've seen various posts regarding this issue but none of them really
relate to me. I can get this to work in VB but I really need it in C#.

Can anyone help me out?
 
IndyChris said:
I'm getting the following error.
'System.Web.UI.WebControls.TableRow.Cells' denotes a 'property' where
a 'method' was expected

It's happening on two lines of code.
PlaceHolder ExpandedContent = e.Item.Cells(ConfGrid.Columns.Count -
1).FindControl("ExpandedContent");

PlaceHolder ExpandedContent = e.Item.Cells[ConfGrid.Columns.Count -
1].FindControl("ExpandedContent");
-AND-
ImageButton btnExpand = e.Item.Cells(0).FindControl("btnExpand");

ImageButton btnExpand = e.Item.Cells[0].FindControl("btnExpand");

it=Italy ;)

Ciao
 
Hi,

Coming from VB he? :)

Change ( for [ :

PlaceHolder ExpandedContent = e.Item.Cells [ ConfGrid.Columns.Count - 1 ]
..FindControl("ExpandedContent");

btnExpand = e.Item.Cells[0].FindControl("btnExpand");
 
IndyChris said:
Thank you!!!!

Now, how do I convert the Control to a PlaceHolder?

PlaceHolder ExpandedContent = e.Item.Cells[ConfGrid.Columns.Count -
1].FindControl("ExpandedContent") as PlaceHolder;

IT AS ITALIAN LANGUAGE!!! :)
 
Back
Top