TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mada Black
NA
67
3.1k
Calculate Sum Total in Column Gridview by Key Enter
Nov 19 2020 6:11 PM
Please i need your help
I have 3 columns .. column Price ( 4 ) , columns Quantite ( 5 ) and column Total ( 6 ) .. I want by Key Press when i update cell in column Quantity ( 5 ) then the sum changes automatically in columns Total ( 6 ) .. i tried like this but it does not work ..
Private Sub GridView1_KeyDown(sender As Object, e As KeyEventArgs) Handles GridView1.KeyDown
If e.KeyCode = System.Windows.Forms.Keys.Enter Then
Auto_Row_Calculation()
End If
End Sub
Private Sub Auto_Row_Calculation()
Dim GridQuantite As Integer = 0
Dim GridPrice As Decimal = 0.0
Dim GridTotal As Decimal = 0.0
For I As Integer = 0 To GridView1.RowCount - 1
GridPrice = Me.GridView1.GetRowCellValue(I, GridView1.Columns(4)).ToString
GridQuantite = Me.GridView1.GetRowCellValue(I, GridView1.Columns(5)).ToString
GridTotal = Val(GridPrice) * Val(GridQuantite)
Me.GridView1.SetRowCellValue(I, 6, GridTotal.ToString)
Next
End Ssub
Thank you in advance for help
Reply
Answers (
4
)
A Varaible is declared as int x and another varaible is declared as st
Read a csv file using 2D array