Insert text in datagrid

  • Thread starter Thread starter Fabrizio
  • Start date Start date
F

Fabrizio

Hi,

i'm trying to use VB .NET
i have a datagrid connected to a database:

Code | Description | Price | Qty | Total

how can i calculate Total as Price*Qty?

.... or how can i insert a text in the grid? :))

Thanks,

Fabrizio
 
Hi,

I would add a calculated column to the data table. Here is an
example.

Dim dc As DataColumn

dc = New DataColumn("Price")

dc.DataType = System.Type.GetType("System.Decimal")

dc.Expression = "Quantity * Each"

dsInvoicesData.Tables(0).Columns.Add(dc)

dc = Nothing

Ken
 
Thanks a lot :)

i did it but i forgot "dc = Nothing" and i was thinking i was wrong-way :)

thanks.
 
Back
Top