Telerik Forums
UI for WPF Forum
3 answers
609 views
I am having two issues with the below user control view that is mostly a RadGridView. The ItemsSource is a CollectionViewSource View. The view is based on an ObservableCollection and filtering is utilized. Everything seems to work for the most part if I host the user control in a regular Microsoft TabControl. If I use a RadTabControl, each tab does not seem to respect the CollectionViewSource.View that it is bound to so on the first tab I might get the data to be expected on the last or vice versa.

EDIT: Just to be clear, each tab item is bound to a different instance of a CollectionViewSource over the same ObservableCollection.

Second, whether I host the control in a TabControl or RadTabControl, if I try to use the UI to group by a column on one tab, the column is grouped on all tabs. If I ungroup a tab, I need to remove the group manually from the other tabs before things return to normal.

Any suggestions for alternatives that might work better together? Why am i getting different results hosting the control in TabControl vs RadTabControl? I tried the telerik QueryableView a bit, but it seems like this is built more for LinqToSQL or ORM.

<

 

 

UserControl x:Class="XXXXXXXXXXX"
xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="416" d:DesignWidth="736" xmlns:telerik=http://schemas.telerik.com/2008/xaml/presentation
xmlns:Behaviors="XXXXXXXXXXX">
<UserControl.Resources>
<Style x:Key="RowStyle" TargetType="telerik:GridViewRow" >
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="11" />
</Style>
<Style x:Key="HeaderStyle" TargetType="telerik:GridViewHeaderRow">
<Setter Property="FontFamily" Value="Segoe UI" />
<Setter Property="FontSize" Value="11" />
<Setter Property="FontWeight" Value="Bold" />
</Style>
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions >
<RowDefinition Height="*"/>
<RowDefinition Height="40"/>
</Grid.RowDefinitions>
<telerik:RadGridView Name="gridv" Grid.Row="0" ItemsSource="{Binding Path=RecordModels.View}" AutoGenerateColumns="False" CanUserResizeColumns="False"
IsFilteringAllowed="False" IsSynchronizedWithCurrentItem="True" Behaviors:MouseDoubleClickEventBehavior.MouseDoubleClickEvent="{Binding DoubleClickEvent}"
RowStyle="{StaticResource RowStyle}" HeaderRowStyle="{StaticResource HeaderStyle}" SelectionUnit="FullRow">
<telerik:RadGridView.Columns>
<telerik:GridViewImageColumn Width="22" Header="" DataMemberBinding="{Binding IsValid}" />
<telerik:GridViewDataColumn Header="MRN" DataMemberBinding="{Binding MRN}" Width="*" />
<telerik:GridViewDataColumn Header="DOS" DataMemberBinding="{Binding DOS}" Width="*" />
<telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Description}" Width="*" />
<telerik:GridViewDataColumn Header="Provider" DataMemberBinding="{Binding ProviderName}" Width="*" />
<telerik:GridViewDataColumn Header="Start" DataMemberBinding="{Binding StartTime}" Width="*" />
<telerik:GridViewDataColumn Header="Stop" DataMemberBinding="{Binding StopTime}" Width="*" />
<telerik:GridViewDataColumn Header="Contents" DataMemberBinding="{Binding Contents}" Width="*" />
<telerik:GridViewColumn Header="" Width="20">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<telerik:RadButton Content="..." />
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<StackPanel Grid.Row="1">
<TextBlock Text="{Binding RecordListSummary}" HorizontalAlignment="Left" Margin="5" />
<TextBlock Text="{Binding CurrentItem.MRN,ElementName=gridv}" />
</StackPanel>
</Grid>
</
UserControl>

 

 

 

 

 

Maya
Telerik team
 answered on 25 Jan 2011
2 answers
169 views
Hello, i have an application, with docking scenario created by code.

I need to khow how prevent some RadPanes show compass, when drag over some RaqdSplitcontainers or RadPanesgroup.

I read:
http://www.telerik.com/help/wpf/raddocking-how-to-implement-conditional-docking.html

But this solution is for all docking elements, i need a conditional docking for each item :P, for example a RadPane never can be docked in the same splitcontainer of my RadPaneToolBar

Thanks in advance.
Fernando
Top achievements
Rank 1
 answered on 25 Jan 2011
