Telerik Forums
UI for WPF Forum
3 answers
148 views
Is it possible to import a Table from RadSpreadsheet like MS Word form MS Excel?

Until now it seems to me, that I only can import it as Plaintext. So the backgroundcolor, etc. goes lost.

Thanks in advance.
Torsten
Nikolay Demirev
Telerik team
 answered on 25 Nov 2014
8 answers
212 views
Hello, thank you for your last help. I still have a last question to my evaluation related to the gantt control.
Is there a possibility to get the tree-column expanded event in code behind? The goal is to load huge data on demand when
e.g. summary task is expanding on table side. For us this is a very important feature and basically neccessary.
Are there any plans or possibilitys to resolve this issue for our requirements?

Best Regards ... Robert
Kalin
Telerik team
 answered on 25 Nov 2014
1 answer
265 views
I am using telerik:RadGridView along with telerik:RadContextMenu.ContextMenu to generate a right click menu inside my application. I need to be able to grab the servername and session id from the selected row in order to pass to the Disconnect and Logoff functions. However I ma having difficulty grabbing the data I need.

Here is the XAML for the component

<telerik:RadGridView  x:Name="UserSessionGrid" IsReadOnly="True" FontWeight="Bold" AutoGeneratingColumn="UserSessionGrid_AutoGeneratingColumn"  CanUserResizeColumns="False" CanUserDeleteRows="False" CanUserResizeRows="False" ClipboardCopyMode="All" Copied="UserSessionGrid_Copied" >
   <telerik:RadContextMenu.ContextMenu>
     <telerik:RadContextMenu Opened="RadContextMenu_Opened" ItemClick="RadContextMenu_ItemClick">
      <telerik:RadContextMenu.Items>
        <telerik:RadMenuItem Header="Copy" />
        <telerik:RadMenuItem Header="Disconnect" />
        <telerik:RadMenuItem Header="Logoff" />
      </telerik:RadContextMenu.Items>
    </telerik:RadContextMenu>
  </telerik:RadContextMenu.ContextMenu>
</telerik:RadGridView>

Here is the relevant code that handles the Right Click

/// <summary>
/// Handles the ItemClick event of the RadContextMenu control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="Telerik.Windows.RadRoutedEventArgs"/> instance containing the event data.</param>
private void RadContextMenu_ItemClick(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
  RadContextMenu menu = (RadContextMenu)sender;
  RadMenuItem clickedItem = e.OriginalSource as RadMenuItem;
  GridViewRow row = menu.GetClickedElement<GridViewRow>();
  GridViewCell cell = menu.GetClickedElement<GridViewCell>();
  GridViewRowItem rowitem = menu.GetClickedElement<GridViewRowItem>();
  if (clickedItem != null && row != null)
  {
    string header = Convert.ToString(clickedItem.Header);
 
     switch (header)
     {
       case "Copy":
         Clipboard.SetText(cell.Value.ToString());
         break;
       case "Disconnect":
         // Grab Server Name Column and Session ID Column Data
         break;
       case "Logoff":
         // Grab Server Name Column and Session ID Column Data
         break;
       default:
         break;
    }
  }
}
/// <summary>
/// Handles the Opened event of the RadContextMenu control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
private void RadContextMenu_Opened(object sender, RoutedEventArgs e)
{
  RadContextMenu menu = (RadContextMenu)sender;
  GridViewRow row = menu.GetClickedElement<GridViewRow>();
 
  if (row != null)
  {
    row.IsSelected = row.IsCurrent = true;
    GridViewCell cell = menu.GetClickedElement<GridViewCell>();
    if (cell != null)
    {
      cell.IsCurrent = true;
    }
  }
  else
  {
    menu.IsOpen = false;
  }
}

Here is my session class

