473,385 Members | 1,661 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.

Get cell string value from datagrid

Hi,

I have a datagrid with 2 columns. 1 is a bound column and the other one is a
button column configured as a link button. When I click the link button, the
ItemCommand Event fires as it is supposed to. I am able to get the value
from the first column using

e.item.cells(0).text

but I need to get the string value from the link button that was clicked, So
obviously I thought I would get that from

e.item.cells(1).text

But this always returns a empty string....

Am I doing something wrong, or is there another way I can get this value ?
Regards

Niclas
Nov 18 '05 #1
2 3344
Niclas,

In your ItemCommand procedure, do this:

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Respond to item being clicked
Dim btn As LinkButton = CType(e.CommandSource, LinkButton)

Select Case btn.Text
Case "Details"

....etc...

End Select
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Regards,

Alec
"Niclas Lindblom" <no********************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a datagrid with 2 columns. 1 is a bound column and the other one is a button column configured as a link button. When I click the link button, the ItemCommand Event fires as it is supposed to. I am able to get the value
from the first column using

e.item.cells(0).text

but I need to get the string value from the link button that was clicked, So obviously I thought I would get that from

e.item.cells(1).text

But this always returns a empty string....

Am I doing something wrong, or is there another way I can get this value ?
Regards

Niclas

Nov 18 '05 #2
Cool, Thanks !

"alec maclean" <al**********@copeohs.com.NO_SPAM> wrote in message
news:ub*************@TK2MSFTNGP11.phx.gbl...
Niclas,

In your ItemCommand procedure, do this:

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Respond to item being clicked
Dim btn As LinkButton = CType(e.CommandSource, LinkButton)

Select Case btn.Text
Case "Details"

...etc...

End Select
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Regards,

Alec
"Niclas Lindblom" <no********************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a datagrid with 2 columns. 1 is a bound column and the other one
is

a
button column configured as a link button. When I click the link button,

the
ItemCommand Event fires as it is supposed to. I am able to get the value
from the first column using

e.item.cells(0).text

but I need to get the string value from the link button that was clicked,

So
obviously I thought I would get that from

e.item.cells(1).text

But this always returns a empty string....

Am I doing something wrong, or is there another way I can get this value
?
Regards

Niclas


Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephen | last post by:
I'm trying to work with a datagrid column in order to display a tooltip in a datagrid cell. The reason I am doing this is because I have some long strings being returned and I don't want the rows...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
21
by: coleenholley | last post by:
I've been trying since last Friday to get an answer on how to get a SPECIFIC row.cell value from a datagrid. I've had plenty of suggestions, but nothing works to get the value from a SPECIFIC Row...
4
by: Roger | last post by:
I have a datagrid and would like to know what even fires when a cell is changed? I want to know when the user changes a cell and moves to the next. I have some code that needs to be done to...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.