1 answer
78 views
Hi,
I just noticed that the LayoutChangeStarted event is not fired when I select a different RadPane if the RadPanes have CanFloat set to false.  As soon as I set CanFloat to true, selecting between the tabbed panes causes the event to be fired.  Is this by design?  Is there another way to track the current selected pane?

Thanks.
Miroslav Nedyalkov
Telerik team
 answered on 25 Jan 2011
3 answers
224 views

Hello i have a problem, trying to edit a oRadTreeViewItem

All tree is generated by code (not binding)

RadTreeViewItem oRadTreeViewItem = new RadTreeViewItem(); 
oRadTreeViewItem.Header = "Name"; 
oRadTreeViewItem.IsEditable = true; 
oRadTreeViewItem.PreviewEditStarted += radTreeView_PreviewEditStarted; 
oRadTreeViewItem.Edited += DataViewExplorerTree_Edited;  
oRadTreeViewItem.EditStarted += radTreeView_EditStarted; 
DataViewExplorerTree.Items.Add(oRadTreeViewItem);

I use a context menu to edit the name of tree node using GetItemByPath to find the node

 

 


 


RadTreeViewItem oRadTreeViewItem = DataViewExplorerTree.GetItemByPath("Path of the item");


The item put's in edit mode but loss the header content. it's turn in Edit mode with empty content.

I try to catch radTreeView_EditStarted and radTreeView_PreviewEditStarted in order to rewrite the original header text. But only DataViewExplorerTree_Edited is fired when edit ends. Also trying to set focus to the edit box, but without success (tree is inside a dockpane)

private void DataViewExplorerTree_Edited(object sender, Telerik.Windows.Controls.RadTreeViewItemEditedEventArgs e)
        {
            RadTreeViewItem targetItem = e.Source as RadTreeViewItem;
             
           // (e.Source as RadTreeViewItem).IsInEditMode = false;
           //(e.Source as RadTreeViewItem).Background = new SolidColorBrush(Colors.Red);
        }
  
        private void radTreeView_PreviewEditStarted(object sender, Telerik.Windows.Controls.RadTreeViewItemEditedEventArgs e)
        {
            RadTreeViewItem targetItem = e.Source as RadTreeViewItem;
        }
  
        private void radTreeView_EditStarted(object sender, Telerik.Windows.Controls.RadTreeViewItemEditedEventArgs e)
        {
            RadTreeViewItem targetItem = e.Source as RadTreeViewItem;
        }

I try to use

oRadTreeViewItem.IsInEditMode = true;
  
or
       
 oRadTreeViewItem.BeginEdit();  (ALWAYS return false)

to start to edit node only first runs, the second always return me false.

Any ideas?

Thanks in advance.

Fernando
Top achievements
Rank 1
 answered on 25 Jan 2011
1 answer
247 views

Hi,

I have have a 2 level Treeview say country and its state. I dont want to highlight the parent node that is country on mouseover.Please let me know how to remove that default highlighting

-Regards,
Prajin
Petar Mladenov
Telerik team
 answered on 25 Jan 2011
6 answers
850 views
I'm not getting any kind of resize grip in the bottom right corner of the window as the ResizeMode property description says:

ResizeMode.CanresizeWithGrip - "A window can be resized.  The Minimize and Maximize buttons are both shown and enabled.  A resize-grip appears in the bottom right corner of the window."

No such grip appears anywhere.

Here are my RadWindow settings:

                window.Content = myContent;
                window.Header = "myContent Header";
                window.CanMove = true;
                window.ResizeMode = ResizeMode.CanResizeWithGrip;
                window.CanClose = false;
                window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                window.Width = 400;
                window.Height = 300;
                window.Show();

My Telerik.Windows.Controls dll version is: 2010.1.603.35

Am I doing something wrong?
Boyan
Telerik team
 answered on 25 Jan 2011
1 answer
146 views
Hello,

I wonder if there is a possibility to get all objects of an information layer which are contained within a specified polygon (geo coordinates).
There is a method "InformationLayer.GetElementsInRectangle" wich is almost what we need.

best regards
Andrey
Telerik team
 answered on 25 Jan 2011
3 answers
356 views
Hi,

I'm trying to set a template and the Expression_Dark theme to a tileviewitem, but I don't understand how to set both of them. I thought setting the template theme and then set this template to the tileviewitem, but I guess I don't set the theme to the template correctly. What is the right way of doing this?
I'll appreciate if you could provide me the needed lines of code.

