Telerik Forums
UI for WPF Forum
2 answers
163 views
Hello,

I'm trying to implement drag&drop in a radgridview.

I'm using this how to :
http://www.telerik.com/help/wpf/dragdropmanager-howto-draganddrop-within-radgridview.html

Everything is ok, but as soon as I add rowstyle code block, my rows are displayed blank (scrollbar remains visible).

This code is ok :

<telerik:RadGridView ItemsSource="{Binding Object.Details.Attributes}"
                        AutoGenerateColumns="True"
                        ScrollViewer.CanContentScroll="True"
                        ScrollViewer.HorizontalScrollBarVisibility="Visible"
                        ScrollViewer.VerticalScrollBarVisibility="Visible"
                        CanUserDeleteRows="False"
                        CanUserInsertRows="False"
                        CanUserReorderColumns="False"
                        CanUserResizeRows="False"
                        CanUserFreezeColumns="False"
                        CanUserSortColumns="False"
                        IsFilteringAllowed="False"
                        RowIndicatorVisibility="Collapsed"
                        ShowGroupPanel="False"
                        DataLoadMode="Asynchronous"
                        IsReadOnly="{Binding IsEditing, Converter={StaticResource InvertBoolConverter}}"
                        EnableRowVirtualization="True"
                        FrozenColumnCount="1"
                        AllowDrop="True"
                        behaviors:RowReorderBehavior.IsEnabled="True"
                        BeginningEdit="Attributes_RadGridView_BeginningEdit"
                     >
 
    <telerik:RadGridView.Resources>
        <DataTemplate x:Key="DraggedItemTemplate">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Dragging:" />
                    <TextBlock Text="{Binding CurrentDraggedItem}"
                  FontWeight="Bold" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding CurrentDropPosition}" FontWeight="Bold" MinWidth="45" />
                    <TextBlock Text=", (" Foreground="Gray" />
                    <TextBlock Text="{Binding CurrentDraggedOverItem}" />
                    <TextBlock Text=")"
                  Foreground="Gray" />
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </telerik:RadGridView.Resources>
     
 
 
 
    <telerik:RadGridView.Columns>
 
        <telerik:GridViewDataColumn Header="Attribute" DataMemberBinding="{Binding Attribute.TechName}" IsReadOnly="True"/>
        .......
        <telerik:GridViewDataColumn Header="Length" DataMemberBinding="{Binding Attribute.Details.LengthInternal}" IsReadOnly="True"/>
    </telerik:RadGridView.Columns>
     
</telerik:RadGridView>

But with this code, rows are displayed blank (only headers and scrollbars are visibles) :

<telerik:RadGridView ItemsSource="{Binding Object.Details.Attributes}"
                        AutoGenerateColumns="True"
                        ScrollViewer.CanContentScroll="True"
                        ScrollViewer.HorizontalScrollBarVisibility="Visible"
                        ScrollViewer.VerticalScrollBarVisibility="Visible"
                        CanUserDeleteRows="False"
                        CanUserInsertRows="False"
                        CanUserReorderColumns="False"
                        CanUserResizeRows="False"
                        CanUserFreezeColumns="False"
                        CanUserSortColumns="False"
                        IsFilteringAllowed="False"
                        RowIndicatorVisibility="Collapsed"
                      
                        ShowGroupPanel="False"
                        DataLoadMode="Asynchronous"
                        IsReadOnly="{Binding IsEditing, Converter={StaticResource InvertBoolConverter}}"
                        EnableRowVirtualization="True"
                        FrozenColumnCount="1"
                        AllowDrop="True"
                        behaviors:RowReorderBehavior.IsEnabled="True"
                        BeginningEdit="Attributes_RadGridView_BeginningEdit"
                     >
 
    <telerik:RadGridView.Resources>
        <DataTemplate x:Key="DraggedItemTemplate">
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="Dragging:" />
                    <TextBlock Text="{Binding CurrentDraggedItem}"
                  FontWeight="Bold" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding CurrentDropPosition}" FontWeight="Bold" MinWidth="45" />
                    <TextBlock Text=", (" Foreground="Gray" />
                    <TextBlock Text="{Binding CurrentDraggedOverItem}" />
                    <TextBlock Text=")"
                  Foreground="Gray" />
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </telerik:RadGridView.Resources>
     
 
 
 
    <telerik:RadGridView.Columns>
 
        <telerik:GridViewDataColumn Header="Attribute" DataMemberBinding="{Binding Attribute.TechName}" IsReadOnly="True"/>
           .....
        <telerik:GridViewDataColumn Header="Length" DataMemberBinding="{Binding Attribute.Details.LengthInternal}" IsReadOnly="True"/>
    </telerik:RadGridView.Columns>
 
    <telerik:RadGridView.RowStyle>
        <Style TargetType="telerik:GridViewRow">
            <Setter Property="Background" Value="Red"/>
            <Setter Property="telerik:DragDropManager.AllowDrag" Value="True" />
        </Style>
    </telerik:RadGridView.RowStyle>
 
