Is less than, Is less than or equal to, ... and so on..., that are usually found on numeric style columns types. Only operators available are: Is equal to and Is not equal to.
String data does contain what we expect: Is equal to, Is not equal to, Starts with. .. and so on...
and the numeric values have the other operators: Is less than, Is less than or equal to, ... and so on...
The version of the Telerik.Windows.Controls dll is 2011.2.920.35. Would the Q3 version have these operators? Or can we use the new Q3 FilterOperatorsLoading event handler to add them?
5 Answers, 1 is accepted
That sounds strange since DateTime's should have the comparison operators. Can you please send us a sample project that demonstrates how a DateTime column does not have these operators. Have in mind that the column should be informed that it displays DateTimes if that is not the case. This is done through its DataType property.
By the way, you can easily check that every DateTime column in our Quick Start examples does indeed show these operators.
As for the string columns, currently we do not support the comparison operators since the string class does not overload the <, <==, >, >== operators. We have some plans for adding such support if interest grows. Here you can vote for this feature.
Ross
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
This is the XAML for the Rad Grid View:
<telerik:RadGridView Name="gvRawData" ItemsSource="{Binding Path=RawDataListDT}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" EnableColumnVirtualization="True" EnableRowVirtualization="True" CanUserInsertRows="False" IsReadOnly="True" telerik:StyleManager.Theme="Metro" ScrollViewer.HorizontalScrollBarVisibility="Auto" BorderThickness="0" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollMode="RealTime" Margin="2" CanUserSelect="False" AutoGenerateColumns="True" RowIndicatorVisibility="Collapsed" FontSize="9pt" BorderBrush="DarkGray" CanUserDeleteRows="False" CanUserFreezeColumns="False" CanUserSortColumns="True" HeaderRowStyle="{StaticResource headerRow}" ShowGroupPanel="False" ></telerik:RadGridView>The data is loaded with MVVM through the Model as a DataTable. This is the mock code that ultimately generates the DataTable is as follows:
Public Function getRawDataListDT() As DataTable Dim returnCollection As New DataTable Dim newDataColumn As New DataColumn("Name") newDataColumn.DataType = GetType(String) returnCollection.Columns.Add(newDataColumn) newDataColumn = New DataColumn("FilePath") newDataColumn.DataType = GetType(String) returnCollection.Columns.Add(newDataColumn) newDataColumn = New DataColumn("FileSize") newDataColumn.DataType = GetType(Long) returnCollection.Columns.Add(newDataColumn) newDataColumn = New DataColumn("LastWriteTime") newDataColumn.DataType = GetType(DateTime) returnCollection.Columns.Add(newDataColumn) Dim maxItems As Integer = _showTop If maxItems < 1 Then maxItems = Integer.MaxValue End If Dim rnd As New Random() Dim sizernd As New Random() While returnCollection.Rows.Count < maxItems Dim dr As DataRow = returnCollection.NewRow() Dim path As String = "" Dim name As String = "" Dim nextRnd As Integer = rnd.Next(1, 4) Select Case nextRnd Case 1 path = "C:\Programs\DatTblSoft\" name = "configfile" dr("LastWriteTime") = DateTime.Parse("2010-02-28 09:23:45 PM").AddDays(109).AddSeconds(10900) Exit Select Case 2 path = "D:\DataTbl\IEScapeFoxerari\" name = "filecache" dr("LastWriteTime") = DateTime.Now Exit Select Case 3 path = "E:\Users\DT\" name = "mydocuemnt" dr("LastWriteTime") = DateTime.Now.AddDays(45).AddSeconds(789) Exit Select End Select dr("Name") = String.Format("{0}_{1}.ext", name, returnCollection.Rows.Count) dr("FilePath") = String.Format("{0}{1}", path, dr("Name").ToString()) dr("FileSize") = sizernd.Next(10, 10000000) returnCollection.Rows.Add(dr) End While Return returnCollectionEnd FunctionQ3 2011 (version: 2011.3.1116.35) solves this. The 'Less than ...' and 'Greater than ...' operators are now available as well.
Thanks
This operators works when you have a dictionary with object type?
Mine is not working as well
As explained by my colleague Rossen and documented in this article, in case the type of the property is System.Object, but you know that it always returns a “normal” filterable type (such as DateTime), you can “help” the column by setting its DataType property to the correct type.
For your convenience, I've prepared a small sample project which demonstrates a possible approach on handling the AutoGeneratingColumn event when binding the control to a list of DynamicObjects.
If setting this property does not work for you or if you require any further assistance on how to determine its value based on the underlying properties, please further elaborate on your scenario or provide a small sample project demonstrating your current setup and I will happily guide you further.
Regards,
Dilyan Traykov
Progress Telerik