Thank you
Zarko
Telerik team
 answered on 24 Jan 2011
1 answer
124 views
I am using a RadPanelBar control, and when RadPanelBar expands and collapses, it run very fast. How to adjust the speed of RadPanelBar  expand and collapse?
Tina Stancheva
Telerik team
 answered on 24 Jan 2011
1 answer
199 views
I have a DataGrid that i have a TimePicker column in.  I manipulated the sample custom column to just include a TimePicker element.  It works fine except for when the element tries to validate the input selected.  I have bound it to a TimeSpan item, but it gives me the validation error "Object of System.DateTime cannot be converted to TimeSpan".  So im unsure where to bind the TimeSpan item to get the selected DateTime.TimeOfDay??

 

 

 

<telerik:RadGridView AutoGenerateColumns="False" NewRowStyle="{StaticResource NewRowStyle}" RowStyle="{StaticResource RowStyle}" Foreground="White" HorizontalGridLinesBrush="White" Margin="10,10,210,22" Name="groupGrid" SelectionMode="Single" SelectionUnit="FullRow" VerticalGridLinesBrush="White" SelectionChanged="groupGrid_SelectionChanged" CellEditEnded="groupGrid_CellEditEnding" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False" ShowInsertRow="True" RowEditEnded="groupGrid_RowEditEnded">

 

 

 

 

<telerik:RadGridView.Columns>

 

 

 

 

<telerik:GridViewDataColumn Header="Task Name: " DataMemberBinding="{Binding Name}" />

 

 

 

 

<telerik:GridViewDataColumn Header="Description: " DataMemberBinding="{Binding Description}" />

 

 

 

 

<telerik:GridViewDataColumn Header="Solution: " DataMemberBinding="{Binding Solution}" />

 

 

 

 

<my:TimePickerColumn DataMemberBinding="{Binding StartTime}" Header="Start Time" TimeInterval="0:30:0"/>

 

 

 

 

 

<telerik:GridViewDataColumn Header="End Time: " DataMemberBinding="{Binding EndTime}" />

 

 

 

 

<telerik:GridViewDataColumn Header="Elapsed:" UniqueName="Elapsed" DataMemberBinding="{Binding ElapsedTime}" />

 

 

 

 

 

</telerik:RadGridView.Columns>

 

 

 

 

</telerik:RadGridView>

 

public class TimePickerColumn : GridViewBoundColumnBase
    {
        public TimeSpan TimeInterval
        {
            get
            {
                return (TimeSpan)GetValue(TimeIntervalProperty);
            }
            set
            {
                SetValue(TimeIntervalProperty, value);
            }
        }
  
        public static readonly DependencyProperty TimeIntervalProperty =  DependencyProperty.Register("TimeInterval", typeof(TimeSpan), typeof(TimePickerColumn), new PropertyMetadata(TimeSpan.FromHours(1d)));
  
        public override FrameworkElement CreateCellEditElement(GridViewCell cell, object dataItem)
        {
            this.BindingTarget =  RadTimePicker.SelectedValueProperty;
  
            RadTimePicker picker = new RadTimePicker();
            picker.IsTooltipEnabled = false;
  
            picker.TimeInterval = this.TimeInterval;
             
            picker.SetBinding(this.BindingTarget, this.CreateValueBinding());
  
            return picker;
        }
  
        public override object GetNewValueFromEditor(object editor)
        {
            RadTimePicker picker = editor as RadTimePicker;
            if (picker != null)
            {
                picker.DateTimeText = picker.SelectedTime.Value.ToString();
            }
  
            return base.GetNewValueFromEditor(editor);
        }
  
        private Binding CreateValueBinding()
        {
            Binding valueBinding = new Binding();
            valueBinding.Mode = BindingMode.TwoWay;
            valueBinding.NotifyOnValidationError = true;
            valueBinding.ValidatesOnExceptions = true;
            valueBinding.UpdateSourceTrigger = UpdateSourceTrigger.Explicit;
            valueBinding.Path = new PropertyPath(this.DataMemberBinding.Path.Path);
  
            return valueBinding;
        }
    }

Vanya Pavlova
Telerik team
 answered on 24 Jan 2011
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
DataPager
PersistenceFramework
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
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?