Telerik Forums
UI for WPF Forum
0 answers
234 views

Hi,

it took me a while to find out the actual behavior of the GridView, but I think I got and now and would just like to point out a misleading example and ask if I've misunderstood something.

When attaching to the RadGridView.SelectedCellsChanged-event, I get the following behavior:

1.  When a complete row was selected and the grid is sorted/grouped, I receive a SelectedCellsChanged-event with the newly added cells (all cells of the row). However, the GridViewSelectedCellsChangedEventArgs do not contain the removed cells. Is this by design because the removed GridViewCellInfo-instances are no longer part of the updated grid?

2.  When only single cells were selected and the grid is sorted/grouped, the selection of these cells seem to be cleared. However, I do not receive a SelectedCellsChanged-event. This is okay for me, as I can still listen to

  • the RadGridView.Sorted-event 
  • the RadGridView.Grouped-event

and clean up my ViewModel-CellSelection there. But this leads to the misleading example "Grid View - Selection" in the WPF Controls Examples suite. Here, the SelectedCellsBindingBehavior.cs only listens to the SelectedCellsChanged-event, which results in cells still being listed in the "Selected cells:"-Listbox of the example after a sorting operation, although they are no longer selected.

 

Greetings,

Andree

 

 

Andree
Top achievements
Rank 1
 asked on 22 Apr 2021
15 answers
223 views

Hi,

If a button is placed in a RadMenu that causes navigation (in a Frame/Page setup), then the button is not getting focus and hence any Bindings that are present where the focus is are not executed before navigation takes place.  I see https://www.telerik.com/forums/radmenu-problem-404186d89499 and https://www.telerik.com/forums/i-think-i-found-a-nasty-bug which look like the same problem.  Is there any solution for this problem aside from not using RadMenu that will work for the focus being in any control?  I note that in Silverlight RadMenu does not have this problem. 

Vladimir Stoyanov
Telerik team
 answered on 22 Apr 2021
37 answers
755 views

Hi all 

I have a ListBox and its has Items to be Displayed. Additional i have added 

 <telerik:ListBoxDragDrop.Behavior> // for dragging operation
<telerik:ListBoxDragDropBehavior AllowReorder="True" telerik:TouchManager.DragStartTrigger="TapHoldAndMove" />
</telerik:ListBoxDragDrop.Behavior>
            
<telerik:ListBoxDragDrop.DragVisualProvider> //// for dragging Visual operation
<telerik:ScreenshotDragVisualProvider />
</telerik:ListBoxDragDrop.DragVisualProvider>

Any idea to Restrict the Dragging-Visual within the parent windows bounds.

Thanks In Advance

Dinko | Tech Support Engineer
Telerik team
 answered on 22 Apr 2021
1 answer
506 views

Hi,

 

I am using the RadSplashScreen and I would like to allow the following actions:

- Set splashscreen as not topmost

- Allow to move the splashscreen (no resize, or close, just move)

 

Thank you for your help

Martin Ivanov
Telerik team
 answered on 22 Apr 2021
3 answers
930 views

 I know grid performance has been discussed many times, but I could not derive a solution so far from those posts.

The scenario is very simple, we have to show 20 items in a grid. The data paging responsibility is ours, the grid sees only 20 rows.

When the ItemsSource changes, 1-2 sec is needed for the grid to display the new results.

The performance is bad regardless of Virtualization settings (and 20 rows do not need virtualization at all naturally).

Fixed Height and With do not help, I think this is not the usual infinite height MeasureOverride issue.

I have attached DotTrace and VS profiler traces, so you can see the problematic paths.
The profiler pinpoints MeasureOverride at the surface. Most posts about grid performance revolve around this.
However, when we dig deeper we see creating each datagrid row took about 50ms.
For 20 rows this is 1sec. This explains the perceived delay.
The attached dottrace images show that LoadContent is called many hundred times, this is what actually eats the time.

Now, it is your turn to explain what I can do to avoid this big performance overhead.

Tell me if you need more profiling data from me.

Thanks,
Zsolt

Zsolt
Top achievements
Rank 1
 answered on 22 Apr 2021
3 answers
222 views

I have a RadTabControl and I want to enable the drop-down button "WhenNeeded" so that users can easily access the buttons in the tab control. I have three templates for the tab items (RadTabItem) which means I should have 3 templates as well for the drop-down buttons that appear in the drop-down list. 

