iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
I am trying to input date time in a WebGrid with a Masked WebInput as DateTime picker. But after I changed the date value, the cell become empty.
I don't know if had made wrong settings for the WebGrid/ WebInput, I have attached Code below and the way to reproduce the issue (png file) for your reference. Please kindly assist. Thanks
ASPX Code: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="DateInGrid.aspx.vb" Inherits="IntersoftTeseting.DateInGrid" %> <%@ Register Assembly="ISNet.WebUI.WebInput" Namespace="ISNet.WebUI.WebControls" TagPrefix="ISWebInput" %> <%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISWebGrid" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="250px" UseDefaultStyle="true" Width="500px"> <LayoutSettings AllowEdit="Yes"> </LayoutSettings> </ISWebGrid:WebGrid> <ISWebInput:WebInput ID="WebInput1" runat="server"> <HighLight IsEnabled="True" Type="Phrase" /> <EditFormat Format="dd MMM yyyy" IsEnabled="true" Type="DateTime"> <MaskInfo MaskExpression="00 LLL 0000"> </MaskInfo> </EditFormat> <DisplayFormat> <ErrorWindowInfo IsEnabled="False"> </ErrorWindowInfo> </DisplayFormat> <DateTimeEditor DateInputLink="" IsEnabled="True"> <DropDownYearFrameStyle BackColor="#FFFFFF" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"> </DropDownYearFrameStyle> <DropDownMonthFrameStyle BackColor="#FFFFFF" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px"> </DropDownMonthFrameStyle> </DateTimeEditor> <CultureInfo CultureName="en-US"> </CultureInfo> </ISWebInput:WebInput> </div> </form> </body> </html>
VB Code: Imports ISNet.WebUI.WebGrid Public Class DateInGrid Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load End Sub Public Function GetDiffData() As DataTable Dim dt As New DataTable dt.Columns.Add("Str", GetType(String)) dt.Columns.Add("Int", GetType(Integer)) dt.Columns.Add("DateTime", GetType(Date)) For i As Integer = 1 To 100 dt.Rows.Add(i & "_" & i, i, Now.AddDays(i).Date) Next Return dt End Function Private Sub WebGrid1_InitializeDataSource(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid1.InitializeDataSource e.DataSource = GetDiffData() End Sub Private Sub WebGrid1_PrepareDataBinding(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid1.PrepareDataBinding Dim wg As WebGrid = sender If Not IsPostBack Then wg.RetrieveStructure() End If For Each wgcol As WebGridColumn In wg.RootTable.Columns Select Case wgcol.Name.ToLower Case "datetime" wgcol.EditType = EditType.Custom 'wgcol.DataFormatString = "dd MMM yyyy" wgcol.CustomEditorName = "WebInputNET" wgcol.CustomEditorServerId = "WebInput1" End Select Next End Sub End Class
Regards,
Fung
The cell may seem to be empty, but actually it contains a value. You can try to double-click on the empty cell to get the actual value. The reason why the cell looks empty because of the "DisplayFormat" property of WebInput is not correctly defined.
*DisplayFormat property represents display format information.
Please try to set the DisplayFormat property into something like below.
<DisplayFormat Format="dd MMM yyyy" IsEnabled="true" Type="DateTime"> <ErrorWindowInfo IsEnabled="False"> </ErrorWindowInfo> </DisplayFormat>
Hope this helps.
Thanks Yudi,
I had tried your fix, the value is now shown on the cell but the text and value always stays the same after modifying the cell (integrated with WebInput).
i.e. in the 4th step in my last uploaded .png file, the cell is now filled with text, but the text is the same as what it was (9/25/2011 12:...) instead of the date I expected.
Is there way to fix this issue?
Thanks again,
Could you confirm whether you are using the latest build of WebGrid, WebInput, WebUI.NET Framework? T tried to reproduce the problem in my local tests by creating a simple sample page based on the snippet code of your first post (plus the fix on the display format) -- everything worked smoothly and the precompiled content was accessed without any issues.
We are willing to advise you further but in order to do so we would need you to elaborate on your specific scenario and possibly give us a running simple sample and step-by-step guide that we can use to observe the problematic behavior.
You may modify the IntegrationwithWebInput.NET.aspx sample file that available in WebGridSamples project. Please send the modified sample to be investigated further.
Hi Yudi,
I am using the datepicker and I am facing the issue, onlick of text box it shows the datepicker and i am not able to type the value in text box after pressing the "Esc" key, able to type in but that also not properly working as expected. is there any option to enable typing in even the datepicker is opened.
you can refer the below linked video to understand the issue.
https://www.screencast.com/t/jchhZRCwA8hA
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname