Telerik Forums
UI for WPF Forum
0 answers
110 views
Hi Support Team,
 
I would like to know and have the sample project in WPF how to add  new RowDetailsTemplate for every row of RadGridView dynamically because every row detail template will having different binding and different controls and navigation buttons at run time.

Please let me know either can I add a new RowDetailsTemplate for every row of RadGridView dynamically or not. I can, please provide the sample application how to achieve this.
My Code is following which adds but while expending row details it throw an exception which is following after the code.

class testApp
{
.....................
..................
 private void rgvParent_RowLoaded(object sender, RowLoadedEventArgs e)
        {
            DataTemplate dt = (DataTemplate)XamlReader.Parse(RowDetailsTemplate(count));
            e.GridViewDataControl.RowDetailsTemplate = dt;
                     
               
        }

        private string RowDetailsTemplate(int count)
        {
            return @" <DataTemplate
                   xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
                   xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
                   xmlns:telerik=""http://schemas.telerik.com/2008/xaml/presentation""
                   xmlns:Event=""clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity""
                   xmlns:cmd=""clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"" >
                   <telerik:RadGridView Name=""playersGrid" + count.ToString() + @"""     GridLinesVisibility=""Both"" IsReadOnly=""True"" AutoGenerateColumns=""true"" VerticalAlignment=""Top""
                              CanUserFreezeColumns=""False"" ShowGroupPanel=""false"" RowIndicatorVisibility=""Collapsed"" Width=""Auto"" Height=""Auto""
                              ScrollViewer.VerticalScrollBarVisibility=""auto""  ScrollViewer.CanContentScroll=""True"" ScrollViewer.HorizontalScrollBarVisibility=""auto""
                              SnapsToDevicePixels=""False"" VerticalContentAlignment=""Top"" CanUserResizeColumns=""False""  SelectionMode=""Single"" SelectionUnit=""FullRow""
                               Background=""#EAF3FC"" GroupPanelBackground=""#CFE3F9"">
                            <telerik:RadGridView.ColumnGroups>
                                <telerik:GridViewColumnGroup Name=""DefaultGroup" + count.ToString() + @""">
                                </telerik:GridViewColumnGroup>
                            </telerik:RadGridView.ColumnGroups>
                            <telerik:RadGridView.Columns>
                                <telerik:GridViewDataColumn ColumnGroupName=""DefaultGroup" + count.ToString() + @""" />
                                <telerik:GridViewDataColumn ColumnGroupName=""DefaultGroup" + count.ToString() + @""" />
                                <telerik:GridViewDataColumn ColumnGroupName=""DefaultGroup" + count.ToString() + @""" />
                            </telerik:RadGridView.Columns>
                        </telerik:RadGridView>
                   </DataTemplate>";
               
        }
    }


While expending row details it throws the following exception.

InvalidOperationException was unhandled

An infinite loop appears to have resulted from repeatedly invalidating the TimeManager during the Layout/Render process.


I hope someone will provide solution for this requirement.

Thanks
Laxman
Laxman
Top achievements
Rank 1
 asked on 27 Sep 2012
1 answer
165 views
Columns are not cannot be re-sized beyond grid width when at least one column has Width set to *. This is not the behavior that I would expect and in my opinion it makes the * option almost useless because as soon as you use it, resizing columns behaviors awkwardly where the grid always tries to maintain a static total width and steals the width from other existing columns when a column is made wider.

<Window x:Class="TelerikRadGridViewTest.MainWindow"
        Title="MainWindow"
        Height="350"
        Width="525">
    <Grid>
        <telerik:RadGridView Name="grdEstimates"
                             Margin="5,1,0,0"
                             ShowGroupPanel="False"
                             IsFilteringAllowed="False"
                             AutoGenerateColumns="False"
                             IsReadOnly="True">
            <telerik:RadGridView.Columns>
 
                <telerik:GridViewDataColumn Header="Column1"
                                            Width="*"
                                            SortMemberPath="Column1"
                                            UniqueName="Column1" />
                <telerik:GridViewDataColumn Header="Column2"
                                            Width="Auto"
                                            SortMemberPath="Column2"
                                            UniqueName="Column2" />
                <telerik:GridViewDataColumn Header="Column3"
                                            Width="Auto"
                                            SortMemberPath="Column3"
                                            UniqueName="Column3" />
                <telerik:GridViewDataColumn Header="Column4"
                                            Width="Auto"
                                            SortMemberPath="Column4"
                                            UniqueName="Column4" />
                <telerik:GridViewDataColumn Header="Column5"
                                            Width="Auto"
                                            SortMemberPath="Column5"
                                            UniqueName="Column5"
                                            DataFormatString="{}{0:C}" />
                <telerik:GridViewDataColumn Header="Column7"
                                            Width="Auto"
                                            SortMemberPath="Column7"
                                            UniqueName="Column7"
                                            DataFormatString="{}{0:C}" />
                <telerik:GridViewDataColumn Header="Column7"
                                            Width="Auto"
                                            SortMemberPath="Column7"
                                            UniqueName="Column7" />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>
</Window>


I would expect the behavior for Width * instead to fill the available space if there is additional available horizontal space within the RadGridView control to fill. Generally this would be equal to the situation where a horizontal scroll bar is not automatically shown because it is not needed. If there is no additional horizontal space to consume with the * columns(s) then either their MinWidth values and/or Auto behavior come into play to determine what the size of these columns should be. After initial layout is done and the user attempts to re-size a column, then any column should allow resizing to grow the column larger up until it's MaxWidth value and push any columns to extend into the clipped region causing horizontal scroll to become active if it wasn't already.

