0
votes

I am using a ASP.NET GRIDVIEW. The column I am interested in is the "CHECKED IN" column that contains a checkbox and a label.

Grid View Image

The grid can bring back many lines of data from the database:

Columns of grid

Here's what I need to do:

  1. When the 'Checked IN' checkbox is clicked. I would like the DataTime picker to appear. [Checkbox is checked and Datatime picker appears][3]

checked in Checkbox 2. When the user has selected a date and time, I would like the value to appear in the label next to the Checked in checkbox. DateTime to show only when it has been selected.

[Label is updated][4]

Hope this makes sense?

The only issue is that the GridView creates itself dynamically.

1
Can you please fix your links? I'd like to help but think the third and fourth might aid me in trying to assist. - Tyler Roper

1 Answers

0
votes

Thanks for your message.

I did resolve this, however I slightly changed what I was doing.

Here's my code...

    $(".CheckOut").each(function () {
        $(this).datetimepicker({
            dateFormat: 'dd/mm/yy',
            onClose: function (selectedDateTime) {

                return Validate(this, this.id);
            }
        });
    });

This code is exactly what I needed for the date/time picker to work within a GridView.