</telerik:RadGridView>



Do you know what is the root cause ?

Thanks in advance,

Laurent
Dimitrina
Telerik team
 answered on 23 Sep 2013
7 answers
242 views
Hi,
I'm using MvvM and the RadCartesianChart.
I bind the series to a list of business objects of that kind:

public class MainViewModel
{
    public ObservableCollection<DataObject> Data{get;set;}
    ...
}
 
 
public class DataObject
{
    public string Name { get; set; }
    public ObservableCollection<DataPair> Data { get; set; }
}
  
public class DataPair
{
    public DateTime Time { get; set; }
    public double Value { get; set; }
}

In my View:

<telerik:RadCartesianChart.SeriesProvider>
    <telerik:ChartSeriesProvider Source="{Binding Data}">
        <telerik:ChartSeriesProvider.SeriesDescriptors>
            <telerik:CategoricalSeriesDescriptor ItemsSourcePath="Data" ValuePath="Value" CategoryPath="Time">
                <telerik:CategoricalSeriesDescriptor.Style>
                    <Style TargetType="telerik:LineSeries">
                        <Setter Property="RenderMode" Value="Light"/>
                    </Style>
                </telerik:CategoricalSeriesDescriptor.Style>
            </telerik:CategoricalSeriesDescriptor>
        </telerik:ChartSeriesProvider.SeriesDescriptors>
    </telerik:ChartSeriesProvider>
</telerik:RadCartesianChart.SeriesProvider>

How is it possible to change the color of each series at runtime.
If I put a Setter on the Stroke Property I got an exception: NullReferenceException


Regards Markus
Klemens
Top achievements
Rank 1
 answered on 23 Sep 2013
2 answers
249 views
I would like to know if there is some sample code to create a RadChart programmatically.

I only have this code in the xaml file:

<telerik:RadChart Content="RadChart" HorizontalAlignment="Left" Margin="10,455,0,10" Grid.Row="1" Width="791"/>

And I would like to create the series, configure the axes, bind the chart to a datatable where I have the data that I want to show, in the cs file.

Thanks,

Alberto
Alberto
Top achievements
Rank 1
 answered on 20 Sep 2013
2 answers
63 views
I have tried to ask a question on another thread, but have not gotten any support, so am generating a new thread. I have seen the example, and have based a project on it, but some features are not the same as the sample so not working. This is at least partially due to the version, but I do not currently have the ability to work on a newer version:

1) CurrentEditingContext is not the same, being a property with the current context, as opposed to a class with header and footer context properties, and there is no Table context. This also means that there is no possibility of INotifyPropertyChanged working for showing the Table and Header/Footer ribbons. Not sure what the best approach is to deal with showing these menus. Probably had an old version that worked.

2) The sample code does not contain the implementation for the content of the Insert Merge Field, so not sure what would be considered ideal. In addition, all the Mailings buttons are all disabled so cannot be sure if implementation is working

I tried to included the project, but changing the extension from zip to gif did not work. Give me a way to send the project and I will.

Thanks so much for the help.

										
Clifford
Top achievements
Rank 1
 answered on 20 Sep 2013
1 answer
144 views
<telerik:RadSplitContainer x:Name="Split" Width="300" >
<telerik:RadPaneGroup DockPanel.Dock="Top" >
<telerik:RadPane x:Name="radPane" Header="Elements" >
 <extensions:RadDiagramToolbox
  telerik:StyleManager.Theme="Windows8"
  Title="Gallery"
  DataContext="{StaticResource model}"
  ItemsSource="{Binding Galleries}"
  ItemTemplate="{StaticResource ToolboxGroupTemplate}"
  Width="{Binding Width, ElementName=radPane, Mode=TwoWay}"   />
 </telerik:RadPane>
</telerik:RadPaneGroup>
</telerik:RadSplitContainer>
Hi,I am using RadDiagramToolbox in code above.

So, the problem  occurs when I try to move splitter of SplitContainer.
Width of RadPane and RadDiagramToolbox change normal, but Width of RadDiagramToolbox 
 content have no changes.

Regads,
Yuriy
Pavel R. Pavlov
Telerik team
 answered on 20 Sep 2013
1 answer
43 views
Hi,

