Telerik Forums
UI for WPF Forum
2 answers
200 views
Hi, i need to print the RadMap on a Paper with format A0 (big dimension), it's possibile ?
Actually for print the map use the code on the post:http://www.telerik.com/community/forums/wpf/map/print-copy.aspx
it's work but the dimension of the map is the dimension on the screen resolution.

Thanks
Aurelio
Aurelio Righetti
Top achievements
Rank 1
 answered on 08 Aug 2012
2 answers
231 views
Hello, I am new with Telerik controls, but it's making my applications looks much better.
But I have a problem, My application has a RadTabControl with 4 RadTabItem, and the RadTabItems contains a grid with a RadGridView with an ItemsSource, this is the one that is wrong:

<telerik:RadTabItem Name="StatusTab" Header="Status Summary" IsSelected="True" MouseUp="StatusTab_MouseUp">
                <Grid>
                    <telerik:RadGridView Margin="47.773,61.105,0,0" Name="gridStatus" AutoGenerateColumns="False" ColumnWidth="Auto" telerik:StyleManager.Theme="Vista" CanUserDeleteRows="False" CanUserInsertRows="False" ActionOnLostFocus="None" Height="Auto" VerticalAlignment="Top" Width="Auto" HorizontalAlignment="Left">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Key}" Width="auto"/>
                            <telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Value.Description}"  Width="auto" />
                            <telerik:GridViewDataColumn Header="State" DataMemberBinding="{Binding Value.State}"  Width="auto"/>
                         </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </Grid>
            </telerik:RadTabItem>

I have ser my RadGridView "gridStatus" Height, Width and ColumnWidth to Auto, but in runtime I get an extra column and the content does not fit the width of the RadGridView ( I attach a screen print)

I have tried to set Height and Width in Page1.xaml.cs but I can“t set it to Auto, because the value has to be a double.

But the weirdest thing is that I have another RadGridView that works fine, I copied the code from this to the other, and removed a column that I didn't need, and it was the same, the properties are set to Auto, but I have an "extra column".

Hope you can help me because I have no idea of what to to.
Thanks!
Rocio
Top achievements
Rank 1
 answered on 08 Aug 2012
5 answers
94 views
Hi,

I am trying to add a new row to RadGridView. I can add new row, BUT It doesn't allow me to enter more than 4letters in the new row. Could you check this and let me know what went wrong?

Attached screenshot.

Thank you,
-Prathibha
Pavel Pavlov
Telerik team
 answered on 08 Aug 2012
0 answers
72 views
Hi,
In application we are using the Grid where one of the column has "DateTime" data type.
I am using RadDataFilter to filter the column values, for this particular column when data filter comes up it comes with the DateTimePicker.
Inside this DateTimePicker if user types "Today" it converts the string into Today's DateTime
I want to stop this behavior so that if user types "Today" it will consider it as a string and
should not convert into corresponding DateTime value.
How can i achieve this?
Yogesh
Top achievements
Rank 1
 asked on 08 Aug 2012
3 answers
278 views
Hi all,

I am following the example given in WPF demo -> Controls -> Visualization -> Chart -> Performance -> Live Data, in particular, I am looking at this line of code: 
private void OnTimerTick(object sender, EventArgs e)
{
    this.nowTime = this.nowTime.AddMilliseconds(500);
    this.UpdateData(this.nowTime);
    this.SetUpAxisXRange(this.nowTime);
 
    this.Data = null;
    this.Data = this.cpuData;
}

In my data set, I am updating over 20 line series every second, and resetting the view data with this.Data = null and this.Data = this.cpuData seems to be incredibly slow. Is there a better way to update the chart with live data?

Thanks,
Jin
Rosko
Telerik team
 answered on 08 Aug 2012
3 answers
203 views
Hello,
I tried to use RadColorPicker ContentTemplate property (example in Telerik manuals). But I get exception:
The attachable propert 'ContentTemplate' was not found in type 'RadColorPicker'.


What happened?

version: RadControls for WPF Q1 2012 SP1
Petar Mladenov
Telerik team
 answered on 08 Aug 2012
