You should get sub & grand totals based on underlying data source, e.g.
datatable or dataset, rather than datagrid itself.
HTH
Elton Wang
"JDP@Work" wrote:
> That didn't work in all cases, and caused an error in my sub & grand totals.
>
> If say the value was null, my string would be '$' and it'd error in my +=
> replace(field, "$", 0)
>
> Instead....
>
> <asp:Label ..... Text='<%# formatMoney(Container.DataItem("Install_1")) %>'>
>
> ....vb code behind....
> Protected Function formatMoney(ByVal data as Object) As String
> Dim retVal as String = ""
> If Not data Is DBNull.Value Then
> retVal = FormatCurrency(data, 0)
> End If
> Return retVal
> End Function
>
> TIA
>
> JeffP.....
>
> "Elton W" <> wrote in message
> news:7232F184-D6B2-4CFB-B3F4-...
> > Try
> >
> > <%# DataBinder.Eval(Container, "DataItem.Install_1", "{0:$######}") %>
> >
> >
> > Some thing like
> > <%# DataBinder.Eva(Container, "DataItem.Install_1", "{0:$###,##0.00}") %>
> >
> > gives you
> >
> > $5,320.00
> >
> > HTH
> >
> > Elton Wang
> >
> >
> > "JeffP@Laptop" wrote:
> >
> > > In the datagrid I have
> > >
> > > $320.00
> > >
> > > from...
> > >
> > > <asp:Label ... Text='<%# DataBinder.Eval(Container, "DataItem.Install_1",
> > > "{0:c}") %>' ...>
> > >
> > > How can I get: $320
> > >
> > > TIA
> > >
> > > JeffP....
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
>
>
>
|