By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,016 Members | 1,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,016 IT Pros & Developers. It's quick & easy.

GridView + Template Column + fatch product Name for particular row.

P: 19
Hello..

could u plz help me?

i have template column inside grid view..

in that one link button called Remove this? when i click on that link button confirmation box like "Are u sure u want to remove this?" is appeared..

now in template column product name is also in label..

so now i want that when i click on particular row's link button(Remove this?) then confirmation displayed like "Are u sure u wnat to remove this Bangjadtar?(Product Nmae) Dynamically for each row..

what i had done is pasted below...(in vb.net)

Sub ComputeSum(ByVal sender As Object, ByVal e As GridViewRowEventArgs) Handles GridView1.RowDataBound
Dim dgitem As GridViewRow
Dim lnkbtnremove As LinkButton

Dim a As Label

For Each dgitem In GridView1.Rows
a = dgitem.FindControl("lblinprodname")
lnkbtnremove = dgitem.FindControl("lnkRemove")
'b = GridView1.Rows.Item().RowIndex

lnkbtnremove.Attributes.Add("onclick", "return confirm('Are you sure you want to Remove?')")
Next

'' ''objpropproductmaster.prod_id = a.Text
'' ''ds = objbalproductmaster.fatchproductnamedelete(objprop productmaster)
'' ''For Each dr In ds.Tables(0).Rows
'' '' b = dr(0)
'' ''Next

'' ''Dim i As Integer
'' ''Dim name As Label
'' ''For i = 0 To i < GridView1.Rows.Count - 1
'' '' name = GridView1.Rows(i).FindControl("lblinprodname")
'' ''Next
End Sub


-------------------

'for deleting particular item from cart
Public Function del(ByVal prodid As String, ByVal transid As String)
objpropTransaction.trans_id = transid
objpropTransaction.prod_id = prodid
objbalTransaction.DeleteItemFromCart(objpropTransa ction)
End Function

'when particular button is clicked within cart
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs ) Handles GridView1.RowCommand
If (e.CommandName = "del") Then
Dim prodid As String
prodid = e.CommandArgument
Dim prodname As String
prodname = e.CommandArgument
del(prodid, storeidcheck)
bindgrid()
If GridView1.Rows.Count <= 1 Then
Session.Add("cartempty", "True")
End If
End If
End Sub

----
but it gives only last row's product name...

i want each row's column name...
plz help me..

check bold letters also..bez computesum handels gridview1.rowbound event...so

thanking u in advanced..

Regards..
Nitya
Feb 21 '08 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.