class Session
{
    public String Server { get; set; }
    public String Domain { get; set; }
    public String User { get; set; }
    public int sID { get; set; }
    public ConnectionState State { get; set; }
    public IPAddress IP { get; set; }
    public String Workstation { get; set; }
    public DateTime? Connect { get; set; }
    public DateTime? Login { get; set; }
    public TimeSpan Idle { get; set; }
    /// <summary>
    /// Initializes a new instance of the <see cref="Session"/> class.
    /// </summary>
    /// <param name="server">The server.</param>
    /// <param name="domain">The domain.</param>
    /// <param name="user">The user.</param>
    /// <param name="session">The session.</param>
    /// <param name="state">The state.</param>
    /// <param name="ip">The ip.</param>
    /// <param name="workstation">The workstation.</param>
    /// <param name="connect">The connect.</param>
    /// <param name="login">The login.</param>
    /// <param name="idle">The idle.</param>
    public Session (string server, string domain, string user, int session, ConnectionState state, IPAddress ip, string workstation, DateTime? connect, DateTime? login, TimeSpan idle)
    {
        this.Server = server.ToUpper();
        this.Domain = domain.ToUpper();
        this.User = user;
        this.sID = session;
        this.State = state;
        this.IP = ip;
        this.Workstation = workstation.ToUpper();
        this.Connect = connect;
        this.Login = login;
        this.Idle = idle;
    }
}

Which is populated by using the following code

/// <summary>
 /// Handles the DoWork event of the worker control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="DoWorkEventArgs"/> instance containing the event data.</param>
 private void worker_DoWork(object sender, DoWorkEventArgs e)
 {
   App.Current.Dispatcher.Invoke((Action)delegate
   {
     UserSessionGrid.IsBusy = true;
   });
   ITerminalServicesManager manager = new TerminalServicesManager();
   foreach (var ServerName in ServerList)
   {
     using (ITerminalServer server = manager.GetRemoteServer(ServerName))
     {
     try
     {
       server.Open();
       foreach (ITerminalServicesSession session in server.GetSessions())
       {
         items.Add(new Session(server.ServerName, session.DomainName, session.UserName, session.SessionId, session.ConnectionState, session.ClientIPAddress, session.WindowStationName, session.ConnectTime,session.LoginTime, session.IdleTime));
         //worker.ReportProgress(session.SessionId);
       }
       server.Close();
 
     }
     catch (Win32Exception) { }
     catch (SystemException) { }
     catch (Exception) { }
     }
   }
 }
Chris
Top achievements
Rank 1
 answered on 25 Nov 2014
1 answer
68 views
We are using the PropertyGrid to edit the contents of an object and it works fine. However we need to be notified when the user finishes editing an individual property. The EndEdit event comes pretty close (once we changed EditMode to single) but we can not figure out which property was actually edited.

Obviously one solution is to have the object we are editing implement INotifyPropertyChanged and handle the property changed event. Unfortunately we don't have access to this object and the property access methods are not virtual so we can't easily extend it.

Is there a way to tell which property was edited in the EndEdit event?

Thanks
Ivan Ivanov
Telerik team
 answered on 24 Nov 2014
4 answers
169 views
I want to change the order of RadPanes in a RadPaneGroup. Obviously others already had the same problem:

http://www.telerik.com/forums/how-to-change-tab-order-in-radpanegroup

In it above post. There is a Link to your PITS given, that does not work. So how is the status, now that the issue occurred four years ago?


(BTW: PITS looks shitty when you visit it wit an Opera Browser)
George
Telerik team
 answered on 24 Nov 2014
3 answers
97 views
I'm using the PdfFormatProvider to export RadDocuments to disk. Adobe Reader prompts me to save changes when these documents are closed. The saved document is slightly smaller than the original.

Is this a known issue?
Tanya
Telerik team
 answered on 24 Nov 2014
2 answers
189 views
I'm using RadDiagram for making a designer in our system.
I have three parts in my screen, (RadDiagram, RadDiagramToolBox and ToolBar).

What I have to display in my RadDiagramToolBox are icons (images for my custom shapes) For a reason, my custom shapes can not inherit from RadDiagramShape, That's Why the RadDiagram didn't accept my custom shapes and I made MyDesigner which is inhering from RadDiagram, and override the this.Drop += MyDesigner_Drop;

