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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top