is there any possibility to stop history? In my case user writes into the radrichtextbox. If he writes some word/phrase, event DocumentContentChange is thrown and I make at this point something like:
Go throw the document and try to find "my" (from dictionary) words - set CaretPosition on the beginning of the document and then go step by step, word by word throw the document, setting selectionstart and selectionend and getting words from selection. If word is in my dictionary, set its foreground color.
After setting text foreground of whole document, colors are as shoud be. But problem is, that user cannot use undo/redo, because in history there are all selections used for coloring foregrounds. I need to make something like History.Stop()/Start() or finally set history from the beginning (but there is no setter).
Any idea how to work better with history? Any better solutions for my case? Maybe I shoud set foreground somehow a better way...

Thanks so much for help.
Petya
Telerik team
 answered on 20 Sep 2013
0 answers
105 views
Hello,

I'm using the RadGridView WPF control and I need to know when a row has moved.

Let me explain the situation, I have a hierarchical RadGridView control with rows and his details rows. I have an user control which is linked to each main row by X and Y position. When I expand a row, I need to know the position of next rows to update all user controls attached.

Do you see what I mean ?

Best regards,

Loic.

UPDATE : I have attached an image to explain what I mean. Thakns.
Loic
Top achievements
Rank 1
 asked on 20 Sep 2013
2 answers
315 views
Hello All,

I'm trying to setup the following scenario, running version 2013.2.724.40:
  • On my ViewModel, I have a QueryableCollectionView, with an EntityFramework IQueryable as it's source
  • I have a DataGrid, bound to this QueryableCollectionView
  • I have a DataPager, linked to this DataGrid

<telerik:RadGridView x:Name="radGridView"
         ItemsSource="{Binding MyQueryableCollectionView}"
         AutoGenerateColumns="True" />          
<telerik:RadDataPager
         Source="{Binding Items, ElementName=radGridView}"
         PageSize="10" DisplayMode="All" />

When I run this app, everything looks fine:
  • A query is ran on the db, selecting the top 10 records for the first page
  • The DataGrid shows the first page, 10 records
  • The DataPager calculates the correct number of pages

However, when I move to the second, third, .. page, the page is empty.
No new query is ran on the db to select the next 10 records.

Is this kind of scenario not supported out of the box?



Notes:
  • It does work when I load the entire record set when creating the QueryableCollectionView
    (of course, I do NOT want to do this, that's why I use paging)
  • I also tried by binding the DataPager Source to the QueryableCollectionView, but this has the same behavior.
    <telerik:RadGridView
             ItemsSource="{Binding MyQueryableCollectionView}"
             AutoGenerateColumns="True" />         
    <telerik:RadDataPager
             Source="{Binding MyQueryableCollectionView}"
             PageSize="10" DisplayMode="All" />
Dimitrina
Telerik team
 answered on 20 Sep 2013
1 answer
158 views
Hello

I'm trying to set the background for my chart to a specific backgroundcolor. But I don't want the whole chart to be that color, just the grid itself. But if I set that background, the color doesn't change.

<telerik:RadCartesianChart.Grid>
 <telerik:CartesianChartGrid MajorLinesVisibility="X" MajorXLineStyle="{StaticResource StripLinesStyle}" Background="#D8D3D0"/>
 </telerik:RadCartesianChart.Grid>


Also I was trying to set the color of the axis, and I couldn't find that option. Attached is an image of what I'm trying to make, not minding the graphs itself ;)

Thanks
Waut
Petar Kirov
Telerik team
 answered on 20 Sep 2013
5 answers
165 views
Hi there,

I'm facing to a weird issue. I have a RadGridView that is using Grouper Headers and Horizontal Scrolling.

When I want to export the grid without have been playing with the scrolling, the grouped headers are not exported correctly in the excel file. It is like if only the visible groups on the screen are able to be exported.

In opposite if I play with the scrolling before exporting the grid, the grouped headers will be correctly exported.

Have you got any idea about this issue?

Thank you in advance.

Alain

<telerik:RadGridView x:Name="StudyDisplayAllDataGrid"
AutoGenerateColumns="False" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
AutoExpandGroups="True" RowIndicatorVisibility="Collapsed" ShowGroupPanel="False"
IsReadOnly="True" GroupRenderMode="Flat"
Visibility="{Binding AnyProduct, Converter={StaticResource booleanToVisibleConverter}}"
ItemsSource="{Binding StudyProductsGrid}"/>


Using stream As IO.Stream = dialog.OpenFile()
            StudyDisplayAllDataGrid.Export(stream, New GridViewExportOptions() With { _
             .Format = ExportFormat.Html, _
             .ShowColumnHeaders = True, _
             .ShowColumnFooters = True, _
             .ShowGroupFooters = False _
            })
         End Using
Dimitrina
Telerik team
 answered on 20 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?