How to Access LinkButton.Text

J

JeffP@Work

I need to know when a link buttons value is zero so I don't try to run a
query to find none.

When I was using ViewState(ds_Last), which I can't do because certain phones
are choking on the data, I have on avg about 12 rows of data.

Apparently that's way too much data for some phones, nearing 30k.

So I've abondoned ViewState and I'm trying to get the value from the
datagrid, I see that it can be done but I may be missing something that will
make it all work.

'This works well... (except for ViewState overhead)
Dim myRow as DataRow = CType(ViewState("ds_Last"),
DataSet).Tables(0).Rows(e.Item.ItemIndex)
Case Right(sCoMander,1) = "S"
.... intEventCount = myRow.Item("Sales")....
If intEventCount >= 1 Then... do stuff load next datagrid of "Sales"

'populate my datagrid
dgFutureSM.DataSource = dsF.Tables(0)
dgFutureSM.DataBind()

'renders a datagrid similar to.....
|Future Data
SalesPerson, Calls, Apts, Sales, Totals
-------------------------------------
Gilia Swifting 12 7 6 25
Steve Colbert 32 9 8 49
Rusty Nail 6 1 0 7

<asp:Datagrid ... DataKey="UserID"....
<asp:TemplateColumn HeaderText="Sales"....
<asp:LinkButton id="btnSelectSMFS" CommandName=="SelectSalesSMFS"....

Selecting Rusty Nail's Sales link button value zero, or any link button
renders an empty string

Pvt Sub dgSM_ItemCmd(byVal Src as obj, byVal e as
Sys.Web.UI.WebCtrls.DgCmdEventArgs) handles dgHistorySM.ItemCmd,
dgFuture.ItemCmd

'get current dg name
Dim dg as DataGrid = e.Items.NamingContainer

'get index UserID for nxt sProc
Dim UserID as String = dg.DataKeys(e.Item.ItemIndex)

'get nxt step, FS, load future sales for respective UserID
Dim sCoMander as String = Right(e.CommandName,2)

'here's where I'm failing, I know which cell it is, I've verified the ID,
however I've stepped thru all of my linkbuttons and their text value = ""
Dim lnkBtnText as String = Ctype(e.Item.Cells(1).Controls(1),
LinkButton).Text

If I check column(4) which is an <asp:BoundColumn of totals, I do see the
value "7" but not in any of my linkbuttons for columns Calls, Apts and
Sales.

TIA

JeffP....
If you think this is crossposted that's only because there wasn't any
action....
 
J

JeffP@Work

My error, <asp:TemplateColumns with a linkButton: although intellisense
doesn't offer a Text= adding it as Text='<% # DataBinder.Eval(Container,
"DataItem.FieldName") %>... JeffP....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top