Telerik Forums
UI for WPF Forum
3 answers
256 views

I was using the radtreeview with quite a lot of nodes and found that performance was slow. I read telerik documentation and it said I can use treelistview as an alternative to treeview. Now when I try to implement loadondemand on this treelist view, during the isexpand property even though the children are added to collection the grid is not refreshed. Since this collection is stored as static variable, when I close the form and open it it displays the parent and children. My isexpanded is implemented in viewmodel where it hits the db and gets the collection. Is there something I am missing in order to implement loadondemand or is this feature not available. I am using WPF Q2 SP1 controls
<
  

<Window.Resources

 

 

 

 

 

<Style x:Key="TreeListViewStyle" TargetType="{x:Type telerik2:TreeListViewRow }">  

 

 

 

<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> 

 

 

 

 

 

</Style>

 

 

 

 

 

 

 

</Window.Resources>

 

 

 

 

 

 

 

 

<telerik:RadTreeListView x:Name="rdTreeList" AutoGenerateColumns="False"

 

 

 

Width="Auto" RowStyle="{StaticResource TreeListViewStyle}"

 

 

 

ItemsSource="{Binding UnitValueObjectList,Mode=TwoWay}"

 

 

 

>

 

 

 

 

 

 

 

<telerik:RadTreeListView.ChildTableDefinitions>

 

 

 

 

 

 

 

<telerik:TreeListViewTableDefinition ItemsSource="{Binding Path=ChildNodes,Mode=TwoWay}" >

 

 

 

 

 

 

 

</telerik:TreeListViewTableDefinition>

 

 

 

 

 

 

 

<telerik:TreeListViewTableDefinition ItemsSource="{Binding Path=ChildNodes,Mode=TwoWay}"/>

 

 

 

 

 

 

 

<telerik:TreeListViewTableDefinition ItemsSource="{Binding Path=ChildNodes,Mode=TwoWay}"/>

 

 

 

 

 

 

 

</telerik:RadTreeListView.ChildTableDefinitions>

 

 

 

 

 

 

 

<telerik:RadTreeListView.Columns>

 

 

 

 

 

 

 

<telerik:GridViewDataColumn DataMemberBinding="{Binding Name,Mode=TwoWay}" Header="Name" />

 

 

 

 

 

 

 

</telerik:RadTreeListView.Columns>

 

 

 

 

 

 

 

</telerik:RadTreeListView>

 

 

>

 

 

 

Vlad
Telerik team
 answered on 05 Jan 2011
2 answers
92 views
Hello,

I am unable to change the GroupPanel style through WPF resource dictionary :

<Style TargetType="{x:Type telerik:GridViewGroupPanel}">
        <Setter Property="BorderThickness" Value="5"/>
</Style>

I have already used ms Blend to edit a copy of the whole GridView template into my dicitionary. When i tried to 'Edit A Copy' on the GridViewGroupPanel, the only option available is 'Create Empty'. Anyhow, GroupPanel stays 'UnTouchable'.

How can i control the visualiztion of group panel?

Thanks,
Oran
Oran
Top achievements
Rank 1
 answered on 05 Jan 2011
5 answers
248 views
What is the best practice...?

When Telerik comes out with new versions or internal builds, we always try to follow.
We download the files (unblock the dll's) and we copy the files into a (new) directory.
Sometimes we remove all the Telerik dll's from the projects References and we add the new dll's.
Sometimes we unload the projects and replace the telerik version in the text of the projectfiles.
We clean and rebuild our solutions.

This works fine, but... we often have problems with showing the telerik-components in the xaml /designer).
An error shows: Could not load file or assembly 'Telerik.Windows.Controls, Version=2010.3.1304.40...
Yes, we know that Visual Studio's xaml-design-mode is almost useless, but know and than we have to use it...

What are we doing wrong?
What is the best practice to update a solution with a new version or an internal build?
Veselin Vasilev
Telerik team
 answered on 05 Jan 2011
2 answers
279 views

Hi,
I am using custom context menu to apply flter on hierarchical radtreelistview.
I am binding the radtreelistview to an ObservableCollection<>.
In order to apply filter, I am using the below code

 

private

 

 

