Telerik Forums
UI for WPF Forum
2 answers
161 views
I have a RadTreeView that is using  hierarichal data template, and it is binded with thousands of records.
I am using UI Virtualization, to increase performance and the VirtualizationMode is standard.

In my case, i want to choose a group and highlight all children recursively, however it don't highlight all the children, and i guess this is due to the virtualization, as some of the children are not yet rendered.

This is my xaml tree code:

 

<my:RadTreeView Margin="2,2,2,0" IsLineEnabled="True" Name="RadtreeView1" IsVirtualizing="True" tree:TreeViewPanel.VirtualizationMode="Hierarchical" IsLoadOnDemandEnabled="True" TabIndex="1" telerik:TextSearch.TextPath="Fields.Name" IsDragDropEnabled="False" SelectionMode="Multiple" Background="White" KeyDown="RadtreeView1_KeyDown" Selected="RadtreeView1_Selected" ScrollViewer.VerticalScrollBarVisibility="Visible">
  
  
  
<telerik:RadContextMenu.ContextMenu >
  
  
  
<telerik:RadContextMenu x:Name="RadContext" Opened="RadContextMenu_Opened" >
  
  
  
<MenuItem Header="Select All Children" Click="MenuItem_Click"/>
  
  
  
</telerik:RadContextMenu>
  
  
  
</telerik:RadContextMenu.ContextMenu>
  
<my:RadTreeView.ItemTemplate>
  
  
  
<HierarchicalDataTemplate >
  
<StackPanel Orientation="Horizontal" >
  
  
  
<Image Source="{Binding Path=Fields.ImagePath}"></Image>
  
  
  
<TextBlock Text="{Binding Path=Fields.Code}" Foreground="{Binding Path=Fields.isGroup,Converter={StaticResource BoolFontConverter} }" Width="50"></TextBlock>
  
<TextBlock Text=" | " Foreground="{Binding Path=Fields.isGroup,Converter={StaticResource BoolFontConverter} }"></TextBlock>
  
<TextBlock Text="{Binding Path=Fields.Name}" Foreground="{Binding Path=Fields.isGroup,Converter={StaticResource BoolFontConverter} }" Width="200"></TextBlock>
  
<TextBlock Text=" | " Foreground="{Binding Path=Fields.isGroup,Converter={StaticResource BoolFontConverter} }"></TextBlock>
  
<TextBlock Text="{Binding Path=Fields.Alias}" Foreground="{Binding Path=Fields.isGroup,Converter={StaticResource BoolFontConverter}}" Width="200"></TextBlock>
  
</StackPanel>
 
</HierarchicalDataTemplate>
  
</my:RadTreeView.ItemTemplate>
  
  
  
</my:RadTreeView>
This is the C# Code of recursion selection :

 

 

foreach(RadTreeViewItem item in SelectedNode.ChildrenOfType<RadTreeViewItem>())
  
{
  
item.IsSelected = true;
  
}

 


Notes:
1-This code do not select all the children.
2-SelectedNode is of type RadTreeViewItem.


Thanks in advance
Bill
Top achievements
Rank 1
 answered on 26 Apr 2013
7 answers
243 views
Hi,

I used the GridView example "Various Data Sources" as a guide in loading xml data into a Grid View. That is fill a dataset and then executes a DataSet.GetXml() to get the xml.  This works great except that all the columns are of system type string. Can you tell me how to get the correct system data types into the GridView?

Thanks
Rich
Richard Harrigan
Top achievements
Rank 1
 answered on 26 Apr 2013
1 answer
356 views
There seems to be a bug with the raddatepicker, when a bound property is updated, the value displayed is not updated to the correct value. I'm trying to prevent the user from entering a future date, and I can step through the property and field is setting it correctly, also, after the change is raised, it's returning the new date set in code behind, but the UI still displays the typed in date.  This code works as expected with the built in WPF datepicker. (ie the UI updates to the correct date (DateTime.Now) if a future date is entered).

<telerik:RadDatePicker SelectedDate="{Binding Path=ApplicationDate, Mode=TwoWay}" DisplayDateEnd="{x:Static sys:DateTime.Now}"/>


The property for the bound value is defined as
public DateTime? ApplicationDate
        {
            get { return Loan.ApplicationDt; }
            set
            {
                if (value > DateTime.Now.Date)
                    Loan.ApplicationDt = DateTime.Now.Date;
                else
                    Loan.ApplicationDt = value;
                RaisePropertyChanged("ApplicationDate");
            }
        }
Eric
Top achievements
Rank 1
 answered on 25 Apr 2013
3 answers
147 views
Hi,

How to achieve the following behavior: I need to show the concrete child (string type) from the parent container:

<telerik:PropertyDefinition Binding="{Binding Container}">
    <telerik:PropertyDefinition.NestedProperties>
        <telerik:PropertyDefinition Binding="{Binding Children[0]}"/>                          
    </telerik:RadPropertyGrid.PropertyDefinitions>
