Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Enable Textbox on Gridview

Enable Textbox on Gridview

Scheduled Pinned Locked Moved ASP.NET
questionhelptutorial
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Terick
    wrote on last edited by
    #1

    Hi, I have a gridview with a textbox template field. On two pages I need this textbox to be enabled but on a third page it must be disabled. What is the best way to do this? My gridview is a user control. Right now I'm doing this:

    If I change enabled to true then on all the pages the textbox is editable. Is there a way I can call the textbox property in the user control to enable or disable the textbox? For example (this isnt working though):

    public bool EnableTextBox
    {
    get
    {
    return txtSize.Enabled;
    }
    set
    {
    txtSize.Enabled=Value;
    }
    }

    Please help! Thanks =)

    C X 2 Replies Last reply
    0
    • T Terick

      Hi, I have a gridview with a textbox template field. On two pages I need this textbox to be enabled but on a third page it must be disabled. What is the best way to do this? My gridview is a user control. Right now I'm doing this:

      If I change enabled to true then on all the pages the textbox is editable. Is there a way I can call the textbox property in the user control to enable or disable the textbox? For example (this isnt working though):

      public bool EnableTextBox
      {
      get
      {
      return txtSize.Enabled;
      }
      set
      {
      txtSize.Enabled=Value;
      }
      }

      Please help! Thanks =)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The obvious way is to set your enabled property from a code behind property, and then set that in code.

      Christian Graus Driven to the arms of OSX by Vista.

      1 Reply Last reply
      0
      • T Terick

        Hi, I have a gridview with a textbox template field. On two pages I need this textbox to be enabled but on a third page it must be disabled. What is the best way to do this? My gridview is a user control. Right now I'm doing this:

        If I change enabled to true then on all the pages the textbox is editable. Is there a way I can call the textbox property in the user control to enable or disable the textbox? For example (this isnt working though):

        public bool EnableTextBox
        {
        get
        {
        return txtSize.Enabled;
        }
        set
        {
        txtSize.Enabled=Value;
        }
        }

        Please help! Thanks =)

        X Offline
        X Offline
        Xmen Real
        wrote on last edited by
        #3

        protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
        if (e.NewPageIndex == 2){ } // Disable here
        else{ } // Enable here
        GridView1.PageIndex = e.NewPageIndex;
        BindData();
        }

        TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups