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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nityaprashant
    New Member
    • Feb 2008
    • 19

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

    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(ByVa l sender As Object, ByVal e As GridViewRowEven tArgs) Handles GridView1.RowDa taBound
    Dim dgitem As GridViewRow
    Dim lnkbtnremove As LinkButton

    Dim a As Label

    For Each dgitem In GridView1.Rows
    a = dgitem.FindCont rol("lblinprodn ame")
    lnkbtnremove = dgitem.FindCont rol("lnkRemove" )
    'b = GridView1.Rows. Item().RowIndex

    lnkbtnremove.At tributes.Add("o nclick", "return confirm('Are you sure you want to Remove?')")
    Next

    '' ''objpropproduc tmaster.prod_id = a.Text
    '' ''ds = objbalproductma ster.fatchprodu ctnamedelete(ob jpropproductmas ter)
    '' ''For Each dr In ds.Tables(0).Ro ws
    '' '' 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)
    objpropTransact ion.trans_id = transid
    objpropTransact ion.prod_id = prodid
    objbalTransacti on.DeleteItemFr omCart(objpropT ransaction)
    End Function

    'when particular button is clicked within cart
    Protected Sub GridView1_RowCo mmand(ByVal sender As Object, ByVal e As System.Web.UI.W ebControls.Grid ViewCommandEven tArgs) Handles GridView1.RowCo mmand
    If (e.CommandName = "del") Then
    Dim prodid As String
    prodid = e.CommandArgume nt
    Dim prodname As String
    prodname = e.CommandArgume nt
    del(prodid, storeidcheck)
    bindgrid()
    If GridView1.Rows. Count <= 1 Then
    Session.Add("ca rtempty", "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.rowbo und event...so

    thanking u in advanced..

    Regards..
    Nitya
Working...