473,385 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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(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
0 1045

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

Similar topics

0
by: hammad.awan_nospam | last post by:
Hello, I am using ASP.NET 2.0. What I have done is nested a gridview inside another column of a gridview using a template data field column declaritively in my web form. Inside this child...
0
by: Yog | last post by:
Hi, How to access the value of a Texbox column(Template field) in gridview and to update a column next to it in the Gridview...! Example:Let's say there are four columns Product,Cost,Quantity...
5
by: sutphinwb | last post by:
Hi - This could be a simple question. When I relate two tables in a datasetet, how do I get that relation to show up in a GridView? The only way I've done it, is to create a separate table in the...
3
by: Gunawan | last post by:
Dear All, I have data which display on the GridView. GridView contain 3 Column (ProductId, ProductCode and Description). I would like to display only Product Code and Description so I hide...
4
by: =?Utf-8?B?QmFidU1hbg==?= | last post by:
Hi, I have a GridView and a SqlDataSource controls on a page. The SqlDataSource object uses stored procedures to do the CRUD operations. The DataSource has three columns one of which -...
0
by: =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?= | last post by:
Hi, I am designing a ASP.NET 2.0 front end for an activity based costing model and am interested in getting some general guidance on what design route to take. I can work out the specifics but...
3
by: =?Utf-8?B?Um9iZXJ0IENoYXBtYW4=?= | last post by:
Hi, I have a GridView with a fixed number of columns being returned from a SQL query and each having a simple template: <asp:TemplateField HeaderText="Allocations"> <edititemtemplate>...
0
by: nityaprashant | last post by:
hello.. i had done below logic again.. but it doesn't give selected row's product name. it's gives all row's product name...particularly last row's product name.. i need selected row's...
4
by: Craig Buchanan | last post by:
I dynamically add data-bound templates to a gridview in my ascx control. while this works correctly when the gridview is databound to the datatable, i'm having issues on postback. i would like...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.