Telerik Forums
UI for WPF Forum
1 answer
85 views

Hello there,

I got a little problem Binding MinHeight and Height of DragResizeSlotHighlightContainer to a Property of a GanttTask.

So for the EventContainer everything works fine, I solved it this way:

<Style TargetType="telerik:EventContainer" BasedOn="{StaticResource EventContainerStyle}">
   <Setter Property="Background" Value="{Binding OriginalEvent.Background}"/>
   <Setter Property="MinHeight" Value="{Binding OriginalEvent.Height}"/>
   <Setter Property="Height" Value="{Binding OriginalEvent.Height}"/>
</Style>

But for DragResizeSlotHighlightContainer it doesn't work getting OriginalEvent.Height to set MinHeight...

<Style TargetType="telerik:DragResizeSlotHighlightContainer"
   BasedOn="{StaticResource  DragResizeSlotHighlightContainerStyle}">
   <Setter Property="MinHeight" Value="{Binding OriginalEvent.Height}"/>
</Style>

 

Polya
Telerik team
 answered on 24 Nov 2015
1 answer
55 views

Hi,

I add some ribbon tabs to my project and give them access text.

the key tool tips aren't in right place.

note :

my radribbonview has right to left flow direction.

i attach a picture and a project to show my problem.

thanks.

Kiril Vandov
Telerik team
 answered on 24 Nov 2015
1 answer
177 views

Hello! 

I have a question about the RadContextMenu. I created my class DataGridView so this class inherited from RadGridView. If I add contextMenu with    RadContextMenu.SetContextMenu(this, contextMenu) can't add new contextMenu. Look this:

public class DataGridView : RadGridView
{

   public DataGridView()
   {

          // create menu
            var contextMenu = new RadContextMenu();
            RadMenuItem item = new RadMenuItem();
            item.Header = "Hello";
            contextMenu.Items.Add(item);
            contextMenu.Opened += ContextMenu_Opened;
            //add something that we can use to get the data grid on context menu events
            contextMenu.ItemClick += ContextMenu_ItemClick;
            contextMenu.Opening += ContextMenu_Opening;
            // set menu Theme
            StyleManager.SetTheme(contextMenu, StyleManager.GetTheme(this));
            RadContextMenu.SetContextMenu(this, contextMenu);

   }
           

}

Nasko
Telerik team
 answered on 24 Nov 2015
3 answers
513 views
How to Save all rows from radgridview (wpf) to Sql database?
Dilyan Traykov
Telerik team
 answered on 24 Nov 2015
7 answers
348 views
Hello,

I want to avoid the overlap appointment for manage availability resources.
Is there a way to do that or i need to use custom  apointment/ availability ?

Gat

Roy
Top achievements
Rank 1
 answered on 24 Nov 2015
1 answer
470 views

Hi,

I'm trying to save RadGridView columns order by using Persistance manager:

                PersistenceManager manager = new PersistenceManager();
                manager.AllowCrossVersion = true;
                stream = manager.Save(radGridView);

 

And

Reading back:

                PersistenceManager manager = new PersistenceManager();
                stream.Position = 0L;
                manager.Load(radGridView, stream);

I change order using drag and drop  and then saving the radgridview.

Sometimes order is right, but many times order is something else that I save.

What is the problem? I sent your simple project that you can verified the problem.

 

Save button is saving grid on the stream.

Format button is return grid in original order.

Get button is loadin order in the stream.

 Here is to prosess:

1. Start to program.

2. Change column order

3. Press Save button.

4. Load original order.

5. Press Get Button.

Some times order is correct and some times is not.


 

 

Here is the c# colde:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Telerik.Windows.Controls;
using System.Collections.ObjectModel;
using Telerik.Windows.Controls.GridView;
using System.Data;
using System.Collections;
using Microsoft.Win32;
using Telerik.Windows.Documents.FormatProviders.Pdf;
using System.IO;
using System.Xml.Serialization;
using System.Globalization;
using Telerik.Windows.Persistence;
using Telerik.Windows.Zip;
using Telerik.Windows.Persistence.Services;
using Telerik.Windows.DragDrop;
using Telerik.Windows.DragDrop.Behaviors;
using System.IO.IsolatedStorage;

namespace GRID_TESTI
{
    /// <summary>
    /// Interaction logic for Page1.xaml
    /// </summary>
    public partial class Page1 : Page
    {
        AlarmDataCls ac = new AlarmDataCls();
        public Page1()
        {
            InitializeComponent();
            ServiceProvider.RegisterPersistenceProvider<ICustomPropertyProvider>(typeof(RadGridView), new GridViewCustomPropertyProvider());
            LoadColumns();
        }
        private Stream stream = null;
        public void LoadColumns()
        {

            AlarmDataCls ac = new AlarmDataCls();
            IList data = new ObservableCollection<AlarmDataCls>();

            radGridView.ItemsSource = null;
            radGridView.ItemsSource = data;


        }



        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            radGridView.Rebind();
            SaveToStream();

        }

