VB .NET: How to extract the value of a textbox in a GridView TemplateField?

Discussion in 'General Computer Support' started by k3nz0, Feb 25, 2009.

  1. k3nz0

    k3nz0

    Joined:
    Feb 25, 2009
    Messages:
    2
    Hi All,

    I have a GridView and inside this GridView I only have one TemplateField. Inside this TemplateField, I have plenty of textboxes. Values of these textboxes are extracted from the database.

    One of the textboxes is called txt_CarFeatures (this is the ID). Value of this textbox is extracted from the database, using Bind("CarFeatures"). There is no problem populating the value into the textbox.

    My problem is how to get the value from the textbox.
    I am trying to get the value from this txt_CarFeatures textbox and use it for something else.
    For example: after getting populated, txt_CarFeatures has "abcd123" in it. I am trying to get this "abcd123" and use it for something else.

    I did some research and found some information about FindControl. But I have no idea how to use it and not sure whether this is the solution.

    Please advise. Thanks.
     
    k3nz0, Feb 25, 2009
    #1
    1. Advertising

  2. k3nz0

    k3nz0

    Joined:
    Feb 25, 2009
    Messages:
    2
    Resolved. I used the following:
    Dim test As TextBox test= CType(gridView_SearchResultDetails.Rows(0).Cells(0 ).FindControl("txt_Test1"), TextBox)
    Hope this is useful for those who have smilar issue.
     
    k3nz0, Mar 1, 2009
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. smuttdog@sc.rr.com
    Replies:
    2
    Views:
    1,673
    richard
    Dec 23, 2007
  2. gautam2u@gmail.com
    Replies:
    2
    Views:
    1,700
    ProgTalk
    Feb 7, 2008
  3. apdbrl1

    gridview textbox value refresh

    apdbrl1, Apr 10, 2008, in forum: Software
    Replies:
    1
    Views:
    1,577
    Rucheekaa
    Jun 12, 2008
  4. kanchangorak

    Get datagrid textbox value

    kanchangorak, Mar 11, 2009, in forum: Software
    Replies:
    0
    Views:
    2,863
    kanchangorak
    Mar 11, 2009
  5. arecev
    Replies:
    0
    Views:
    1,554
    arecev
    Apr 5, 2009
Loading...

Share This Page