Telerik Forums
UI for WPF Forum
0 answers
46 views

Hi!  I am seeking assistance with this column in WPF, in a RadGridView:

<telerik:GridViewDataColumn DataMemberBinding="{Binding TargetDateET, StringFormat={}{0:MM/dd HH:mm}}" Header="Target Date" />

It displays DateTime values in the grid in the following format: "MM/dd HH:mm"

The issue is that the FilterDescriptor is in this format: "MM/dd/yyyy HH:mm:ss tt"

And when the filters are saved and presented to the user, they are different.



What I can do to manage this data in the same format? (Without having to generate a new variable that is a string and that returns the correct format) Help! Thanks in advance! Juan

Pablo
Top achievements
Rank 1
 updated question on 03 Jul 2024
1 answer
85 views
1.148 / 5.000
With the RadGridView, the binding for ItemsSource works perfectly and the data is displayed correctly. However, if I want to create a FilterDescriptor when a text box changed in the code-behind, I get a System.ArgumentException with the message 'Source type must be an enumerable type.' when executing the Add statement in the code

rgv.FilterDescriptors.Clear();

rgv.FilterDescriptors.LogicalOperator = FilterCompositionLogicalOperator.Or;

var cfd = new FilterDescriptor("columnName", FilterOperator.Contains, filterTxtBx.Text);

rgv.FilterDescriptors.Add(cfd);