1 answer
120 views
I'm exporting my radgrid to Excel, that part is working great.  What I'm having trouble with is one of the columns in the gridview is a listbox, so in my export, I want to export the list.  I do have that working correctly, I'm getting all items in the list.  Where I'm stuck is I want each item in the list to be on a different line in the Excel cell, so when it exports and I open Excel I want to see

Item A
Item B
Item C

what I currently get is Item A Item B Item C

Below is my code, is there something obvious I'm missing to accomplish this?

if

 

 

(e.Element == ExportElement.Cell)

 

{

 

 

if (e.Value is SurveyDetail)

 

{

 

 

SurveyDetail surveyDetail = (SurveyDetail)e.Value;

 

 

 

if (e.Context is Telerik.Windows.Controls.GridViewDataColumn)

 

{

Telerik.Windows.Controls.

 

GridViewDataColumn dc = (Telerik.Windows.Controls.GridViewDataColumn)e.Context;

 

 

 

if (dc.Name == "dcCPUJobCode")

 

{

 

 

StringBuilder sb = new StringBuilder();

 

 

 

foreach (CPUJobCode cpuJobCode in surveyDetail.SurveyJobCode.CPUJobCodes)

 

{

sb.Append(

 

string.Format("{0} {1} \n", cpuJobCode.JobCode, cpuJobCode.JobTitle));

 

}

e.Value = sb.ToString();

}

}

}

}

Vlad
Telerik team
 answered on 08 Aug 2012
4 answers
565 views

Hi, I am currently working over the chart control which should fulfill the following requirements:

  • represent live linear charts (like a processor load chart)
  • provide multiple y-axis (to represent charts of boolean, integer and double variables on the same x-axis)
  • provide panning by x-axis ability

I checked if your RadChartView control was able to deal with this task and fell in trouble with several issues. I hope that reasons for such a behavior come from my lack of understanding how charting should be implemented, so we will be able to rely on your control if only we would have those issues fixed. Instead of attaching the whole project, I will try to provide enough information for you in the code snippets.

I need to show from 1 to 10 parameters of different types.

When each parameter is updated i add new value in the corresponding array this way: 


ParameterInfo._log.Add(val, DateTime.Now);


public class ParameterRecord
{
  private object _value;
  private DateTime _date;
}
  
public class ParameterInfo : ViewModelBase
{
  private ObservableCollection<ParameterRecord> _log;
  private string _type;
}

The first problem is

'How can I provide simple x-axis panning capabilities for the live chart?'

I have a timer which updates the chart each 500 milliseconds. It basically fixes the Maximum and Minimum properties of the x-axis:

chart.HorizontalAxis.Minimum = now.Subtract(_horizontalScaleLength);
chart.HorizontalAxis.Maximum = now;

In this way the auto-pan to the last moment works alright but there's no possibility to pan the chart. 

It's obvious that if I want to provide the panning to the very initial moment when the chart was shown, I shall leave 


chart.HorizontalAxis.Minimum == initialDateTime;

I see two possibilities to fix this issue:

  1. Use the external scrollbar and bind it to HorizontalAxis.Minimum and HorizontalAxis.Minimum properties. Activate user-driven panning when the scrollbar changes its value, switch back to auto-panning when, for example, user sets the maximum value on the scrollbar. Unfortunately this won't look good enough if I will use the external scrollbar. Is it possible to customize the behavior of the internal scrollbar to satisfy our needs?
  2. Every time the chart should be updated (500 milliseconds in my case) leave all the parameters unchanged except the zoom scale. Theoretically it's possible to calculate the appropriate zoom value so the absolute size of the visible segment on the x-scale would be constant. However I couldn't find available property via which I could change the zoom scale dynamically from the code behind. Is there any possibility?


The second problem is

'How much points should i add to the data source? How much points is it able to carry?'


At first I tried to add the values every time the timer event is figured (i.e. each 500 milliseconds) However it turned out to be a bad idea. The chart started to go slower and almost stopped with the time. It had about 5000 data points just for 1 minute. I suppose that either there shouldn't be very much points in the data source or I should dynamically filter only the visible segment of a big array. Do you see the latter way convenient enough?