If I change the definition of Column1 so that it has a Width of Auto instead of * so effectively there are no * columns then everything works as expected. Well almost, that is except for when the total width of all columns is less than the width of the GridView control itself then I get what a lot of people describe as the "extra blank column" which I understand is just there because there are no * columns to automatically fill the space. This is where I would expect a properly behaving * column to kick in and properly consume that available space, but only in this situation.
Vlad
Telerik team
 answered on 27 Sep 2012
1 answer
192 views
I'm using RadGridView with a GridViewDataColumn defined with custom CellTemplate and CellEditTemplate defined. What I would like to do now is affect something defined in my DataTemplate for the CellTemplate based on whether it's row is selected or not.

More specifically in my example I have a DataTemplate that contains a TextBlock with TextTrimming and TextWrapping set up to show the text as a single line with character ellipsis when there is overflow. What I would like to do is display the text with TextWrapping turned on and without TextTrimming which I could do various ways if I can access the selection state of the parent row for that cell.

<telerik:GridViewDataColumn.CellTemplate>
    <DataTemplate>
        <TextBlock Text="{Binding Note}"
               TextWrapping="NoWrap"
               TextTrimming="CharacterEllipsis" />
    </DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>

What's the best way for me to accomplish this with the RadGridView control? Is there an inherited attached property I can use or will a relative binding work. I would prefer doing this through a defined style with triggers on my TextBlock if possible to avoid writing value converters.
Jeff
Top achievements
Rank 1
 answered on 26 Sep 2012
1 answer
152 views
Can I construct a bar chart, stacked, that looks like the following?

http://www.highcharts.com/demo/bar-negative-stack
Petar Kirov
Telerik team
 answered on 26 Sep 2012
1 answer
71 views
Hey
I think, the tile tells all.
I don't want the enduser be able to enter a negative price. - How can I do this!?

Thx for any tipp!
Tina Stancheva
Telerik team
 answered on 26 Sep 2012
7 answers
194 views
Hello,

I've got a few questions regarding the RadRichTextBox.

1. How can I make the IBeam cursor display only within the editable area of the text box, but not on the scroll bars as well?

2. I see that the rich text box doesn't come with a default Copy/Cut/Paste contextual menu. How would I go about implementing a standard contextual menu with working cut/copy/paste functions, and how would I display it.

If you are kind to answer these questions, please tell me how to solve the problems using C# code, and not XAML.

Thank you!
Vasil
Telerik team
 answered on 26 Sep 2012
5 answers
179 views
Hello there,

I am trying to implement cusom tooltips which can get focus and are interactive (they have a scrollbar for example).
Therefore I registered to the ToolTipOpening event of some WPF Ellipse objects (the ToolTip property is just set to some sensless string to force WPF to fire the event). In the event handler I just open a Popup with a BooleanAnimationUsingKeyFrames animation attatched which closes the popup after some seconds if it doesn't get focus.
This works very well, but when I tried the same with MapPolyLine it didn't - i.e. the event is not firing.

So my question is, if there is any event which is fired when a tooltip is requested.

Best regards,
Markus
Andrey
Telerik team
 answered on 26 Sep 2012
1 answer
118 views
I want to draw a simple ellipse in radmap 
with width and height 
20000,
but incorrectly like 
an elongated oval is drawn Why do this?
Other shape like rectangle has same problem 
too.
I add a simple radmap:

       <telerik:RadMap x:Name="radMap">
            <telerik:RadMap.Provider>
                <telerik:EmptyProvider />
            </telerik:RadMap.Provider>
            <telerik:InformationLayer x:Name="informationLayer">
            </telerik:InformationLayer>
        </telerik:RadMap> In code behind:
            var newShape = new MapEllipse()
            {
                Location = new Location()
                {
                    Latitude = 50,
                    Longitude = -111,
                },
                Fill = new SolidColorBrush(Color.FromArgb (0xFF, 0xF0, 0xB5, 0x85)),
                Width = 20000,
                Height = 20000
            };
            this.informationLayer.Items.Add(newShape);
            radMap.Center = new Location( newShape.Location.Latitude, newShape.Location.Longitude);
Andrey
Telerik team
 answered on 26 Sep 2012
3 answers
185 views
Hi!
I have the following column in a grid. I want the editing mode for the corresponding cells to be activated when the user clicks on cell, which is occupied by my custom control.

How can I do that?

<telerik:GridViewDataColumn>
    <telerik:GridViewDataColumn.CellTemplate>
        <DataTemplate>
        <my:ReferencesEditor References="{Binding Path=Answer.References}" />
        </DataTemplate>
    </telerik:GridViewDataColumn.CellTemplate>
    <telerik:GridViewDataColumn.CellEditTemplate>
        <DataTemplate>
        <my:ReferencesEditor References="{Binding Path=Answer.References}" EditMode="true" />
        </DataTemplate>
    </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
Vlad
Telerik team
 answered on 26 Sep 2012
1 answer
84 views
Hello,

since Version 2012 Q1 the selected Row Syle is gray instead of orange when the GridView lose the focus.
How can I change this?

Thanks.
Yordanka
Telerik team
 answered on 26 Sep 2012
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?