Do you know how I can insert date in gridview after checkbox is checked?

Posted on 2012-08-24
Last Modified: 2012-09-12
Greetings mates,

We have checkbox in gridview where a user can check one or more boxes.

What we would like to do is to show current date for any and all checkbox(es) checked.

Can someone please help with inserting dates into gridview after a checkbox is checked or checkboxes are checked?

Here is what I have:

        For Each c As GridViewRow In gridView1.Rows
            If CType(c.Cells(0).FindControl("myrec"), CheckBox).Checked Then

                '******Need to insert today's date here whenever a checkbox is checked*****                       

End If

Open in new window

Thanks a lot in advance.
Question by:sammySeltzer
    LVL 20

    Assisted Solution

    Is it a textbox that you want to insert in?

    LVL 28

    Author Comment

    Well, it doesn't really matter if I use TextBox or label.

    What is important is that I want this date inserted only AFTER a checkbox is checked.

    In other words, if no checkboxes are checked, the date column should be blank.

    Hope this is clearer.

    LVL 83

    Accepted Solution

    May be

    c.Cells(1).value = Now.Today.ToString("dd/MM/yyyy")

    assuming you want date in 2nd column.
    LVL 28

    Author Comment

    Sorry for late response on this but I have since resolved it.

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Suggested Solutions

    Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
    Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now