So I turned to the other option, I added new data points to the appropriate series only when their values change. Unsurprisingly, the result looked like a saw (attached file telerik letter - zig-zag trackball.gif)

So I had to add two values when the new value arrives and move the second one further to prolongate the horizontal segment until the next change:

if (oldValue != newValue)
{
  lg.Add(new ParameterRecord(newValue, DateTime.Now)); // the point that will remain
  lg.Add(new ParameterRecord(newValue, DateTime.Now)); // the point that will be prolongated
}
else
{
  lg.RemoveAt(lg.Count - 1);
  lg.Add(new ParameterRecord(oldValue, DateTime.Now));   // prolongate the horizontal line
}

I want you to know if this is a convenient way because it leads to the problem with the TrackBallInfo. Because there are no data points, in between the moments of the value change, the TrackBallInfo snaps to the closest data point instead of displaying the actual value under the mouse pointer. This is not desired (look at the attachment telerik letter - trackball glitch.gif) 

I also have troubles with the dynamical setting of the bunch of y-axes in the code behind, but I didn't try enough by myself yet because it's crucial to know if Telerik's solution is able to deal with just the issues described here.

Thank you,

Andrey

Ryan
Top achievements
Rank 1
 answered on 07 Aug 2012
3 answers
160 views
Hi,

Is there a way to disable the ScheduleView's scrollbars and just move it inside a ScrollViewer?

Thanks,
Mark
Miroslav Nedyalkov
Telerik team
 answered on 07 Aug 2012
8 answers
348 views
Hello, I'm binding the radGridView to an observablecollection of objects which contain 3 properties. So the grid is displayed with 3 columns. 1 of the columns is an observablecollection which I'm trying to bind a GridViewComboBoxColumn to, but the dropdown will only display when I click in the cell and then disappears when I leave. Any help would be greatly appreciated.

Thanks
Scott

<telerik:RadGridView x:Name="radGrid" Margin="5,5,5,5" ItemsSource="{Binding PersonViews}" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" FontSize="14">

<telerik:RadGridView.Columns>

<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" />

<telerik:GridViewDataColumn DataMemberBinding="{Binding Location}" Header="Location"/>

<telerik:GridViewComboBoxColumn ItemsSourceBinding="{Binding Occupation}"

UniqueName="Uniq"

SelectedValueMemberPath="ID"

DisplayMemberPath="Occupation" Header="Occupation"/>

</telerik:RadGridView.Columns>

</telerik:RadGridView>

 

 

using

 

 

System;

 

using

 

 

System.Collections.Generic;

 

using

 

 

System.Linq;

 

using

 

 

System.Text;

 

using

 

 

System.ComponentModel;

 

using

 

 

System.Collections.ObjectModel;

 

namespace

 

 

GridComboBindingTest

 

