Telerik Forums
UI for WPF Forum
3 answers
199 views
How do you print the Schedule view?
I don't want to print the actual screen ( using PrintVisual), but print the entire view?
Rosi
Telerik team
 answered on 13 Dec 2010
1 answer
82 views
Hi

We are creating an Lineseries chart with datapoints which has around 70000+ records .It is taking more than 30 minutes to load the chart .we have disable the animations to false(ChartArea.EnableAnimations = false) and also SamplingSettings.SamplingThreshold = 0. so please help us.The code we are using are as below

 

 

private void BuildDiskIoDetailsGraph(ObservableCollection<DiskIoDetails> raw, Telerik.Windows.Controls.RadChart ctrlChart, string title, bool isPrefetch)

 

{

 

 

if (raw.Count > 0)

 

{

 

 

DataSeries chartSeries = new DataSeries();

 

chartSeries.Definition =

 

new LineSeriesDefinition() { ShowItemLabels = false, ShowItemToolTips = true };

 

ctrlChart.SamplingSettings.SamplingThreshold = 0;

ctrlChart.DefaultView.ChartArea.EnableAnimations =

 

false;

 

ctrlChart.DefaultView.ChartLegend.Visibility =

 

Visibility.Collapsed;

 

ctrlChart.DefaultView.ChartLegend.UseAutoGeneratedItems =

 

true;

 

ctrlChart.DefaultView.ChartArea.AxisX.Step = 20f;

ctrlChart.DefaultView.ChartArea.AxisX.AutoRange =

 

true;

 

ctrlChart.DefaultView.ChartArea.AxisX.Title =

 

"Time";

 

 

 

 

List<object> processList = raw.Select(d => d.GetType().InvokeMember("ProcessNamePID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, d, null)).Distinct().ToList();

 

 

 

foreach (object process in processList)

 

{

 

 

Color color = GetNextColor();

 

 

 

if (process.ToString().ToLower().StartsWith("system")) color = Colors.Blue;

 

 

 

if (process.ToString().ToLower().StartsWith("winlogon")) color = Colors.Maroon;

 

 

 

if (process.ToString().ToLower().StartsWith("idle")) color = Colors.Green;

 

 

chartSeries.Definition.Appearance.Foreground =

 

new SolidColorBrush(color);

 

chartSeries.Definition.Appearance.Fill =

 

new SolidColorBrush(color);

 

chartSeries.Definition.Appearance.PointMark.Fill =

 

new SolidColorBrush(color);

 

chartSeries.Definition.Appearance.Stroke =

 

new SolidColorBrush(Colors.LightGray);

 

 

chartSeries.Definition.Appearance.PointMark.Stroke =

 

new SolidColorBrush(color);

 

 

 

List<DiskIoDetails> dataList = raw.Where(d => d.GetType().InvokeMember("ProcessNamePID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, d, null).ToString().Equals(process.ToString())).ToList();

 

 

 

foreach (object item in dataList)

 

{

 

 

string startTime = item.GetType().InvokeMember("StartTime", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, item, null).ToString();

 

 

 

string offset = item.GetType().InvokeMember("ByteOffset", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, item, null).ToString().TrimStart("0x".ToCharArray());

 

 

 

string ioType = item.GetType().InvokeMember("IOType", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, item, null).ToString();

 

 

 

string endTime = item.GetType().InvokeMember("EndTime", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, item, null).ToString();

 

 

 

string processName = item.GetType().InvokeMember("ProcessNamePID", BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetProperty, null, item, null).ToString();

 

 

 

if (ioType.ToLower().Contains("read")) ioType = "Read";

 

 

 

else ioType = "Write";

 

 

 

if (string.IsNullOrEmpty(offset)) offset = "0";

 

 

 

if (chartSeries != null)

 

{

 

 

double initTime = Convert.ToDouble(startTime) / _nsPerSec;

 

 

 

double complete = Convert.ToDouble(endTime) / _nsPerSec;

 

 

 

 

DataPoint dp = new DataPoint( (Convert.ToDouble(startTime) / _nsPerSec),long.Parse(offset, System.Globalization.NumberStyles.HexNumber));

 

dp.Tooltip =

 

string.Format("{0}{1}InitTime: {2}{1}Complete Time: {3}{1}{4}", ioType, Environment.NewLine, initTime, complete, processName);

 

 

chartSeries.Add(dp);

 

 

//m_Line.Interactivity.Tooltips.Add(string.Format("{0}{1}InitTime: {2}{1}Complete Time: {3}{1}{4}", ioType, Environment.NewLine, initTime, complete, processName));

 

 

 

 

 

 

}

}

}

ctrlChart.DefaultView.ChartArea.DataSeries.Add(chartSeries);

 

 

}

}

 

 

Yavor
Telerik team
 answered on 13 Dec 2010
8 answers
281 views
Hello, I am using LINQ to SQL class in order to retrieve and write data in my SQL. I have a table called Student and Subjects. Student is my parent table and Subjects is my child table. I successfully displays per student his/her subjects with Hierarchical Data Grid. I can add, delete, update, read data in my Subjects using the Property CanUserInsertRows and ShowInsertRow as true. Now my problem is that when I want to add new item in my Student table I cannot click my add new item or it is not clickable. Any help please?
Here's my xaml file
<Window x:Class="HierarchiyGridSuccess.MainWindow"
        xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <telerik:RadGridView Grid.Row="0" x:Name="rgvData" ShowInsertRow="True" AutoGenerateColumns="False" telerik:Theming.Theme="Windows7" ItemsSource="{Binding}" >
            <telerik:RadGridView.ChildTableDefinitions>
                <telerik:GridViewTableDefinition />
            </telerik:RadGridView.ChildTableDefinitions>
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StudentID}" Header="Student ID" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StudentFN}" Header="Student First Name" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding StudentLN}" Header="Student Last Name" />
            </telerik:RadGridView.Columns>
            <telerik:RadGridView.HierarchyChildTemplate>
                <DataTemplate>
                    <telerik:RadGridView x:Name="RadGridView1" Loaded="rgvData_Loaded" AutoGenerateColumns="False" ShowInsertRow="False"  CanUserInsertRows="False"  ItemsSource="{Binding Subjects}" ShowGroupPanel="False" IsReadOnly="False">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding SubjectName}" Header="Subject Name" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding SubjectProf}" Header="Professor" />
                        </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </DataTemplate>
            </telerik:RadGridView.HierarchyChildTemplate>
        </telerik:RadGridView>
        <Button Content="Save!" Width="Auto" Height="Auto" Grid.Row="1" Click="Button_Click" />  
    </Grid>
</Window>

And my class file 

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 System.Collections.Specialized;
using Telerik.Windows.Controls;
using Telerik.Windows.Controls.GridView;
 
namespace HierarchiyGridSuccess
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        DataAccessDataContext m_dcData;
        public MainWindow()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
 
            this.rgvData.Items.CollectionChanged += new NotifyCollectionChangedEventHandler(Items_CollectionChanged);
            rgvData.Filtered += new EventHandler<Telerik.Windows.Controls.GridView.GridViewFilteredEventArgs>(rgvData_Filtered);
        }
 
        void rgvData_Loaded(object sender, RoutedEventArgs e)
        {
            var childGrid = (RadGridView)sender;
        var parentRow = childGrid.ParentRow;   
 
        if (parentRow != null)
        {
            rgvData.SelectedItem = childGrid.DataContext;
            parentRow.IsExpandedChanged += new RoutedEventHandler(parentRow_IsExpandedChanged);
        }
         }
 
    void parentRow_IsExpandedChanged(object sender, RoutedEventArgs e)
    {
        rgvData.SelectedItem = ((GridViewRow)sender).DataContext;
    }
         
 
        void rgvData_Filtered(object sender, Telerik.Windows.Controls.GridView.GridViewFilteredEventArgs e)
        {
            rgvData.ItemsSource = m_dcData.Students;
        }
 
        private void Items_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            try
            {
                if (e.Action == NotifyCollectionChangedAction.Add)
                {
                    foreach (Student item in e.NewItems)
                    {
                        this.m_dcData.Students.InsertAllOnSubmit(e.NewItems.OfType<Student>());
                    }
                }
                if (e.Action == NotifyCollectionChangedAction.Remove)
                {
                    this.m_dcData.Students.DeleteAllOnSubmit(e.OldItems.OfType<Student>());
                }
            }
            catch (Exception s)
            { }
        }
        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            m_dcData = new DataAccessDataContext();
            m_dcData.Log = Console.Out;
            DataContext = m_dcData.Students;
            rgvData.ShowInsertRow = true;
        }
 
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var changes = this.m_dcData.GetChangeSet();
            rgvData.BeginInsert();
            MessageBox.Show(string.Format("There are {0} inserts and {1} deletes pending.", changes.Inserts.Count, changes.Deletes.Count));
            m_dcData.SubmitChanges();
        }
    }
}

