Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > GridView problem

Reply
Thread Tools

GridView problem

 
 
Sze
Guest
Posts: n/a
 
      04-28-2010
Private Sub GridViewLocalChargeDetail_RowUpdating(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
GridViewLocalChargeDetail.RowUpdating

Dim txtModBillingType As TextBox =
DirectCast(GridViewLocalChargeDetail.Rows(e.RowInd ex).FindControl("txtBillingType"),
TextBox)
When I set the column 's visible = false
the txtModBillingtype.text become blank.

I don't want to display the column, but I need to get the value

Please help.
thanks in advance


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      04-28-2010
On Apr 28, 12:38*pm, "Sze" <a...@abc.com> wrote:
> *Private Sub GridViewLocalChargeDetail_RowUpdating(ByVal sender As Object,
> ByVal e As System.Web.UI.WebControls.GridViewUpdateEventArgs) Handles
> GridViewLocalChargeDetail.RowUpdating
>
> * * *Dim txtModBillingType As TextBox =
> DirectCast(GridViewLocalChargeDetail.Rows(e.RowInd ex).FindControl("txtBilli ngType"),
> TextBox)
> When I set the column 's visible = false
> *the txtModBillingtype.text become blank.
>
> I don't want to display the column, but I need to get the value
>
> Please help.
> thanks in advance


You can get a datakey from the current row

GridViewLocalChargeDetail.DataKeys[e.RowIndex].Value

and use it to request the data from the datasource
 
Reply With Quote
 
 
 
 
Mark Rae [MVP]
Guest
Posts: n/a
 
      04-28-2010
"Alexey Smirnov" <> wrote in message
news:28a25734-b405-4a0e-afdb-...

> You can get a datakey from the current row


Assuming you add it to the DataKeyNames property of the GridView first:
http://msdn.microsoft.com/en-us/libr....datakeys.aspx


--
Mark Rae
ASP.NET MVP
http://www.markrae.net

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gridview inside gridview problem Vik ASP .Net 1 05-11-2009 10:07 PM
GridView RowCommand problem: GridView Nested in Repeater HeavyMetal ASP .Net Web Controls 0 08-08-2006 01:17 PM
GridView Hierarchical View - Gridview in Gridview =?Utf-8?B?bWdvbnphbGVzMw==?= ASP .Net 1 05-09-2006 06:48 PM
GridView in a GridView Nalaka ASP .Net 6 12-05-2005 05:48 PM
Gridview with combobox whose data is dependent on field in gridview wallermj@hotmail.com ASP .Net 3 11-21-2005 05:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57