Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
556
editing a datetime field in a webdatgrid
posted

It is bound to a DateTime field that can be edited.  I am not sure how to get the date on the RowEditingTemplate in a control where the date time can be modified and validated.  I have been trying to use a Peter Plum DateTextBox but the setting the starting date to the cell value has not been going well.  It actually does the database update on the DateTime field, but I lose the beginning time and I get a date with a 12:00 AM time on it.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

<ig:WebDataGrid ID="wdgCMSVSVNCallDates" runat="server" Height="350px"

 

 

Width="400px" AutoGenerateColumns="False"

 

 

DataSourceID="sqldsCMSVSVNCallDates" DataKeyFields="Conf_Num"

>

 

 

<Behaviors

>

 

 

<ig:EditingCore

>

 

 

<Behaviors

>

 

 

<ig:RowEditingTemplate EditModeActions-MouseClick="Double" OKButton="btnUpdate" CancelButton

="btnCancel">

 

 

<EditModeActions MouseClick="Double"

/>

 

 

<ClientBindings

>

 

 

<ig:RowEditingClientBinding ColumnKey="CallTime" ControlID="dtbCallDate"

 

 

GetValueJavaScript

="$get({ClientID}).value"

 

 

SetValueJavaScript="$get({ClientID}).value={value}"

/>

 

 

</ClientBindings

>

 

 

<Template

>

 

 

<table

>

 

 

<tr

>

 

 

<td

>

 

 

<des:DateTextBox ID="dtbCallDate" runat="server" AutoHint="False"></des:DateTextBox

>

 

 

</td

>

 

 

</tr

>

 

 

<tr

>

 

 

<td

>

 

 

<asp:Button ID="btnUpdate" runat="server" Text="Update"

/>

 

 

</td

>

 

 

<td

>

 

 

<asp:Button ID="btnCancel" runat="server" Text="Cancel"

/>

 

 

</td

>

 

 

</tr

>

 

 

<tr

>

 

 

<td

>

 

 

</td

>

 

 

</tr

>

 

 

</table

>

 

 

</Template

>

 

 

</ig:RowEditingTemplate

>

 

 

</Behaviors

>

 

 

</ig:EditingCore

>

 

 

<ig:RowSelectors

>

 

 

</ig:RowSelectors

>

 

 

<ig:Activation

>

 

 

</ig:Activation

>

 

 

</Behaviors

>

 

 

<Columns

>

 

 

<ig:BoundDataField DataFieldName="Conf_Num" Key

="Conf_Num">

 

 

<Header Text="Conf_Num"

/>

 

 

</ig:BoundDataField

>

 

 

<ig:BoundDataField DataFieldName="CallTime" Key

="CallTime">

 

 

<Header Text="CallTime"

/>

 

 

</ig:BoundDataField

>

 

 

<ig:BoundDataField DataFieldName="Category" Key

="Category">

 

 

<Header Text="Category"

/>

 

 

</ig:BoundDataField

>

 

 

</Columns

>

 

 

</ig:WebDataGrid

>

 

 

<asp:SqlDataSource ID="sqldsCMSVSVNCallDates" runat="server"

 

 

ConnectionString="<%$ ConnectionStrings:Springwise %>"

 

 

SelectCommand="GetCMSVSVNCallDatesByConfNumArray"

 

 

UpdateCommand="UpdateCMSVSVNCallDatesCallTime"

 

 

SelectCommandType="StoredProcedure" UpdateCommandType

="StoredProcedure">

 

 

<SelectParameters

>

 

 

<asp:Parameter Name="ConfNums" Type="String" DefaultValue="<ArrayOfString><string Conf_Num='~!@#$' /></ArrayOfString>"

/>

 

 

</SelectParameters

>

 

 

<UpdateParameters

>

 

 

<asp:Parameter Name="Conf_Num" Type="String"

/>

 

 

<asp:Parameter Name="CallTime" Type="DateTime"

/>

 

 

</UpdateParameters

>

 

 

</asp:SqlDataSource

>

 

 

</ContentTemplate

>