Telerik Forums
UI for WPF Forum
2 answers
129 views

I have  a Telerik gridview, with visible columns, works fine.  I now want to add column groups as in the example on

https://docs.telerik.com/devtools/wpf/controls/radgridview/columns/column-groups

 

But when I added columngroups-tag and some column groups, it results in a grid with only the column groups as headers and

the real column headers are gone. See attachment for my markup

Robert
Top achievements
Rank 1
Veteran
 answered on 19 May 2020
2 answers
118 views

Hi,

 

i grabbed the telerik editor and used in my WPF application, now i need to blink in red when the user exceeds the character length, but i'm unable to accomplish that, i can't even change the borderbrush of the RadRichTextBox that is within the Telerik Editor.

 

 

any suggestion?

 

 

regards.

 

 

Maximiliano
Top achievements
Rank 1
Veteran
 answered on 19 May 2020
4 answers
610 views

Sorry for posting 2 different issues in one thread, but they are kinda intertwined in my situation here.

The first thing I'm wanting to do is make it so the Enter key within the RadGridView is treated like the Tab key instead. I was able to successfully do this via a custom KeyboardCommandProvider, by making it call DefaultKeyboardCommandProvider's ProvideCommandsForKey with Key.Tab is the key was Key.Enter.

The second thing I'm wanting to do is specially handle what happens with new rows. There are 3 columns in the grid and the first 2 are being validated via INotifyDataErrorInfo while the last has no validation. I'm wanting to do the following with a new row:

  • On starting the new row, the first column is always selected. (I was able to do this without issues inside the AddingNewDataItem event, so this isn't a problem.)
  • On attempting to leave the first cell, I want to check the value and prevent progression if that value exists elsewhere in the same column. (I was able to do this without issues inside the CellValidating event, so this isn't a problem either.)
  • When pressing Enter or Tab in the last column, I want to get out of edit mode, select the new row after it has been added to the grid, and then scroll down to that new row. (This is where I am having all my issues, as I'll explain further below.)

What I've tried doing is inside of my custom KeyboardCommandProvider, if the key is Key.Tab or Key.Enter, Shift isn't being held down, and if I am in the last column (checking the grid's current column DisplayIndex and checking if it is 2) and in a new row (which I check by seeing if my view model's current selection is null, which I set inside the AddingNewDataItem event), then I was trying to remove the default actions of select current unit and begin edit (so the only action left is move next) and add in a custom command to attempt to select the new row (which I've stored inside of the RowEditEnded event).

My custom command for attempting the new row selection consists of canceling the grid view's edit, setting the CurrentCellInfo of the grid to the new item in the first column, and then using ScrollIntoViewAsync for the same item and column.

The issues I'm running in to:

  • I originally was not removing Tab's default commands or calling my custom command, and instead was trying to do the above stuff from the custom command within the SelectionChanged event. As I was storing the row inside the RowEditEnded event, I was also trying to change the current selected item in my view model through that event, which meant that running the commands in SelectionChanged only partially worked because the rest of the grid view's code for the RowEditEnded event after my callback would change the CurrentCellInfo.
  • I then tried the method I explained above with changing the commands for the Tab key, and if I press Tab instead of Enter, I've been finding that sometimes the grid view will retain focus and run my custom command and other times it'll move focus to the next control in the window and never run my custom command as a result.
  • In the cases when the above does retain focus on the grid view, while I think I solved the issues with CurrentCellInfo, scrolling the grid view to the new row has been hit or miss. Sometimes it works and the success callback is called, sometimes it doesn't work and the failure callback is called instead. I've also noticed that while the current cell has the proper selection border on it, I've also seen a different cell in the grid have the focus border on it.
  • The last thing I tried was removing all the commands entirely if the Tab key is pressed (but leave things as above for the Enter key, that is only the move next and my custom command) in that same situation, but because of that, I've found that the grid view loses focus.

If need be, I can provide a minimal example of what I've currently got that isn't working.

CyberBotX
Top achievements
Rank 2
Veteran
 answered on 18 May 2020
1 answer
113 views

Instead of placing the row details below the current row, would it be possible to dock the details to a certain area of the grid, e.g. top or bottom?

Thanks
Michael

 

Dinko | Tech Support Engineer
Telerik team
 answered on 18 May 2020
1 answer
166 views

Hello,

We are using the RadSyntaxEditor (R1 2020). Everything has been good with it but I wanted to report a possible bug. It isn't affecting our users because they are old and all have bad eyes, but someone somewhere might care :)

We have found that we can scroll to make the text larger but that anytime we scroll to 50% or lower the following exception gets thrown:

 

   Exception    {"'∞' is not a valid value for property 'Y2'."}    System.Exception {System.ArgumentException}

   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Telerik.Windows.Controls.SyntaxEditor.UI.Margins.LineNumberMargin.UpdateUIOverride(UIUpdateContext updateContext)
   at Telerik.Windows.Controls.SyntaxEditor.UI.Margins.SyntaxEditorMarginsCollection.UpdateUI(UIUpdateContext updateContext)
   at Telerik.Windows.Controls.SyntaxEditor.UI.Margins.SyntaxEditorMargins.UpdateUI(UIUpdateContext updateContext)
   at Telerik.Windows.Controls.SyntaxEditor.Layout.SyntaxEditorLayout.Arrange()
   at Telerik.Windows.Controls.SyntaxEditor.UI.SyntaxEditorPresenter.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
   at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at Telerik.Windows.Controls.LayoutControl.VerticalLayoutControlPanelStrategy.Arrange(Size finalSize)
   at Telerik.Windows.Controls.LayoutControl.LayoutControlPanel.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
   at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.ScrollContentPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

 

The syntax editor sits in a LayoutControlGroup inside a vertically oriented RadLayoutControl. The abbreviated xaml code looks something like this below:

<telerik:LayoutControlGroup x:Name="TopLayout"
                                        Orientation="Vertical"
                                        Height="400"
                                        FocusManager.FocusedElement="{Binding ElementName=SyntaxEditor}">
                <telerik:RadToolBar ... />
                <telerik:RadSyntaxEditor Name="SyntaxEditor"
                                         IsTabStop="True"
                                         AcceptsReturn="True"
                                         Focusable="True"
                                         Language="Sql"
                                         CaretDisplayMode="Normal"
                                         KeyDown="SyntaxEditor_KeyDown"
                                         ScrollViewer.VerticalScrollBarVisibility="Visible"
                                         PreviewSyntaxEditorMouseLeftButtonDown="SyntaxEditor_PreviewSyntaxEditorMouseLeftButtonDown"
                                         SelectionChanged="SyntaxEditor_SelectionChanged"
                                         DocumentContentChanging="SyntaxEditor_DocumentContentChanging"/>
            </telerik:LayoutControlGroup>

 

Hope this helps.

Tim

Petar Mladenov
Telerik team
 answered on 18 May 2020
11 answers
607 views

The GridView has a nasty feature I don't quite understand. It concerns the visual studio intellisense connection (XAML) of the collection in the ItemsSource and the DataMemberBinding on the column when using AutoGenerateColumns=False.

The problem is that if you Qualify the attached property type, so it reacts to property name changes and can be naviagted to using F12, the column cannot be filtered or grouped anymore.

Qualify looks like this:

DataMemberBinding="{Binding Path=(model: xxx)"

The unqualified looks like this:

DataMemberBinding="{Binding Path= xxx"       this gives a blue line underneath

 

The DataContext of the column obviously isn't the DataContext of the Window.

The values in the cells are correct. 

The message I get from visual studio is  'Cannot resolve property 'xxx' in data context of type 'object'.

In DataTemplates a similar thing happens, but you can set the DataType or I use d:DataContext={xxx}

 

I there a way to do this?

 

 

 

Yoan
Telerik team
 answered on 15 May 2020
2 answers
104 views

Hello,

I'd like to show group headers that are organized by department and person. I tried this with ResourceGroupDesction as follows:

GroupDescriptions = new GroupDescriptionCollection()
{
    new ResourceGroupDescription(){ ResourceType = "Department"},
    new ResourceGroupDescription() { ResourceType = "Person" },
};

However this just repeats the Person group under each department. Is there a way to have persons only show up under the department that they belong to?

This grouping isn't really resources, it was just an attempt at learning grouping methods. I can use any option available that would allow group headers organized by department / person.

Regards,

Dinko | Tech Support Engineer
Telerik team
 answered on 15 May 2020
1 answer
179 views

     Hi

In my chart I created ChartSeriesProvider and few ScatterPointSeries. 

For the ScatterPointSeries I can set the display ordering using Zindex or using default order But the ChartSeriesProvider created on top of other series.

How can I set the order of ChartSeriesProvider to most down?

 

Thanks

Michal

Dinko | Tech Support Engineer
Telerik team
 answered on 15 May 2020
1 answer
133 views

Ohhhhh :(

See the differences:

<telerik:RadWatermarkTextBox 
VerticalContentAlignment="Top"                                        
HorizontalScrollBarVisibility="Auto"                                        
VerticalScrollBarVisibility="Auto"                                        
IsReadOnly="True"                                        
Text="{Binding Text, Mode=OneWay}"/>

and

 

<TextBox 
VerticalContentAlignment="Top"                                        
HorizontalScrollBarVisibility="Auto"                                        
VerticalScrollBarVisibility="Auto"                                        
IsReadOnly="True"                                        
Text="{Binding Text, Mode=OneWay}"/>

Andrew
Top achievements
Rank 1
 answered on 14 May 2020
2 answers
308 views
I would like to drag a ListBox item and drop it onto another item. In OnDragOver and OnDrop the sender is the ListBox, but I don't see a way to identify the specific item I am dragging over or dropping on. Is there a way to do that?
Georg
Top achievements
Rank 1
Veteran
 answered on 14 May 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?