with the stack trace

   at Telerik.Windows.Data.Expressions.EnumerableFilterOperatorExpressionBuilder.GenerateContainsMethodCall(Expression source, Expression value, Boolean shouldNegate)
   at Telerik.Windows.Data.Expressions.EnumerableFilterOperatorExpressionBuilder.GenerateContains(Expression left, Expression right)
   at Telerik.Windows.Data.Expressions.FilterOperatorExpressionBuilderBase.CreateExpression(Expression left, Expression right)
   at Telerik.Windows.Data.Expressions.OperatorValueFilterDescriptorExpressionBuilderBase.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.OperatorValueFilterDescriptorExpressionBuilderBase.CreateBodyExpression()
   at Telerik.Windows.Data.FilterDescriptor.CreateFilterExpression(ParameterExpression parameterExpression)
   at Telerik.Windows.Data.FilterDescriptorBase.CreateFilterExpression(Expression instance)
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpressionThreadSafe()
   at Telerik.Windows.Data.Expressions.FilterDescriptorCollectionExpressionBuilder.CreateBodyExpression()
   at Telerik.Windows.Data.Expressions.FilterExpressionBuilder.CreateFilterExpression()
   at Telerik.Windows.Data.QueryableExtensions.Where(IQueryable source, CompositeFilterDescriptorCollection filterDescriptors)
   at Telerik.Windows.Data.QueryableCollectionView.CreateView()
   at Telerik.Windows.Data.QueryableCollectionView.CreateInternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalList()
   at Telerik.Windows.Data.QueryableCollectionView.get_InternalCount()
   at Telerik.Windows.Data.QueryableCollectionView.get_IsEmpty()
   at Telerik.Windows.Data.DataItemCollection.get_IsEmpty()
   at Telerik.Windows.Controls.GridView.BaseItemsControl.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Controls.DataControl.OnItemsCollectionChangedDispatch(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.Listener`2.ReceiveWeakEvent(Object sender, TArgs args)
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.QueryableCollectionView.RefreshOverride()
   at Telerik.Windows.Data.QueryableCollectionView.RefreshOrDefer()
   at Telerik.Windows.Data.QueryableCollectionView.InvalidatePagingAndRefresh()
   at Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsChanged()
   at Telerik.Windows.Data.QueryableCollectionView.OnFilterDescriptorsCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.FilterDescriptorCollection.InsertItem(Int32 index, IFilterDescriptor item)
   at System.Collections.ObjectModel.Collection`1.Insert(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Insert(Int32 index, Object value)
   at Telerik.Windows.Data.CollectionHelper.Insert(IList target, IEnumerable newItems, Int32 startingIndex, IEqualityComparer itemComparer)
   at Telerik.Windows.Data.ObservableCollectionManager.HandleCollectionChanged(IList sender, NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.ObservableCollectionManager.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args)
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.ObservableItemCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.FilterDescriptorCollection.InsertItem(Int32 index, IFilterDescriptor item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)

But why an enumerable type is suddenly needed here is a mystery to me. Because the ItemsSource is enumerable anyway and the designer-generated data set classes for the items are not. How, above all, does he come to the strange assumption that such a type is suddenly needed here when the display has been working correctly and without problems up until then?
Daniel
Top achievements
Rank 1
Iron
 answered on 02 Jul 2024
0 answers
51 views

When Static header are enabled and few columns are fixed, 
Scenario:


1.If the Start and End Dates range are more than 1 month, the data is not exactly aligned with the Header dates after scrolling towards right.

2.If filter is applied, then the footer is displayed at very bottom. 

sandurpoojitha
Top achievements
Rank 1
 asked on 02 Jul 2024
0 answers
53 views
CustomFindReplace, SpellCheckingDialogAttribute classes are not found inside using Telerik.Windows.Documents.UI.Extensibility; after I upgraded the wpf from net framework to net core. It works in my same net framework project.
Sagar
Top achievements
Rank 1
 asked on 28 Jun 2024
1 answer
60 views

Having an issue displaying images in a radRichTextBox. Below is my HTML. 

I have using an HTMLDataProvider to bind to a string that contains this HTML below.

The image does not display, all I get is this little box for the image.

The text all displays fine above it.

 


<head>
<link rel="stylesheet" href="../style.css" /> 
</head>
<p><strong>Section Header</strong></p>

<p><strong>Section Text</strong> This is my Description section</p>

<p><strong>Picture Title</strong></p>
<p><img src="../LocalFolderParent/Images/MyImage.png" alt="Figure 1 - Test 3" /></p>

Stenly
Telerik team
 answered on 28 Jun 2024
4 answers
392 views

After installing release 2022.2.511, the distinct filters of our grid views stopped working.  We are using popup filters in a custom class with both distinct checkboxes and field filters visible.  Clicking on any distinct checkbox and then clicking Apply Filter button would always filter the grid, but after the 2022.2.511 release, clicking on distinct checkboxes and clicking Apply Filter now does nothing but close the filter popup with no effect to the results.  However, if the EnableDistinctValuesFiltering property is set to true, and some text is typed in the distinct search text box, and then the checkbox is checked and Apply Filter is clicked, the filtering works.

Is there some breaking change that was made that we should know about when dealing with distinct filters in the custom popup?  Is there any settings that we can try to help resolve this issue?

Thanks, Bob

Oksana
Top achievements
Rank 1
Iron
 answered on 26 Jun 2024
0 answers
77 views
How is it possible to display main and secondary data records in a RadGridView not using the hierarchy options, but rather to design it in such a way that the main columns extend over the corresponding rows of the secondary data records via RowSpan, whereby both main and secondary data records have multiple columns?
Daniel
Top achievements
Rank 1
Iron
 asked on 25 Jun 2024
0 answers
54 views
I created a new WPF project in Visual Studio 2022 - opened the XAML, dropped a RadButton.  Nothing appeared.  Where did it go?  When I did the same steps in Visual Studio 2019 I see the button all right.
Marianne
Top achievements
Rank 1
Veteran
 asked on 24 Jun 2024
0 answers
62 views
I have an RTB control and I do not want horizontal scroll bar to ever show. When a user inserts or copies in an image, I would like the image to always only ever fill the width of the RTB and never exceed it. Increasing height, is fine, vertical scrolling is acceptable in this instance.

Is this a possibility? I am able to do it with tables.
Patrick
Top achievements
Rank 1
Iron
Iron
Iron
 asked on 24 Jun 2024
0 answers
71 views
I have to react to the RadGridView's LostFocus event with a handler. Unfortunately, I discovered that the event is also triggered at unexpected times. What is particularly surprising is that scrolling with the scroll bar has no effect, but scrolling with the mouse wheel immediately calls the handler. And it does this without clicking the mouse and leaving the control. What could be the reason for this, or how can I get around it? The actual case that should be reacted to is when either another item of it is selected or the entire RadGridView loses focus by focusing on a control outside of it. Simply checking e.OriginalSource.GetType() == typeof(GridViewCell) doesn't help here either, as this is often the case when clicking on another control. And IsScrolling is also constantly false.Does anyone have any ideas?
Daniel
Top achievements
Rank 1
Iron
 updated question on 24 Jun 2024
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?