Jump to content
SingaporeBikes.com Telegram Now LIVE! Join NOW for the Last Reviews, News, Promotions & Offers in Singapore! ×
  • Join SingaporeBikes.com today! Where Singapore Bikers Unite!

    Thank you for visiting SingaporeBikes.com - the largest website in Singapore dedicated to all things related to motorcycles and biking in general.

    Join us today as a member to enjoy all the features of the website for FREE such as:

    Registering is free and takes less than 30 seconds! Join us today to share information, discuss about your modifications, and ask questions about your bike in general.

    Thank you for being a part of SingaporeBikes.com!

Recommended Posts

Posted

It really depends on your implementation for your datagrid...

if those are queried from DB then you can do this..

 

i assume its like a shopping cart with each cart having a manifest number.

then the implementation will be

 

after you fill ur dataset with the items data,

you can do this.

 

dim row ds.tables[0].rows.newrow() as Datarow

 

row["columnnamefordescription"] = "total"

 

change ur command syntax to

cmd.commandstring = "select sum(price *qty) from carttable where manifestId = @id"

cmd.parameters.clear()

cmd.parameters.add("@id",manifestID)

 

cn.open()

dim dr = cmd.executedatareader as DataReader

dr.read

row["columnnameforamount"] = dr[0]

cn.close()

 

ds.tables.rows.add(row)

 

then do ur databinding...

add in error handling as well..

Walk a thousand miles.

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Private Sub DataGrid1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.SelectedIndexChanged

Dim indexes As String

Dim images As String

 

 

 

'indexes = DataGrid1.SelectedItem.Cells(2).Text

'images = DataGrid1.SelectedItem.Cells(3).Text

 

 

' Global variable

Dim sum As Integer = 0

 

' Loop through gridview

For Each item As DataGridItem In DataGrid1.Items

 

' first column value in the gridview

sum += CInt(row.Cells(0).Text) ------------> i duno what to declare row as.??

Next row

 

Label13.Text = indexes

Label14.Text = images

 

End Sub

:cheers:
Posted

i suggest u store ur dataset in your cache or session..

then u access your data using the index in the dataset

 

ds.tables[0].rows[DataGrid1.selectedIndex]

Walk a thousand miles.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • DAIS_ShellBAU2024_Motorcycle_SingaporeBikesBanner_300x250.jpg

     
×
×
  • Create New...