Hello all,
I am newbie on using infragistics 2011 and I am having some dificulties in setting up a DateTiemEditorProvider to edit a time field which is in a SQL 2008R2 database.
I get an error which says that the Editor cannot be used with the field data type. I have tried to change the datatype on the WebDataGrid to Char and use a InputMask editor but I get the same error.
can someone point me to the right direction on how to accomplish this?
regards,
adasilva
i am using version 12.2 webdatagrid and am trying to set bound field from vb using the following boundField1.Width = Unit.Pixel(70) boundField1.DataFormatString = "{0:HH:mm}" boundField1.DataType = Type.GetType("System.DateTime").ToString boundField1.Header.Text = "Entry" Dim columnSetting As New EditingColumnSetting() columnSetting.ColumnKey = "entry" columnSetting.EditorID = "WebDataGrid1_DateTimeEditorProvider1" gdData.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(columnSetting) and the editor provider declaration is like that: it displays the time but when it comes to edit it only shows date format.. the database is loaded from vb and it is an sql database and the type of the field "entry" in sql is datetime: what to do?
HI,
I am using V12.1.20121.2072 asp.net and am is using the Date Time Editor Provider.
I want my WEbDataGrid to cell to display Time in HH:mm, thus i follow your suggesting above:
<Behaviors> <igGrid:Activation Enabled="true" /> <igGrid:EditingCore BatchUpdating="true"> <Behaviors> <igGrid:CellEditing Enabled="true" EditModeActions-EnableOnKeyPress="true"> <ColumnSettings> <igGrid:EditingColumnSetting ColumnKey="EmployeeId" ReadOnly="true" /> <igGrid:EditingColumnSetting ColumnKey="Employee" ReadOnly="true" /> <igGrid:EditingColumnSetting ColumnKey="EmployeeType" ReadOnly="true" /> <igGrid:EditingColumnSetting ColumnKey="Designation" ReadOnly="true" /> <igGrid:EditingColumnSetting ColumnKey="WorkHour" ReadOnly="true" /> <igGrid:EditingColumnSetting ColumnKey="Time1" EditorID="WebDataGrid1_DateTimeEditorProvider1" /> <igGrid:EditingColumnSetting ColumnKey="Time11" EditorID="WebDataGrid1_DateTimeEditorProvider1" /> </ColumnSettings>
<EditModeActions EnableOnKeyPress="True"></EditModeActions> </igGrid:CellEditing> </Behaviors> </igGrid:EditingCore> </Behaviors> <EditorProviders> <igGrid:DateTimeEditorProvider id="WebDataGrid1_DateTimeEditorProvider1"> <EditorControl DisplayModeFormat="HH:mm" EditModeFormat="HH:mm"> </EditorControl> </igGrid:DateTimeEditorProvider> </EditorProviders>
But my Grid Cell still display the full datetime. I had try to change the DisplayModeFormat="t", as it display datetime as well.
Can you please enlighten me?
Regards,
Say Chao
hello adasilva,
If your data is not in datetime format then cast it as datetime and bind it to grid
eg. output should be like 2011-06-30 01:00:00
For DateTimeEditorProvider
set following properties to display and edit data in format 01:00
DisplayModeFormat="HH:mm" EditModeFormat="HH:mm"
If you want to display data in format 01.00 then set following porperties
DisplayModeFormat="HH.mm" EditModeFormat="HH.mm"
If u r having problem please ask again
Thanks
sandip jadhav