Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp.net 4.0 how to show date in Calendar inside Gridview in Edit mode

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
the yellow highlight gives error running the page
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Two-way binding is only supported for properties. 'Text' is not a valid property on 'Calendar'

How can I have the calendar show the "DateofIssue" while in edit mode?

Code:
          <asp:TemplateField HeaderText="DateofIssue" SortExpression="DateofIssue">
                <EditItemTemplate>
                    <asp:Calendar ID="DateofIssueCalEdit" [highlight #FCE94F]Text='<%# Bind("DateofIssue") %>'>[/highlight] runat="server" >
                        </asp:Calendar>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="DateofIssueCalItem" runat="server" Text='<%# Bind("DateofIssue") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>

DougP
 

By "show" do you mean the SelectedDate?


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
MarkSweetland, yes the date that is in the column, have it highlighted in the Calendar.
Right now it does not show any date when I click Edit.

DougP
 

You'll have to bind both the SelectedDate and the VisibleDate properties to the same date. Even though you can set the SelectedDate to the desired date, the calendar will popup with the current date visible which may or may not be in the same month/year of the selected date. VisibleDate will change the month/year the calendar shows.


Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top