Telerik Forums
UI for WPF Forum
1 answer
363 views
Hi Guys,

Sometimes my gridview has ItemSource count = 10, but items.count = 0. Sometimes the counts are same. I remembered someone has posted some similar issue but I can't find it any more. Any answers? Also, when should I use grid.Rebind() function?

Thanks,
Milan
Telerik team
 answered on 12 Nov 2009
1 answer
103 views
There is a rendering artifact when you place a menu inside a toolbar like so
<t:RadToolBar DockPanel.Dock="Top" Height="25"
            <TextBlock Text="Select Job:" Margin="2,2,5,0"/> 
 
            <t:RadComboBox x:Name="cmbJobs" Width="200" IsTabStop="False" IsEditable="True" StaysOpenOnEdit="True" /> 
            <t:RadMenu Background="Transparent"
                <t:RadMenuItem Header="Filter"
                    <t:RadMenuItem Header="Show All Jobs" Checked="MenuItem_Checked_All" Name="mnuShowAllJobs" IsCheckable="True"/> 
                    <t:RadMenuItem Header="Show Unfinished" Checked="MenuItem_Checked_Unfinished" Name="mnuShowUnfinishedJobs" IsCheckable="True"/> 
                </t:RadMenuItem> 
            </t:RadMenu> 
        </t:RadToolBar> 

Look above the Filter MenuItem above the attached picture
Ivan
Telerik team
 answered on 11 Nov 2009
2 answers
79 views
I was wondering if there was a way to get all the selected items in the grid. Both main grid and Hierarchy Details? I am coming from an Xceed background where they have GlobalSelectedItems. How can I accomplish this with telerik's WPF DataGridView?
MiddleTommy
Top achievements
Rank 1
 answered on 11 Nov 2009
9 answers
460 views
Hi,

I am working with Telerik Self-referencing RadGridView. RadGridView displays hierarchial manner. When a record in the RadGridView is expanded, I intend to make a database query via WCF service. I then wish to populate the parent record (the one being expanded) with the newly fetched child record. Hence the ObservableCollection<> of records are created at run-time when the user expands particular record of the grid.
I could successfuly fetch the base record (records at level 0) and display it. Root record has a dummy child which is refreshed when the user expands the root record. Once the child records are available, I change the root record's data binding with the new child record (root.ChildNode = childNodeCollection to build the hierarchy). However, when I change the child record of the parent (parent.ChildNode = null initially and then later on set to childNodeCollection), I want to refresh the grid view. How do i accomplish this ? Invoking RadGridView.ReBind() collapses all the currently expanded rows which I want to avoid!

Milan
Telerik team
 answered on 11 Nov 2009
3 answers
190 views
Hi,

I don't get an answer for this issue. So, I have to re-post it again. Hope someone can help me out here.

The sample Telerik gave is not the same case as my application. The sample is quite simple. Load 100 rows, select a row and then scrollIntoView.

My case is:

Let's say I have 10 records in the collection which is binding to the grid. I added one more record to the collection. grid.items.count turns to 11. SelectedItem goes to the newly added one. Then I tried to scrollIntoView this newly added record. It gave me the below error message. It seems although the grid recognize the newly added record, the ScrollIntoView does not know this item. 

"Object reference not set to an instance of an object."

at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertContainer(Int32 childIndex, UIElement container, Boolean isRecycled)\r\n   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.InsertNewContainer(Int32 childIndex, UIElement container)\r\n   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.AddContainerFromGenerator(Int32 childIndex, UIElement child, Boolean newlyRealized)\r\n   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.BringIndexIntoView(Int32 index)\r\n   at Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollRowIntoView(Object item)\r\n   at Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoView(Object item)\r\n  

Milan
Telerik team
 answered on 11 Nov 2009
1 answer
67 views
When I set the RadGridView to AutoGenerateColumns It generates columns for all Properties in my object even Properties that are Collections or IEnumerable. Is there a way to disable AutoGenerating IEnumerable Columns? Pretty much all of my Objects have relation properties that are IEnumerable.
Vlad
Telerik team
 answered on 11 Nov 2009
3 answers
102 views
Hello everybody,
I have a RadGridView with the itemssource set to an observable collection typed on a Linq table.
When this is empty, if I scroll with the mouse wheel when the mouse is in the grid area, the application generates an exception that I am not able to handle.
How can I avoid this?

Thanks a lot in advance for your interesting.

Nick
Vlad
Telerik team
 answered on 11 Nov 2009
1 answer
90 views
Hi,

Player_AllPlayers_GridView control inherits from the RadGridView and its ItemSource is set to an ObsarvableCollection maintained in a web service tier. In general everything works properly. I just cannot get control over my customised sorting. Since, I am using my own paging scheme, I would like to capture the Sorting event. Therefore, I am attaching a handler for it (see below). Then, in the handler I retrieve the items that I am interested in which are already sorted on the server. The RadGridView does display the new items correctly. Unfortunatelly, it does its OWN sorting beforhand. Setting e.Handled = true does not change anything, the "internal" sorting still happens first and my sorting afterwards.
The second question is about the DataLoaded event. It is executed after each row is loaded for the RadGridView. Is there an event that is executed (only once) after all rows have been loaded?