{

 

 

class GridViewModel : INotifyPropertyChanged

 

{

 

 

private ObservableCollection<PersonView> _personViews;

 

 

 

 

public GridViewModel()

 

{

PersonViews =

 

new ObservableCollection<PersonView>();

 

 

 

PersonView gridView = new PersonView();

 

gridView.Location =

 

"Chicago";

 

gridView.Name =

 

"Fred";

 

 

 

 

PersonOccupation tc = new PersonOccupation();

 

tc.ID = 1;

tc.Occupation =

 

"Programmer";

 

gridView.Occupation =

 

new ObservableCollection<PersonOccupation>();

 

gridView.Occupation.Add(tc);

tc =

 

new PersonOccupation();

 

tc.ID = 2;

tc.Occupation =

 

"Sales";

 

gridView.Occupation.Add(tc);

tc =

 

new PersonOccupation();

 

tc.ID = 3;

tc.Occupation =

 

"Tech";

 

gridView.Occupation.Add(tc);

PersonViews.Add(gridView);

 

 

 

gridView =

 

new PersonView();

 

gridView.Location =

 

"NY";

 

gridView.Name =

 

"Joe";

 

tc =

 

new PersonOccupation();

 

tc.ID = 1;

tc.Occupation =

 

"Cook";

 

gridView.Occupation =

 

new ObservableCollection<PersonOccupation>();

 

gridView.Occupation.Add(tc);

tc =

 

new PersonOccupation();

 

tc.ID = 2;

tc.Occupation =

 

"Chef";

 

gridView.Occupation.Add(tc);

tc =

 

new PersonOccupation();

 

tc.ID = 3;

tc.Occupation =

 

"Tech";

 

gridView.Occupation.Add(tc);

PersonViews.Add(gridView);

怀

怀

怀

gridView =

 

new PersonView();

 

gridView.Location =

 

"LA";

 

gridView.Name =

 

"Sam";

 

tc =

 

new PersonOccupation();

 

tc.ID = 1;

tc.Occupation =

 

"Tech";

 

gridView.Occupation =

 

new ObservableCollection<PersonOccupation>();

 

gridView.Occupation.Add(tc);

tc =

 

new PersonOccupation();

 

tc.ID = 2;

tc.Occupation =

 

"Student";

 

gridView.Occupation.Add(tc);

tc =

 

new PersonOccupation();

 

tc.ID = 3;

tc.Occupation =

 

"Writer";

 

gridView.Occupation.Add(tc);

PersonViews.Add(gridView);

}

怀

 

 

public ObservableCollection<PersonView> PersonViews

 

{

 

 

get { return _personViews; }

 

 

 

set

 

{

 

 

if (_personViews != value)

 

{

_personViews =

 

value;

 

RaisePropertyChanged(

 

"GridViews");

 

}

}

}

 

 

 

public event PropertyChangedEventHandler PropertyChanged;

 

 

 

private void RaisePropertyChanged(string propertyName)

 

{

 

 

// take a copy to prevent thread issues

 

 

 

PropertyChangedEventHandler handler = PropertyChanged;

 

 

 

if (handler != null)

 

{

handler(

 

this, new PropertyChangedEventArgs(propertyName));

 

}

}

}

怀

 

 

public class PersonView : INotifyPropertyChanged

 

{

 

 

private ObservableCollection<PersonOccupation> _occupation;

 

 

 

public string Name

 

{

 

 

get;

 

 

 

set;

 

}

 

 

public string Location

 

{

 

 

get;

 

 

 

set;

 

}

怀

 

 

public ObservableCollection<PersonOccupation> Occupation

 

{

 

 

get { return _occupation; }

 

 

 

set

 

{

 

 

if (_occupation != value)

 

{

_occupation =

 

value;

 

RaisePropertyChanged(

 

"Person");

 

}

}

}

 

 

public event PropertyChangedEventHandler PropertyChanged;

 

 

 

private void RaisePropertyChanged(string propertyName)

 

{

 

 

// take a copy to prevent thread issues

 

 

 

PropertyChangedEventHandler handler = PropertyChanged;

 

 

 

if (handler != null)

 

{

handler(

 

this, new PropertyChangedEventArgs(propertyName));

 

}

}

}

 

 

public class PersonOccupation : INotifyPropertyChanged

 

{

 

 

private string _occupation;

 

 

 

private int _ID;

 

 

 

public string Occupation

 

{

 

 

get { return _occupation; }

 

 

 

set

 

{

 

 

if (_occupation != value)

 

{

_occupation =

 

value;

 

RaisePropertyChanged(

 

"Occupation");

 

}

}

}

 

 

public int ID

 

{

 

 

get { return _ID; }

 

 

 

set

 

{

 

 

if (_ID != value)

 

{

_ID =

 

value;

 

RaisePropertyChanged(

 

"ID");

 

}

}

}

 

 

public event PropertyChangedEventHandler PropertyChanged;

 

 

 

private void RaisePropertyChanged(string propertyName)

 

{

 

 

// take a copy to prevent thread issues

 

 

 

PropertyChangedEventHandler handler = PropertyChanged;

 

 

 

if (handler != null)

 

{

handler(

 

this, new PropertyChangedEventArgs(propertyName));

 

}

}

}

}

Scott Michetti
Top achievements
Rank 1
Iron
 answered on 07 Aug 2012
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?