Hi folks,
I've been struggling with this for a few hours and I'm hoping someone can help me out. On my GridView (with C# codebehind) I have a date entry field. To help users enter only valid dates, I had a read only label to display the date and a button that will open a modal dialog box with a Calendar item.
I can get the value entered from the modal window just fine and can pass it back to the calling window just fine, but my problem is, how do I get it into the specific GridView row and the display label?
Here is the bit of code in ASP:
In this case, "due_date" is the label where I want the date to display and "lnkCalenda r" is the link to open the modal dialog box.
And here is the code in the codebehind that sets up the modal dialog box during the RowDataBound event:
The "???" shown in the javascript is where I'd normally put the return value for non-GridView items, so I'm not sure at this point how to move forward.
Any help is greatly appreciated.
Robert
I've been struggling with this for a few hours and I'm hoping someone can help me out. On my GridView (with C# codebehind) I have a date entry field. To help users enter only valid dates, I had a read only label to display the date and a button that will open a modal dialog box with a Calendar item.
I can get the value entered from the modal window just fine and can pass it back to the calling window just fine, but my problem is, how do I get it into the specific GridView row and the display label?
Here is the bit of code in ASP:
Code:
<FooterTemplate>
<asp:Label ID="due_date" runat="server" Text='<%# Bind("due_date") %>'></asp:Label>
<asp:HyperLink id="lnkCalendar" runat="server" ImageUrl="im_calendar.gif"></asp:HyperLink>
</FooterTemplate>
And here is the code in the codebehind that sets up the modal dialog box during the RowDataBound event:
Code:
HyperLink DueDateLink = (HyperLink)GridView3.FooterRow.FindControl("lnkCalendar");
DueDateLink.Attributes.Add("onclick", "var strReturn; strReturn=window.showModalDialog('Calendar.aspx',null,'status:no;dialogHeight:290px;dialogWidth:300px;dialogHide:true;help:no;scroll:no');if (strReturn != null) document.getElementById('???').value=strReturn;");
Any help is greatly appreciated.
Robert
Comment