hidden template column accessing thru javascript error

Last post 05-17-2008 1:59 PM by XIII. 5 replies.

Sort Posts:

  • hidden template column accessing thru javascript error

    05-15-2008, 3:01 PM
    • Member
      25 point Member
    • salim_amin
    • Member since 01-09-2008, 5:10 PM
    • Chattanooga, TN
    • Posts 36

    I have a hidden template column in gridview and i am trying to access it thru javascript but it doesnt get rendered and it thorws an error.

     Does anyone know how to access hidden column values thru javascript?

    -------------------------------------------------
    Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
  • Re: hidden template column accessing thru javascript error

    05-15-2008, 3:33 PM
    • All-Star
      124,486 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,741
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

    how did you hide the column? Setting the Visible property to false? If so it won't get rendered. Check in your rendered html if the column's actually there.

    Grz, Kris.

  • Re: hidden template column accessing thru javascript error

    05-15-2008, 3:37 PM
    • Member
      25 point Member
    • salim_amin
    • Member since 01-09-2008, 5:10 PM
    • Chattanooga, TN
    • Posts 36

    Your are right. I set the visible property to false and it doesnt get rendered.

    I found the solution which suggests to use DataKey property of gridview but then i am not able to access datakeys in javascript.

    Any idea how can i get this done?

    -------------------------------------------------
    Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
  • Re: hidden template column accessing thru javascript error

    05-15-2008, 3:45 PM
    • All-Star
      124,486 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,741
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

    take a look at http://search.live.com/results.aspx?q=javascript+hide+column+in+table&form=QBHP.

    Another possible solution would be to use jQuery. I haven't played around with it myself but a former collegue of mine did speak of it as being something really great to manipulate html with it.

    Grz, Kris.

  • Re: hidden template column accessing thru javascript error

    05-15-2008, 3:53 PM
    • Member
      25 point Member
    • salim_amin
    • Member since 01-09-2008, 5:10 PM
    • Chattanooga, TN
    • Posts 36

    I can not use JQuery as it depends on my company policy.

    I will try something else. but if you get the workaround for this, please do post it. I have been working on this issue from last couple of days.

    -------------------------------------------------
    Please: Don't forget to click "Mark as Answer" on the post that helped you. That way future readers will know which post solved your issue.
  • Re: hidden template column accessing thru javascript error

    05-17-2008, 1:59 PM
    Answer
    • All-Star
      124,486 point All-Star
    • XIII
    • Member since 06-30-2002, 11:59 PM
    • Essen, Belgium
    • Posts 13,741
    • ASPInsiders
      Moderator
      TrustedFriends-MVPs

    Hi,

    well I was looking for a solution by searching and found this solution that works on my machine: http://www.adp-gmbh.ch/web/js/hiding_column.html.

    Grz, Kris.

Page 1 of 1 (6 items)