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
155
WebDateTimeEdit embedded in UltraWebGrid shows wrong format in edit mode
posted

Using version 6.2 

I have a problem with a wizard server control that has an ultrawebgrid on the second page that embeds a webdatetimeedit control. When the user views the first page the ultrawebgrid has not been rendered so the webdatetimedit control is visible at the bottom of the page. If I declaritively set the webdatetimeedit control visible=false the date is displayed in long date/time format in edit mode even though I specify short date format when I do get to the second page. I do not want to set up the ultrawebgrid column definitions until I get to the second page because of some overhead issues.

Here some simplified HTML and code that demonstrates the problem without the wizard.
<body>
    <form id="form1" runat="server">
       
<div>
           
<igtbl:UltraWebGrid ID="UltraWebGrid1" runat="server"/>
        </div>
       
<igtxt:WebDateTimeEdit ID="WebDateTimeEdit1" runat="server" DataMode="EditModeText" Visible="false"/>
   
</form>
</
body>

And the code behind...
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
   
With UltraWebGrid1.Columns
       
If .Count = 0 Then
           
.Add("Date", "Date")
            .FromKey(
"Date").DataType = GetType(Date).ToString
            .FromKey(
"Date").DefaultValue = Now()
            .FromKey(
"Date").EditorControlID = WebDateTimeEdit1.UniqueID
            .FromKey(
"Date").Type = ColumnType.Custom
            .FromKey(
"Date").Format = "MM/dd/yyyy"
       
End If
   
End With

    With UltraWebGrid1.Rows
        .Clear()
        .Add()
        
Dim oRow As UltraGridRow = UltraWebGrid1.Rows(0)
        oRow.Cells(0).Value = Now()
        oRow =
Nothing
   
End With

    UltraWebGrid1.DisplayLayout.AllowUpdateDefault = AllowUpdate.Yes
    UltraWebGrid1.DisplayLayout.CellClickActionDefault = CellClickAction.RowSelect
End Sub

If you double-click the cell you will see the date format changes from short date to long date/time when the cell is put in edit mode. Removing the visible="false" attribute from the webdatetimeedit control corrects this behaviour but leaves the webdatetimeedit control visible until the .EditorControlID attribute on the ultrawebgrid is rendered.

Any observations would be welcome.

Thanks
Terry Hutt

Parents
No Data
Reply
  • 5
    posted

    Hi iam having the following problem

    We set EditModeFormat  of WebDateTimeEdit to "hh:mm:ss tt" but the last AM and PM in spanish culture(es-CO) is truncating for ex "10:10:10 a." instead of "10:10:10 a.m.", this is working fine for en-US like 10:10:10 AM.Let me know what iam doing wrong.

     

    Thanks

    MuthuKumaraSamy,

Children
No Data