Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > UniView View modes: 
User avatar
Member
Member
dmitry_usanov-epam - 7/26/2012 8:54:58 AM
   
UniView
Hello,
I'm using a UniView for showing some data from DataSet. I'm using a filters and creating them by ColumnFilter class. What kind of filter should i use for DateTime?

User avatar
Member
Member
dmitry_usanov-epam - 7/26/2012 8:56:01 AM
   
RE:UniGrid
dmitry_usanov-epam wrote: Hello,
I'm using a UniGrid for showing some data from DataSet. I'm using a filters and creating them by ColumnFilter class. What kind of filter should i use for DateTime?


User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 8/1/2012 7:34:38 AM
   
RE:UniGrid
Hello,

Could you please let me know if you are using an UniGrid or UniView? Once you are mentioning the UniView and once the UniGrid in the subject. Additionally, if you are using any custom code, please post it too.

Best regards,
Boris Pocatko

User avatar
Member
Member
dmitry_usanov-epam - 9/21/2012 12:30:57 AM
   
RE:UniGrid
I'm using UniGrid.


// Loop trough all columns
for (int i = 0; i < columnList.Count; i++)
{
string column = columnList.ToString();

// Get field caption

FormFieldInfo ffi = FormInfo.GetFormField(column);
string fieldCaption = string.Empty;
if (ffi == null)
{
fieldCaption = column;
}
else
{
fieldCaption = (ffi.Caption == string.Empty) ? column : ResHelper.LocalizeString(ffi.Caption);
}
Column columnDefinition = new Column()
{
Caption = fieldCaption,
Source = column,
ExternalSourceName = column,
AllowSorting = true,
Wrap = false
};
if (showFiltersItems.Contains(column))
{

ColumnFilter filter = new ColumnFilter();
switch (ffi.DataType)
{
case FormFieldDataTypeEnum.LongText: filter.Type = "text";
break;
case FormFieldDataTypeEnum.DateTime: filter.Type = "text";
break;

case FormFieldDataTypeEnum.Decimal: filter.Type = "double";
break;
default:
filter.Type = ffi.DataType.ToString();
break;
}
filter.Source = column;
columnDefinition.Filter = filter;
}

if (i == columnList.Count - 1)
{
// Stretch last column
columnDefinition.Width = "100%";
}

UniGridDescriptions.GridColumns.Columns.Add(columnDefinition);
}

// Set column names
UniGridDescriptions.Columns = columnNames;

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 9/26/2012 7:51:15 AM
   
RE:UniGrid
Hello,

I've checked with our developer and the type of the filter needs to be set to custom. Afterwards you need to specify the Path property, which should point to a control creating the filter query. You can try to use the following folter:

CMSFormControls\Filters\DateTimeFilter.ascx

Best regards,
Boris Pocatko