        private void btnBring_Click(object sender, RoutedEventArgs e)
        {

            OpenFromStream();
        }

        private void SaveToStream()
        {
            try
            {
                PersistenceManager manager = new PersistenceManager();
                manager.AllowCrossVersion = true;
                stream = manager.Save(radGridView);
            }
            catch (Exception ex)
            {
            }
        }

        private void OpenFromStream()
        {
            try
            {
                PersistenceManager manager = new PersistenceManager();
                stream.Position = 0L;
                manager.Load(radGridView, stream);

            }
            catch (Exception ex)
            {

            }

        }
        private void btnAlusta_Click(object sender, RoutedEventArgs e)
        {
            LoadColumns();
        }

        public class AlarmDataCls
        {

            public AlarmDataCls()
            {

            }
            public string Eka
            {
                get;
                set;
            }
            public int Toka
            {
                get;
                set;
            }
            public int Kolmas
            {
                get;
                set;
            }
            public int Neljas
            {
                get;
                set;
            }
            public int Viides
            {
                get;
                set;
            }
            public int Kuudes
            {
                get;
                set;
            }
            public int Seiska
            {
                get;
                set;
            }
            public int Kasi
            {
                get;
                set;
            }
            public int Ysi
            {
                get;
                set;
            }
            public int Kymppi
            {
                get;
                set;
            }

            public int Yksitoista
            {
                get;
                set;
            }
            public int Kaksitoista
            {
                get;
                set;
            }
            public int Kolmetoista
            {
                get;
                set;
            }
            public int Neljatoista
            {
                get;
                set;
            }
        }


    }
}
    

And here is the Xaml:

 

<Page
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="GRID_TESTI.Page1"
      mc:Ignorable="d"
      d:DesignHeight="300" d:DesignWidth="1300"
      Title="Page1">
    <Grid>
        <telerik:RadGridView  telerik:PersistenceManager.StorageId="radGridView"  
                        AutoGenerateColumns="true"                       
                        Margin="0,40,0,0"
                        Name="radGridView"
                        AllowDrop="True"
                        GroupRenderMode="Flat" Height="500">
        </telerik:RadGridView>
        <Button x:Name="btnSave" Content="Save" HorizontalAlignment="Left" Height="30" Margin="78,10,0,0" VerticalAlignment="Top" Width="120" Click="btnSave_Click"/>
        <Button x:Name="btnBring" Content="Get" HorizontalAlignment="Left" Height="30" Margin="220,10,0,0" VerticalAlignment="Top" Width="120" Click="btnBring_Click"/>
        <Button x:Name="btnAlusta" Content="Format" HorizontalAlignment="Left" Height="25" Margin="555,10,0,0" VerticalAlignment="Top" Width="100" Click="btnAlusta_Click"/>
    </Grid>


</Page>

 

 

Best Regards

Auvo K

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 24 Nov 2015
6 answers
197 views

I use group to show group data,  the group and item both can connec to other control , the design picture is as attach files "split.png"

there are two question

1. I set the template as follows

 <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="telerik:RadDiagramContainerShape">
                        <Border x:Name="ContainerBorder"
                                Width="30"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="15" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style> 

and set the item circle position as follows

 public override bool AddItem(object item)
        {
            var viewModel = item as TransformationNode;
            if (viewModel != null)
            {
                viewModel.Position = new Point(this.Position.X, this.InternalItems.Count * splitTransformationHeight);
                return base.AddItem(item);
            }

            return false;
        }

but the group show as attach files "SplitDiagramGroup.png"   the height is too big,what is the reason

2. I wish the  item circle can not drag alone, when drag the item circle,  the whole  group move too ,   how to realize?

 

than you 

rui
Top achievements
Rank 1
 answered on 24 Nov 2015
1 answer
34 views
Hi  please go through attached file .
Stefan
Telerik team
 answered on 24 Nov 2015
1 answer
80 views
Hi I have two  columns available in radgridview  Name and ID . Name column contain same value  but each  name associated with id i want  group by  on name on UI but  programmatically  it should group by using  ID . For example
Name      ID
N1          5
N1         7
N1         3
N1          2
When  use group by  on  Name result  should be
N1      2
N1      3
N1      5
N1      7
how to achieve it  please provide some hint 
Stefan
Telerik team
 answered on 24 Nov 2015
1 answer
356 views

Dear Team,

If the doc is open for the first time, a new doc window will open and if the same doc is open again, the existing window should be set active. Currently keep opening new windows instead show already opened window. How can i achieve this. please advise.

var openwindow = new PDFViewerWindow();
                                  openwindow.Show();
                                  openwindow.pdfViewer.DocumentSource =
                                      new PdfDocumentSource(new Uri(uri, UriKind.RelativeOrAbsolute));

Thank you.

Regards,

Prabakaran

Tanya
Telerik team
 answered on 24 Nov 2015
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?