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
380
WebDateTimeEdit
posted

I want to use a spin control in my grid to handle time (HH:mm:ss).

I linked WebDateTimeEdit to one of my columns and set EditModeFormat to "HH:mm:ss"

The column displays the correct control and the spin buttons work, but any value I enter is reset to blank the next time I set focus in that cell.

 There are other threads on the forum that suggest this has something to do with CultureInfo.  I think the issue is WebDateTimeEdit doesn't recognize the value I enter as a proper date (why???) so it's blanking it out.

 

 On a second time control where EditModeFormat = "HH:mm" the WebDateTimeEdit control is changing it's value to yy:mm (yes, that's year, month).  

 Every time I load a page I am setting currentthread.cultureinfo so that my date formats are yy/mm/dd, and this format coincides with how my time controls are reset...but WHY!!!!!!!

 

At the end of the day I need a control that supports HH:mm:ss and HH:mm (with spin buttons) and the value is not cleared out or set to a funky date format.  Am I using the wrong control?  If I am using the correct control how do I get CultureInfo under control???

 

 

HELP!!!!!!

 

 

Parents
  • 24497
    posted

    Hi,

    I suspect that there is problem with assigning editor to grid. In order to set embedded editor to a column, you should set only EditorControlID to the UniqueID of editor and set Type to Custom, and nothing else (no format, etc).

    this.UltraWebGrid1.Columns[3].EditorControlID = this.WebDateTimeEdit1.UniqueID;
    this.UltraWebGrid1.Columns[3].Type = Infragistics.WebUI.UltraWebGrid.ColumnType.Custom;

    Also, in case of WebDateTimeEdit the cells for that column should contain DateTime objects and the type of column should be set to DateTime:

    dataTableForGrid.Columns.Add("4th Column with DateTime", typeof(DateTime));
    dataTableForGrid.Rows.Add(new object[ { 1, "xx", "xxx", DateTime.Now });

    So, I tested
    <igtxt:WebDateTimeEdit ID="WebDateTimeEdit1" runat="server" EditModeFormat="HH:mm"></igtxt:WebDateTimeEdit>
    and it worked fine, it displayed start-edit mode time value and saved that value to grid.

Reply Children