</telerik:PropertyDefinition>

It does not enter the Children collection.
I've tried to write the converter but the result - it shows combobox instead of textbox.

public class EnumerableConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {            
            var enumerable = (IEnumerable)value;
            var index = 0;
            var position = int.Parse((string) parameter);
            var enumerator = enumerable.GetEnumerator();
            while (enumerator.MoveNext())
            {
                if (index == position)
                {
                    return enumerator.Current;
                }
                index++;               
            }
            return null;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

Thanks
Maya
Telerik team
 answered on 25 Apr 2013
1 answer
107 views

Hello,

I’m using the RadGridView in my application to show a list of items. As I started to use grouping, I encountered some problems.

  1. It seems that grouping is disabled if there are invalid items in the data grid. Though I found a way to overcome this (I need the grouping feature for my application all the time, even if there is an invalid item in the grid) I wondered if there is a regular solution to enable grouping while having an invalid row in the grid.
  2. An InvalidOperationException is thrown in the CollapseAllGroups method. The exception message says “No collection”.
    Here is my scenario: I selected two grouping criteria (e.g. “User” and “Date”). So if I have only one element of a specific user in the specific date I’ll get the exception I previously described.
  3. I want to be able to jump through the cells of the selected row by pressing the tabulator key. The problem is: if I have set at least one grouping criteria, pressing the tabulator key opens the next group instead of jumping to the next cell of the currently selected row.
  4. Although I found out, that an event which gets attached to the PropertyChanged event of the selected item in the code behind no longer is executed if I group the grid. The event is still attached, but no changes on the item trigger it. So my question is: does grouping override normal code behind with own default methods?
Ivan Ivanov
Telerik team
 answered on 25 Apr 2013
3 answers
202 views
Hi,

I bind a PropertyGrid to a pretty complex object generated by Linq2SQL.
I implemented IDataErrorInfo on the object.
Further let the PropertyGrid autogenerate the properties.

Now I have two Problems - this[string ColumnName] never gets called.
Next - the property Grid tries to bind "Error" (I know I can fix this in code behind - but this would break my so far "no code behind" MVVM design) - but this isn't very important.
Last not least I implemented "IsValid" like in the following snippet.
    public static bool IsValid(this DependencyObject obj) {
            // The dependency object is valid if it has no errors, 
            //and all of its children (that are dependency objects) are error-free.
            return !Validation.GetHasError(obj) &&
                GetVisualTreeChildren(obj)
                .OfType<DependencyObject>()
                .All(child => IsValid(child));
        }
        //VisualTreeHelper don't have a method to get all the children of a visual object
        private static IEnumerable GetVisualTreeChildren(DependencyObject parent) {
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
                yield return VisualTreeHelper.GetChild(parent, i);
        }
 
 
//OK handler in VM using the IsValid extension
    protected override bool HandleOKCanExecute(object arg) {
            if (this.TheView != null) {
                return(this.TheView.IsValid());
                }
            return (false);            
        }

I further know that I could decorate my object with attributes - but the reason to use your PropertyGrid is that the object is large (a lot of properties) and I don't want to define all these things. And it would be hard without touching the Linq2Sql autogenerated code.

Main Problem - no validation (this[string ColumnName] occurs.

Manfred
Ivan Ivanov
Telerik team
 answered on 25 Apr 2013
1 answer
295 views
Hello,
I have tried to find IP Address sample of RadMaskedInput, but it seems that all sample links are broken.
Could you give me a sample for IP Address input?
Thank you.
Pavel R. Pavlov
Telerik team
 answered on 25 Apr 2013
1 answer
122 views
Hi,
I want to populate RadTimeBar intervals by my own array of dates and allow to snap selection to this date breaks only. Is it possible?
Tsvetie
Telerik team
 answered on 25 Apr 2013
4 answers
322 views
Hello
I've created following tooltip for cell:
<telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" >
    <telerik:GridViewColumn.ToolTipTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding ID}" Foreground="Red" />
                <TextBlock Text=" - " />
                <TextBlock Text="{Binding Text}" Foreground="Blue" />
            </StackPanel>
        </DataTemplate>
    </telerik:GridViewColumn.ToolTipTemplate>
</telerik:GridViewDataColumn>
But I cannot now delay it in any way:

I tried ToolTipService InitialDelay for column and grid and delay between show and nothing is changing I tried to set it to 2 sec, so value should be 2000.

Marcin
Top achievements
Rank 1
Veteran
 answered on 25 Apr 2013
8 answers
224 views
Hi,

actually I have VS2008 and VS2010 on my computer and Telerik was installed in my VS2008 but not in my VS2010. How it's possible to get Telerik insatlled in my VS2010?

Thank's
LittleDragon
Top achievements
Rank 1
 answered on 25 Apr 2013
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?