Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Problem with a Calendar in DetailsView

Reply
Thread Tools

Problem with a Calendar in DetailsView

 
 
jerome.decouenne@gmail.com
Guest
Posts: n/a
 
      05-22-2006
Hello all!

I send you this message because I'm a bit lost... I've tried to solve
my problem since yesterday, and I haven't found any solution, even here
"http://www.webswapp.com/codesamples/viewsource.aspx?file=~/codesamples/aspnet20/dependentlists/default.aspx".
The fact is that I want to put an asp:Calendar control in the
EditItemTemplate of a DetailsView. It works fine, until I select a day,
where i find this error : "Databinding methods such as Eval(), XPath(),
and Bind() can only be used in the context of a databound control.".
I think the problem comes from the calendar onselected event but I'm
not sure how to manage it.
Can somebody help me pliz?

Jérôme DECOUENNE

Here is my code:
<aspetailsView ID="DetailsView1" runat="server"
DataSourceID="SqlDataSourceAllDocumentForDetailsVi ew"
AutoGenerateRows="False" DataKeyNames="DocumentId"
DataMember="DefaultView" DefaultMode="Edit"
Caption="<br/><h1>Modifier un
document<br/>&nbsp;&nbsp;<i>Edit a document</i></h1>"
CssClass="DetailsView" BorderWidth="0px"
HorizontalAlign="Center">
<FieldHeaderStyle CssClass="DetailsViewHeader" />
<Fields>
<asp:TemplateField HeaderText="Titre
:&lt;br&gt;  &lt;i&gt;Title:&lt;/i&gt;">
<EditItemTemplate>
<asp:TextBox ID="txtEditName" runat="server"
Text='<%# Bind("Name") %>'></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Crée le
:&lt;br&gt;  &lt;i&gt;Created on:&lt;/i&gt;">
<EditItemTemplate>
<br />
<asp:Calendar ID="editCreationDateCalendar"
runat="Server" VisibleDate='<%# Eval("CreationDate") %>'
SelectedDate='<%# Bind("CreationDate")
%>'></asp:Calendar>


</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Description
:&lt;br/&gt;  &lt;i&gt;Description:&lt;/i&gt;">
<EditItemTemplate>
<br />
<asp:TextBox ID="txtEditDescription"
runat="server" Text='<%# Bind("Description") %>'
Rows="4" TextMode="MultiLine"
Width="339px"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Type
:&lt;br/&gt;  &lt;i&gt;Type:&lt;/i&gt;">
<EditItemTemplate>
<br />
<aspropDownList runat="server"
ID="ddlEditType" DataSourceID="sqlDataAllDocumentTypes"
DataTextField="Name"
DataValueField="DocumentTypeId" SelectedValue='<%#
Bind("DocumentTypeId") %>'
OnDataBound="ddlEditType_DataBound">
</aspropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Comité
:&lt;br/&gt;  &lt;i&gt;Committee:&lt;/i&gt;">
<EditItemTemplate>
<br />
<aspropDownList ID="ddlEditCommittee"
runat="server"
AppendDataBoundItems="true"
DataTextField="Name" DataValueField="CommitteeId"
SelectedValue='<%# Bind("CommitteeId") %>'
OnLoad="ddlEditCommittee_Load">
<asp:ListItem Selected="True"
Value="">-</asp:ListItem>
</aspropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Langue
:&lt;br/&gt;  &lt;i&gt;Language:&lt;/i&gt;">
<EditItemTemplate>
<br />
<aspropDownList ID="ddlEditLanguage"
runat="server" AppendDataBoundItems="true"
SelectedValue='<%# Bind("DocLanguage") %>'>
<asp:ListItem Value="FR">FR</asp:ListItem>
<asp:ListItem Value="EN">EN</asp:ListItem>
</aspropDownList>
</EditItemTemplate>
</asp:TemplateField>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<br />
<asp:Button ID="DetailViewUpdateButton"
runat="server" CommandName="Update" CommandArgument='<%#
Eval("DocumentId") %>'
Text="Update"
OnCommand="DetailViewUpdate_Command"></asp:Button>
<asp:Button ID="DetailViewCancelButton"
runat="server" CausesValidation="False" CommandName="Cancel"
Text="Cancel"
OnCommand="DetailViewCancel_Command"></asp:Button>
</EditItemTemplate>
<ItemStyle HorizontalAlign="Right" />
</asp:TemplateField>
</Fields>
</aspetailsView>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with calendar control in DetailsVIew using ASP.NET aj ASP .Net Web Controls 0 05-14-2010 08:16 PM
How can I access a calendar control inside a detailsview control? Tamer Ibrahim ASP .Net Datagrid Control 3 01-30-2007 11:02 PM
DetailsView using Calendar Control in EditItemTemplate K B ASP .Net 0 04-20-2006 03:22 AM
DetailsView - Changing to Insert Mode (Not By Using the Insert Button In the DetailsView Control) Feege ASP .Net Web Controls 0 12-20-2005 12:28 AM
Thunderbird Calendar with Exchange 2003 Calendar and Public FoldersCalendar jincmcse Firefox 1 09-03-2005 02:46 AM



Advertisments