void RadMenuItem_Click(object sender, Telerik.Windows.RadRoutedEventArgs e)
{

    if ((sender as RadMenuItem).Header.Equals("Filter By Selection"))
        {
 
            FilterDescriptor descriptor = new FilterDescriptor();
            descriptor.Member = strClickedColumn;
            
descriptor.Operator = FilterOperator.IsEqualTo;
            descriptor.Value = strClickedColumnData;
            this.RadTreeListView1.FilterDescriptors.Add(descriptor);
        }
}

But i am not getting the desired results.
Instead,the radtreelistview displays 0 items.
Can you please share a sample project which provides a working solution for custom filter?

 

Maya
Telerik team
 answered on 05 Jan 2011
1 answer
112 views
I'm trying virtualization on the TreeView, and I have a RadTreeViewItem Style to set the IsExpanded property to true. If I set IsVirtualizing to true in the tree, the the Style does not apply, but if I set it to true, it does. Is there any way to fix this?

This is what my style looks like:

<Style TargetType="{x:Type telerik:RadTreeViewItem}">
    <Setter Property="IsExpanded" Value="True" />
</Style>

Thanks!
Petar Mladenov
Telerik team
 answered on 05 Jan 2011
4 answers
160 views
I have a urgent requirement of implementing custom sorting on maximum 3 columns of WPF grid.
I am implementing paging in WPF RadGrid Control which has maximum fetch size of 500 records. Rest of the records remains on the server.
Requirement is when I click on Grid Column Header I need to send the column name as well as Sorting State to the server. Also, when another column header is clicked it should again give a call to Server method and send the first as well as second column name and their respective SortingStates. Maximum 3 columns can be sorted.
Kindly suggest.
Harshal
Top achievements
Rank 1
 answered on 05 Jan 2011
2 answers
377 views
Hi..
Just wondering how do you export the GridView to XML.. how is the XAML converted to XML?
Just curious.
thanks
Jon
Top achievements
Rank 1
 answered on 05 Jan 2011
2 answers
113 views
When you have a data with many columns, and your horizontal scrollbar is at the leftmost position, and you try to horizontally scroll quickly, the grid sometimes will not register it or will move a bit and then quickly "snap back" to the leftmost spot. I'm not sure why this happens but it makes for an annoying user experience. Column and Row virtualization is turned on.

Any ideas on why this happens?

StackOverflowed
Top achievements
Rank 1
 answered on 04 Jan 2011
4 answers
143 views

I have I problem with a RadGridView. ..

 

I'm using the MVVM pattern and each row in the gridview is bound to its own ViewModel. At a certain point in the execution of the program I save a row to the database (this is done in the ViewModel of the row). This might have the consequence that some property in the ViewModel of the row is updated. Therefore I trigger the PropertyChanged event without specifying a property name, which will tell the row in the GUI to read the values of all the properties it is bound to.

 

My problem is that sometimes when I do this, the gridview tries to set the old values of the properties back to the ViewModel. Let's say I have a column bound to a property "Age" that has the value 34; then it will set the value of the property to 34. Normally, this is not a problem (since in the end the property will still have the same value). However, my rows can have one of two states, and in one of those states some of the cells/properties are not allowed to change. I enforce this in the GUI so that it is impossible to change a value of a cell/property that is not allowed to change. But to really make sure this never happens (in case some developer makes a mistake in the GUI), I throw an exception in the ViewModel if you try:

 

public int Age
{
    get { return _age; }
    set
    {
        if(IsAllowedToChangeAge)
        {
            if(value != _age)
            {
                _age = value;
                OnPropertyChanged("Age");
            }
        }
        else
        {
            //The GUI should make sure this never happens.
            throw new Exception("Cannot change age if...");
        }
    }
}

 

This works fine in normal cases because the GUI makes sure it never happens. In the example above, the user won't be able to edit the cell bound to Age if the IsAllowedToChangeAge property is false.

 

BUT as mentioned, sometimes when the ViewModel tells the gridview to update (through the PropertyChanged event), the gridview itself tries to set the values of the grid (to the same values as it had). When this happens and and the row is in a state that doesn't permit the values to change, the exception will be thrown!

 

How can I get around this? Why does the gridview set the same values as it already has? Can I stop this from happening? I have not found a pattern for when it happens...

 

I could get around this by not throwing an exception, but I'd really like to keep it to catch any developer mistakes.

 

Thanks // David

haagel
Top achievements
Rank 1
 answered on 04 Jan 2011
4 answers
57 views

How can i reorder columns  in TreeListView?

In GridView works fine but in TreeListView not :(

Lóránt
Top achievements
Rank 1
 answered on 04 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?