public partial class MainContent()
{
    Player_AllPlayers_GridView grid;
    [...]

    public  MainContent()
    {
        InitializeComponent();
  
        //I am feeding an ObservableCollection reference to the RadGridView
        grid = new Player_AllPlayers_GridView(MainPage.webservices.WebService.ProfileList);
        grid.DataLoaded += grid_DataLoaded;
        grid.Sorting += grid_Sorting;
    }
}

void grid_Sorting(object sender, Telerik.Windows.Controls.GridViewSortingEventArgs e)
{
    string sortDesc = e.SortPropertyName;
    if (e.NewSortingState == Telerik.Windows.Controls.SortingState.Descending)
        sortDesc += "_desc";
    // Here I am just repopulating the ObservableCollection that is assigned to this grid
    HeaderClickRetrieveSortedProfiles(sortDesc);
    e.Handled = true;
}

void grid_DataLoaded(object sender, EventArgs e)
{
        [...]
}

regards, Przemek
Rossen Hristov
Telerik team
 answered on 11 Nov 2009
1 answer
131 views
Ok.  I have a small project open (only copy of VS open) and when I start it up I am using 2gb when idle.  After loading my project with the new WPF controls everything seems fine right off the bat.  After developing for around 30 minutes I notice that my project is lagging extremely bad (taking 10 seconds to come back where I can type).  I take a look at my task manager and I am now at 3.5 GIGS when idle.
This only seems to happen with the new WPF controls loaded.
I have the following libraries loaded in my project:
 - Telerik.Windows.Controls
 - .Controls.Gridview
 - .Controls.Input
 - .Controls.Navigation
 - .Controls.RibbonBar (possible suspect)
 - Telerik.Windows.Data

The controls that I am actually using my small project are:
 - RadGrid
 - RadRibbon
 - RadRibbonGroup
 - RadRibbonTab
 - RadRibbonButton
 - and other base WPF controls like normal textblock's and whatnot.

I have before and after photo's of my machine's task manager to show stats if needed.

This is a really big problem because I am having to restart my VS instance every 20-40 minutes (sometimes as little as 10 minutes).
Has anyone else had this problem?  Is this a known issue?
Milan
Telerik team
 answered on 11 Nov 2009
3 answers
649 views
Hello

I'm using a details template for a row as follows:
<DataTemplate x:Key="DiscussionDetailsTemplate"
            <Grid> 
                <Grid.ColumnDefinitions> 
                    <ColumnDefinition Width="Auto" /> 
                    <ColumnDefinition Width="*" /> 
                </Grid.ColumnDefinitions> 
                <Grid.RowDefinitions> 
                    <RowDefinition Height="Auto"/> 
                </Grid.RowDefinitions> 
                <TextBlock Grid.Row="0" Grid.Column="0" Text="Discussion Text: " Margin="12,0,0,0" FontSize="13" FontWeight="Bold" /> 
                <TextBlock Grid.Row="0" Grid.Column="1" Text="{Binding mNotes}" TextWrapping="Wrap" FontSize="13" Margin="12,0,0,0" HorizontalAlignment="Left" /> 
            </Grid> 
        </DataTemplate> 

Basically, the details template shows a potentially long message in a discussion.  Here's the code for the grid using the template:

<telerik:RadGridView Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Name="DiscussionListGridView" Style="{DynamicResource DefaultGrid}"  
                                 ItemsSource="{Binding DiscussionList}" SelectedItem="{Binding SelectedDiscussion}" AutoGenerateColumns="False"  
                                 ScrollMode="RealTime" DataLoadMode="Synchronous" CanUserSortColumns="True"  
                                 RowDetailsVisibilityMode="VisibleWhenSelected" RowDetailsTemplate="{StaticResource DiscussionDetailsTemplate}" 
                                 > 
                <telerik:RadGridView.Resources> 
                    <Style TargetType="telerik:RadGridView"
                        <Setter Property="ShowGroupPanel" Value="False"/> 
                    </Style> 
                </telerik:RadGridView.Resources> 
 
                <telerik:RadGridView.Columns> 
                    <telerik:GridViewDataColumn Width="Auto" Header="From" Name="AuthorName" IsReadOnly="True" DataMemberPath="sgAuthorName"  
                                                TextWrapping="Wrap"  /> 
                    <telerik:GridViewDataColumn Width="*" Header="Subject" Name="Subject" IsReadOnly="True" DataMemberPath="sgDescription"  
                                                TextWrapping="Wrap" /> 
                    <telerik:GridViewDataColumn Width="Auto" DataFormatString="{}{0:dd/MM/yyyy}" Header="Date" Name="StatusDateDue"  
                                                IsReadOnly="True" DataMemberPath="dtDateCreated" TextWrapping="Wrap"  /> 
                </telerik:RadGridView.Columns> 
            </telerik:RadGridView> 

The problem that I'm having is that if the text is particularly long in the row details view, it won't wrap automatically.  Instead it forces a scrollbar at the bottom of the grid and makes the user manually scoll - this isn't my desired behaviour.

Any tips on how to cause the text to wrap correctly?



James
Top achievements
Rank 1
 answered on 11 Nov 2009
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?