Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add another coulmn to datagrid

Status
Not open for further replies.

mchoudhury

Programmer
Nov 26, 2004
71
GB
hi guys
I have this table with these columns:

TelephoneServicePlanID TelephoneCallPlanID ServicePlanName LocationConnectionCharge MonthlyFee

I want to add another column to the table call Annual Price and inside that column each, value should be inserted according to FinalResult which i have stored in a n object. I'm using datagrid and databing but it does not allow me to add the column does anyone know how i could go about doing this:

FinalTotal2 = MCLocalTotal + MCNationalTotal + MCTotalCountries + MobileTotal

dtSavings = FRI.SOMB.Visitor.DataProvider.getTelephoneServicePlan()

dtSavings.Columns.Add("AnnualPrice")
Dim dr As DataRow
dr = dtSavings.NewRow
dr("AnnualPrice") = FinalTotal2
dtSavings.Rows.Add(dr)
 
Untested, but it might help:

Code:
sub PopulateDataGrid

 dim dtSavings as data.datatable
 dim dr as data.datarow
 dim dTotal as decimal
 dtSavings = FRI.SOMB.Visitor.DataProvider.getTelephoneServicePlan()
 dtSavings.Columns.Add("AnnualPrice")
 
 for each dr in dtSavings.Rows
   dTotal = SomeFunction(parameters base off row data)
   dr.item("AnnualPrice") = dTotal
   dr.AcceptChanges 
 next

 dgTeleInfo.DataSource = dtSavings
 dgTeleInfo.refresh
end sub

-Rick

----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top