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
  1. Home
  2. Web Development
  3. ASP.NET
  4. using toggle in datagrid

using toggle in datagrid

Scheduled Pinned Locked Moved ASP.NET
4 Posts 2 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.
  • H Offline
    H Offline
    hikbnet
    wrote on last edited by
    #1

    using toggled value with in the column like stop and start when clicking start stop should be hide and again when clicking stop then start should be hide so i have tried this using div but could not get result so anybody has suffering from such kinds of troubled and have solution then give me the hints i will be appreciates for u. hikbnet

    P 1 Reply Last reply
    0
    • H hikbnet

      using toggled value with in the column like stop and start when clicking start stop should be hide and again when clicking stop then start should be hide so i have tried this using div but could not get result so anybody has suffering from such kinds of troubled and have solution then give me the hints i will be appreciates for u. hikbnet

      P Offline
      P Offline
      Pradipta Basu
      wrote on last edited by
      #2

      In your datasource, there should be a column which denotes start or stop. let start is denoted by 1 and stop by 0. What you have to do is just write a function which will toggle the values. Or if you are using image, it will show the image of start when it is 0, and the image of stop when it is 1. the code will be something like <%# GetToggledValue(DataBinder.Eval(Container, "DataItem.Status")) %> here status is the name of the column for start and stop, and GetToggledValue() is the function.

      Pradipta Basu

      H 1 Reply Last reply
      0
      • P Pradipta Basu

        In your datasource, there should be a column which denotes start or stop. let start is denoted by 1 and stop by 0. What you have to do is just write a function which will toggle the values. Or if you are using image, it will show the image of start when it is 0, and the image of stop when it is 1. the code will be something like <%# GetToggledValue(DataBinder.Eval(Container, "DataItem.Status")) %> here status is the name of the column for start and stop, and GetToggledValue() is the function.

        Pradipta Basu

        H Offline
        H Offline
        hikbnet
        wrote on last edited by
        #3

        Thank's for your kinds hints but it may works like data list but it is difficult to implement in case of data grid if any further suggestion plz reply me okey thank's a lot . hikbnet

        P 1 Reply Last reply
        0
        • H hikbnet

          Thank's for your kinds hints but it may works like data list but it is difficult to implement in case of data grid if any further suggestion plz reply me okey thank's a lot . hikbnet

          P Offline
          P Offline
          Pradipta Basu
          wrote on last edited by
          #4

          It works with DataGrid. You have to use TemplateColumn

          Pradipta Basu

          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