On Jun 19, 4:28 pm, "Mark Rae [MVP]" <m...@markNOSPAMrae.net> wrote:
> <COHENMAR...@lycos.com> wrote in message
>
> news:ff087d9e-93c0-4a58-a4d6-...
>
> >I have code like this:
> > FromRow = GridViewPlacementsForDups.SelectedRow
> > strCellContents = FromRow.Cells(4).Text
> > It works fine for most of the cells in the row. But cell #4 (above)
> > has a date in it, and when I run the debugger, strCellContents is
> > blank.
> > Am I doing something wrong?
>
> Is the date inside another control e.g. a label...?
>
> What is the value of FromRow.Cells(4).Controls.Count?
>
> --
> Mark Rae
> ASP.NET MVPhttp://www.markrae.net
I found out the problem - which is that the date is in a template
control, while the other fields of the grid are not.
(The reason I had put in a template control was to format it).
However, I also find that MSDN.microsoft.com gives wrong advice on
getting the value out of this template control. So I've given up on
that approach, and I've made the sql query return a string form of a
date that doesn't have to be put in a template control.
Thanks,
Marv
|