There is a field called ItemDropDownContentTemplateSelector in RadTabControl and I created a template selector class like so:

    public class DropDownDisplayModeTemplateSelector: DataTemplateSelector
    {
        public override DataTemplate
            SelectTemplate(object item, DependencyObject container)
        {
            try
            {
                FrameworkElement element = container as FrameworkElement;
                Console.WriteLine("DropDownDisplayModeTemplateSelector: " + element.GetType().Name);
                if (element != null && item != null && item is TabItem)
                {
                    TabItem tabItem = item as TabItem;

                    switch (tabItem.TabItemStyle)
                    {
                        case TabItemStyle.Title:
                            return element.FindResource("TitleDropDownModeDataTemplate") as DataTemplate;

                        case TabItemStyle.Button:
                            return element.FindResource("ButtonDropDownModeDataTemplate") as DataTemplate;

                        case TabItemStyle.GroupOfButtons:
                            return element.FindResource("GroupOfButtonsDropDownModeDataTemplate") as DataTemplate;

                        default:
                            return element.FindResource("ButtonDropDownModeDataTemplate") as DataTemplate;
                    }
                }
                else
                    return null;
            }
            catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
                return null;
            }
        }
    }

 

However, finding the DataTemplates with element.FindResource() method doesn't work because the container element is of type "DropDownMenuItem" which of course is not the element where my data templates are defined.

I have them defined in the top level Grid element like so:

<Grid>
        <Grid.Resources>
            <ResourceDictionary>

                <DataTemplate x:Key="TitleDropDownModeDataTemplate">
                    <TextBlock
                        HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            Margin="4"
                            Grid.Column="1"
                            Text="TitleDropDownModeDataTemplate" />
                </DataTemplate>

                <DataTemplate x:Key="ButtonDropDownModeDataTemplate">
                    <TextBlock
                        HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            Margin="4"
                            Grid.Column="1"
                            Text="ButtonDropDownModeDataTemplate" />
                </DataTemplate>

                <DataTemplate x:Key="GroupOfButtonsDropDownModeDataTemplate">
                    <TextBlock
                        HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            Margin="4"
                            Grid.Column="1"
                            Text="GroupOfButtonsDropDownModeDataTemplate" />
                </DataTemplate>

                <models:DropDownDisplayModeTemplateSelector x:Key="myDropDownDisplayModeTemplateSelector"/>
            </ResourceDictionary>
        </Grid.Resources>
        
        <telerik:RadTabControl

           ItemsSource="{Binding TabItems}"

           ItemDropDownContentTemplateSelector="{StaticResource myDropDownDisplayModeTemplateSelector}"
            DropDownDisplayMode="WhenNeeded">
</Grid>

In this case what should I do, hack the way top to the Grid's resources or I have done something wrong in defining my drop-down template selector?

Dinko | Tech Support Engineer
Telerik team
 answered on 21 Apr 2021
22 answers
1.3K+ views
Hello!

if I set an RadTreeViewItem to  ".Visibility = Visibility.Collapsed" or ".Visibility = Visibility.Hidden", the item is not visible BUT it stil takes space in the triewview (as a empty row).

Is this a bug, or how do I make an item invisible by code?

Petar Mladenov
Telerik team
 answered on 20 Apr 2021
2 answers
462 views

Hi there,

very simple scenario - we have a RadRichTextBox and want to show a placeholder (ghost) when there is no content in it.
Same behavior like WatermarkTextBox

Found no simple solution for this... or I have overseen something..

Thank you, Andi

Andi
Top achievements
Rank 1
 answered on 20 Apr 2021
9 answers
834 views
Hi. I'm generating a RadTreeView and its items through WPF data binding using a HierarchicalDataTemplate. So when I add a new item to the collection the RadTreeView is looking at, and I set the selected item to that newly added object, I try to get the selected container, but it's null. This is my code:

private void OnAddFolderClicked(object sender, RoutedEventArgs e) 
        { 
            IFolderContainer container = (sender as MenuItem).DataContext as IFolderContainer ?? null

            Folder folder = new Folder() { Name = "Folder" }; 
 
            container.AddFolder(folder); 
 
            treeViewExplorer.SelectedItem = folder; 
 
            folder.IsNodeInEditMode = true
 
            RadTreeViewItem selectedItem = treeViewExplorer.SelectedContainer; // this is null even though I set the SelectedItem = folder
        } 

What I want to do is to set focus on it, so if the user clicks F2 right away after creating it, it can go into edit mode, right now the object looks selected, but hitting F2 doesn't do anything unless deselect it, and select it again.

Thanks!
Dinko | Tech Support Engineer
Telerik team
 answered on 20 Apr 2021
5 answers
322 views

Hi,

 

I want to be able to receive the file and/or set the file for the radSpreadsheet.CommandDescriptors.SaveFile.Command  command. It appears that no event can be handled before or after the command is executed.

 

Thanks

Tanya
Telerik team
 answered on 19 Apr 2021
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?