Unable to Integrating WebInput in Webgrid for date time input is not working

4 replies. Last post: July 17, 2019 7:57 AM by Yatendra Sharma
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Fung InterMember


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">
<head runat="server">
    <form id="form1" runat="server">
        <ISWebGrid:WebGrid ID="WebGrid1" runat="server" Height="250px" UseDefaultStyle="true"
            <LayoutSettings AllowEdit="Yes">
        <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">
                <ErrorWindowInfo IsEnabled="False">
            <DateTimeEditor DateInputLink="" IsEnabled="True">
                <DropDownYearFrameStyle BackColor="#FFFFFF" BorderColor="Black" BorderStyle="Solid"
                <DropDownMonthFrameStyle BackColor="#FFFFFF" BorderColor="Black" BorderStyle="Solid"
            <CultureInfo CultureName="en-US">

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)
        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
        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
    End Sub
End Class




1 attachment
All times are GMT -5. The time now is 4:07 PM.
Previous Next