Sep 20, 2010, 10:22 AM
[CLOSED] Date FieldType Store problem
I'm using a database source for my grid in which dates are stored as String: "dd-MM-yyyy"
I''m creating the store dynamic from the source and like to create a Data type field in the store for these particular fields.
In this string the names of the fields are mentioned which need to become datefields in the store :
Any idea how to solve this ? I need those as datefields in the store because i'm using datefilters
Example dates are "01-03-2010" or "31-12-2009"
Martin
I''m creating the store dynamic from the source and like to create a Data type field in the store for these particular fields.
In this string the names of the fields are mentioned which need to become datefields in the store :
string dateFields = "factuurdatum,periodevan,periodetm";
Here I create the fields:private static void createFieldsStore(ref Store s, DataTable dt)
{
s.RemoveFields();
foreach (DataColumn c in dt.Columns)
{
s.AddField(dateFields.IndexOf(c.ColumnName.ToLower()) == -1 // check the names of the fields who need to become datafields in the store
? new RecordField(c.ColumnName, RecordFieldType.Auto)
: new RecordField(c.ColumnName, RecordFieldType.Date));
}
}
All fields are created perfectly, with te exception of the 3 fields in the string. They're probably not recognized as a valid date and empty in the grid.Any idea how to solve this ? I need those as datefields in the store because i'm using datefilters
Example dates are "01-03-2010" or "31-12-2009"
Martin
Last edited by geoffrey.mcgill; Sep 21, 2010 at 4:26 PM.
Reason: [CLOSED]