Change checkbox to word in gridview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ljoo87
    New Member
    • Jan 2010
    • 3

    Change checkbox to word in gridview

    How to change the value in gridview?? For example I made the timecard in asp.net when employee checks in it goes through the database and show date and check in or out gridview (total of two column date and inout). Check in display as check in checkbox and check out display as empty check box I would like to chage it to actuall word "checked in" or "checked out" instread of check boxes... (I don't want to put in string in the database I would like to change in asp.ent)
    Could you please help me?

    Thank you
  • sanjib65
    New Member
    • Nov 2009
    • 102

    #2
    Is it something like this: when someone clicks the CheckBox(in or out) the Gridview will show the DateTime.Now ?

    Comment

    • ljoo87
      New Member
      • Jan 2010
      • 3

      #3
      No, I actually have two button one is for clock in and other one is for clock out

      And right next to it, it has the gridview when I click clock in button it will display datetime and check with the check box in gridview.
      From that gridview I would like to change the check box to a plain word.

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        The GridView displays data that it retrieves from a data source. In your case it's displaying data from the database in order to show when the person has clocked in and clocked out.

        (off track thought: what happens if the user forgets to clock out?)

        Anyways, when the user clocks in, add the record for the clock-in into the database and then refresh the data source you're using for your GridView. It will automatically show the updated data.

        **edit**

        Haha, might help if I actually read the question your asking...you didn't want to know how to refresh the GridView to show current data...you wanted to change the CheckBox column into something else.

        In order to do this you should specify the columns that you want to display in your GridView. You can use controls like the BoundField to do this for data that should be displayed "as is". For your "check in" column you should use a TemplateField control. The TemplateField control lets you format how the data should be displayed.

        It's pretty cool stuff...check out what MSDN has to say about the TemplateField and BoundField for more information.

        If you have problems with this let us know and we'll give you a hand.

        -Frinny

        Comment

        Working...