Hello,
I'm trying to integrate the Dnn calendar in my gridview (in edit mode).
I have a date field in my database, when I want to edit a row, I need to have a textbox with a link 'calendar' next to it. When clicking on the link, it shows the calendar in popup, and after chossing a date, it appears it the textbox... My problem is that I CAN'T acces the textbox control of this specific row to change the calendar link.
this is the navigateUrl of the link:
MyLink.NavigateUrl = CType(DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(MyTextBox), String)
I tried in a form view, and everything is perfect...
-----------------------------------
DateStart:
<asp:textbox id="tb_dateStart" columns="20" Text='<%# Bind("DateStart") %>' runat="server" MaxLength="20"></asp:textbox>
<asp:hyperlink id="cal_dateStart" runat="server" text="calendar"></asp:hyperlink>
<asp:comparevalidator id="valMembershipExpires2" runat="server" display="Dynamic"
controltovalidate="tb_dateStart" ErrorMessage="Invalid date" type="Date" operator="DataTypeCheck">
</asp:comparevalidator>
AND IN MY VB CODE
Protected Sub FormView1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles FormView1.DataBound
DirectCast(FormView1.FindControl("cal_dateStart"), HyperLink).NavigateUrl = CType(DotNetNuke.Common.Utilities.Calendar.InvokePopupCal(DirectCast(FormView1.FindControl("tb_dateStart"), TextBox)), String)
End Sub
------------------------------------
My probleme is that FindControl("tb_dateStart") does't work in the GridView....
I need to find the right ROW but I didn't find the correct code, or maybe it's not called in the right event...
-----------------------------
my Gridview code:
<EditItemTemplate>
<asp:textbox id="tb_dateStart1" tabIndex="23" columns="20" Text='<%# Bind("DateStart") %>' runat="server" MaxLength="20"></asp:textbox>
<asp:hyperlink id="cal_dateStart1" tabIndex="-1" runat="server" text="calendar" ondatabinding="cal_dateStart1_DataBinding"></asp:hyperlink>
<asp:comparevalidator id="valMembershipExpires1" runat="server" display="Dynamic"
controltovalidate="tb_dateStart1" ErrorMessage="Invalid date" type="Date" operator="DataTypeCheck">
</asp:comparevalidator>
</EditItemTemplate>
--------------------------------
I need to change the NavigateURL of my calendar link, but I need to put the textbox control in that link, but I don't find that textbox...
Any solution?