How come I cannot click the add new item of my parent table?
Leo
Top achievements
Rank 2
 answered on 11 Dec 2010
1 answer
129 views
I have set IsItemsAnimationEnabled to false.
As expected, this does prevent animation when I drag and swap one item with another.

I am changing MinimizedItemsPosition when the user clicks a button.  The minimized items move to the newly specified position, but the movement is animated.
Is this the desired behavior?

My controls do not animate well, so I am trying to avoid these animations.
Buzz
Zarko
Telerik team
 answered on 11 Dec 2010
1 answer
119 views
Hi,

I just want to mention that you should review the filter dropdown template.
Because when I want to hide Distinct Filters I also loose the close button with it.
I know this is because "ShowDistinctFilters" hides the "top part" of the dropdown.

But if I want (which I do often) hide distinct filters I loos this (important) button.
Of course I could generate my own template - but this should be "in the box".

Manfred
Vanya Pavlova
Telerik team
 answered on 11 Dec 2010
10 answers
282 views
sorry the table structure is not good.so i create one more thread.
Hi telerik team,
                       I am sivakanth. we are using ur telerik rad controls in our latest WPF project.
I want to create following table structure inside rad gridview.

Enter Name

Text Box

Department

Combo box

Gender

Radio button

Save

Button



 Is it possible to create inside radgrid view ?