To do this I used this hierarchy http://www.telerik.com/forums/raddiagramtoolbox-xaml-example#IUr1zXo3zUq-9NytMbeamw '
as the following:
        <telerik:RadDiagramToolbox Grid.Column="0" Grid.RowSpan="3"
                                   Header="{Binding SelectedItem.Header, RelativeSource={RelativeSource Self}}"
                                   Visibility="{Binding IsChecked, ElementName=toolboxButton, Converter={StaticResource BooleanToVisibilityConverter}}">
            <telerik:RadDiagramToolboxGroup Header=" Charts ">
        
                <telerik:RadDiagramToolboxItem Name="TimeChartIcon" Background="Transparent">
                    <telerik:RadDiagramShape Name="TimeChartIcon1" Background="Transparent" BorderBrush="Transparent">
                        <Image Source="/Fathom.TestDiagram;component/Images/TimeChartIcon.png"                    
                               Stretch="UniformToFill"
                               Name="TimeChartIcon2"/>
                    </telerik:RadDiagramShape>
                </telerik:RadDiagramToolboxItem>

      <telerik:RadDiagramToolboxItem Background="Transparent">
                <telerik:RadDiagramShape Name="ValueChartIcon" Background="Transparent" BorderBrush="Transparent">
                        <Image Source="/Fathom.TestDiagram;component/Images/ValueChartIcon.png"                    
                               Stretch="Fill"/>
                    </telerik:RadDiagramShape>
                </telerik:RadDiagramToolboxItem>
   </telerik:RadDiagramToolboxGroup>
            
            <telerik:RadDiagramToolboxGroup Header=" Others "/>
        </telerik:RadDiagramToolbox>

and in MyDesigner_Drag I used this http://www.telerik.com/forums/raddiagramtoolbox-drag-drop#trdWTLlUNEKga8H6yFFsqQ
and I added these lines of code after Admin Tina's codes:
              
                    droppedShape.Background = Brushes.Transparent;                  <br>                    droppedShape.Position = e.GetPosition(this);<br>                    droppedShape.BorderBrush = Brushes.Transparent;<br>                    droppedShape.BorderThickness = new Thickness(2);<br>                    droppedShape.Padding = new Thickness(0);<br>                    this.Items.Add(droppedShape);


What I got is, I can drag the RadDiagramShape  which contains an image  from RadDiagrmToolBox and dropped it as a RadDiagramShape contains the same image inside a RadDiagramShape. (How I could have the image in the new dropped instance?)
But What I want is, I want to check inside the MyDesigner_Drag event any info leads me to know the custom shape that the user has dragged and dropped to create an instance from it. Like (Name or Content->Image source)
I could see that item.Content is an image but I couldn't access to Name or Image Source and I couldn't see the name or source of the image that I hard-coded in Xaml code in debug mode!!

I really need your help.
Thank You.

Alaa
Top achievements
Rank 1
 answered on 24 Nov 2014
1 answer
46 views
Hello

I want to find  is there any way to access to tesianChartGrid.grid.xLines property information runtime ?

regards
Martin Ivanov
Telerik team
 answered on 24 Nov 2014
1 answer
114 views
Hi,


I am incrementing my candlestick count during a live feed test. The ChartView is bounded to an ObservableCollection<Candlestick> which is constantly being  refreshed when an updated or brand new candlestick each period.

The first image (25_candlesticks) is a snapshot of the Chart View  for the first 25 candlesticks displayed.

The next image (100_candlesticks) shows the Chart View after 100 candlesticks are displayed.

As you can see, the chart does not auto right scroll to show a preselected number of candlesticks in the current view, but instead, crams all the candlesticks into the same viewing area.

I do not want this. What is necessary is that I have this instead:

1) To have my very first candlestick appear on the left of the screen

2) as more candlesticks are added, the screen remains un-scrolled until about 3 quarters down the view screen.

3) at about 3/4 from the edge of the view screen, the chart auto-scrolls as new candlesticks are added, while maintaining the current X and Y axis scaling that I initially chose.

Could you please instruct me on how this can be done?

I would very much appreciate a WPF C# sample on this as a reference.

Thanks for any help.
Peshito
Telerik team
 answered on 24 Nov 2014
1 answer
143 views
Hi,
    I found it was hard to drag scroll bar up/down when grouping data.  I tried to set CanContentScroll = "True" to fix performance issue. but it doesn't work. Could you give us some advice how to fix this issue. My demo has 50 columns and 10000 record. group ID by default pls see my screenshot
 
Dimitrina
Telerik team
 answered on 24 Nov 2014
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?