• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 696
  • Last Modified:

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

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
        Next

Open in new window


Thanks a lot in advance.
0
sammySeltzer
Asked:
sammySeltzer
  • 2
2 Solutions
 
informaniacCommented:
Is it a textbox that you want to insert in?

DateTime.Now.ToString("dd/MM/yyyy")
0
 
sammySeltzerAuthor Commented:
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.

Thanks
0
 
CodeCruiserCommented:
May be

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

assuming you want date in 2nd column.
0
 
sammySeltzerAuthor Commented:
Sorry for late response on this but I have since resolved it.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now