if possible mean give me some coding guidlines.

if not posible mean than which control i used  to create these  structure.

thank you.


sivakanth
Top achievements
Rank 1
 answered on 11 Dec 2010
5 answers
167 views
Is there an example of manually starting a drag via StartDrag?

Here is what I am attempting to do:
Drag files (ie from Windows Explorer, Desktop, etc) to a Telerik control (in this instance a RadTreeListView).

What I already have working:
Dragging within the RadTreeListView is fully implemented

What I have tried:
Register the DragOver event on the RadTreeListView with this code:

if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
   if (!RadDragAndDropManager.IsDragging)
        {
            Collection<object> pPayload = new Collection<object>();
            if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
            {
                foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                {
                    if (File.Exists(pFilePath))
                    {
                        pPayload.Add(pFilePath);
                    }
                }
            }
            if (pPayload.Count > 0)
            {
                RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
            }
        }

The problem is it never starts the drag!  Is there something I am missing?  I would have thought this would have kick-started the Rad Drag and Drop features, but it doesn't seem to do anything.


Travis
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            }
if (!RadDragAndDropManager.IsDragging)
            {
                Collection<object> pPayload = new Collection<object>();
                if (e.Data is System.Windows.DataObject && ((System.Windows.DataObject)e.Data).ContainsFileDropList())
                {
                    foreach (string pFilePath in ((System.Windows.DataObject)e.Data).GetFileDropList())
                    {
                        if (File.Exists(pFilePath))
                        {
                            ITrack pTrack = new MediaTrack();
                            pTrack.IsMasterTrack = true;
                            pTrack.Name = Path.GetFileNameWithoutExtension(pFilePath);
                            pTrack.FileName = pFilePath;
                            pPayload.Add(pTrack);
                        }
                    }
                }
                if (pPayload.Count > 0)
                {
                    RadDragAndDropManager.StartDrag(TrackListTreeListView, pPayload, null);
                }
            
Tsvyatko
Telerik team
 answered on 11 Dec 2010
1 answer
147 views
Hi
I am using Windows XP.I want to change the blue color around my customized window used as a message box.I want that blue color to be replaced by some glassy color as it is in vista or windows 7.please help me out in changing that blue color around it  as soon as possible.
George
Telerik team
 answered on 11 Dec 2010
3 answers
95 views
In Windows7Theme this componnets alongside look bad.
http://img819.imageshack.us/img819/4333/themewin7.jpg


In other themes same screen looks good.
Dani
Telerik team
 answered on 11 Dec 2010
3 answers
580 views
Hello,

I´m translating the strings in the DatePicker to a not supported language, and I want to know what the name om the property is that sets the "Enter date" tooltip string?

Best regards,
Anna
Kaloyan
Telerik team
 answered on 11 Dec 2010
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Rating
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?