Hello - I run a simple system that looks at Sales orders, then with their associated country, changes the colour of that country on a map - pretty simple stuff.
Having that list of countries (shapes), is there a way to zoom so that they act as the zoom limits ie if only UK orders, only UK would be shown via zoom, or if UK and Australia, the map would center somewhere between the two, and zoom accordingly
Many thanks
| //add new lookup column |
| GridViewLookUpColumn lookUpColumn = new GridViewLookUpColumn(); |
| lookUpColumn.HeaderText = "Look up"; |
| lookUpColumn.FieldName = "PersonID"; |
| lookUpColumn.DataSource = this.employeesBindingSource; |
| lookUpColumn.ValueMember = "EmployeeID"; |
| lookUpColumn.DisplayMember = "LastName"; |
| public class Commodity() |
| { |
| public int Id {get;set;} |
| public string Description {get;set;} |
| public override ToString() |
| { |
| return Description; |
| } |
| } |
| public class Price |
| { |
| public int Id {get;set;} |
| public DateTime Date {get;set;} |
| public int CommodityId {get;set;} |
| public EntityRef<Commodity> Commodities {get; set;} |
| } |
| public class AppPresenter |
| { |
| public ObservableList<Price> PriceList {get;} |
| } |
| public class Shell |
| { |
| pubic Shell() |
| private IList<Commodity> _commodityList; |
| { |
| InitializeComponents(); |
| _commodityList = repository.GetCommodites(); |
| colCommodityEditorSettings = new ComboBoxEditorSettings { ItemsSource = _commodityList}; |
| colCommodity.EditorSettings = colCommodityEditorSettings; |
| } |
| } |
| <telerik:RadGridView Grid.ColumnSpan="4" Grid.Row="3" Margin="5" x:Name="radGridView1" ColumnsWidthMode="Auto" ItemsSource="{Binding Path = PriceList}" |
| AutoGenerateColumns="False"> |
| <telerik:RadGridView.Columns> |
| <telerik:GridViewDataColumn DataType="{x:Null}" HeaderText="ID" UniqueName="Id" x:Name="colId" /> |
| <telerik:GridViewDataColumn DataType="{x:Null}" HeaderText="Date" UniqueName="Date" IsAutoGenerated="False" IsVisible="True" x:Name="colDate" /> |
| <telerik:GridViewDataColumn DataType="{x:Null}" HeaderText="Hidden" UniqueName="IsHidden" x:Name="colIsHidden" /> |
| <telerik:GridViewDataColumn DataType="{x:Null}" HeaderText="Commodity" UniqueName="CommodityId" x:Name="colCommodity" DataMemberPath="Commodities.Description"> |
| </telerik:RadGridView> |
I would replace the text %Doctors% at the runtime by a table. The following code does not work.
private void ReplaceAllMatches(string Parameter, Telerik.Windows.Documents.Model.Table NewTable)
{
this.myViewer.Document.Selection.Clear(); // this clears the selection before processing
DocumentTextSearch search = new DocumentTextSearch(this.myViewer.Document);
List<Telerik.Windows.Documents.TextSearch.TextRange> rangesTrackingDocumentChanges = new List<Telerik.Windows.Documents.TextSearch.TextRange>();
foreach (var textRange in search.FindAll(Parameter))
{
Telerik.Windows.Documents.TextSearch.TextRange newRange = new Telerik.Windows.Documents.TextSearch.TextRange(new DocumentPosition(textRange.StartPosition, true), new DocumentPosition(textRange.EndPosition, true));
rangesTrackingDocumentChanges.Add(newRange);
}
foreach (var textRange in rangesTrackingDocumentChanges)
{
this.myViewer.Document.Selection.AddSelectionStart(textRange.StartPosition);
this.myViewer.Document.Selection.AddSelectionEnd(textRange.EndPosition);
this.myViewer.InsertTable(NewTable,true);
textRange.StartPosition.Dispose();
textRange.EndPosition.Dispose();
}
}
Is there some way to refresh the colorizer? I've tried setting a MinValue and MaxValue and binding the colorizer's Min and Max values to them but that doesn't work either.
For example, using the sample from WPF SDK for InformationLayerColorizerModeCount (world.shp/world.dbf) , I change the value of the "SQKM" property in the InformationLayerColorizerModeCount event by dividing it by 10. When the map shows, all countries are pretty much the same color. If I divide it by 5, there is more variation in color, but not as much. If I multiply it by 10, than all countries are dark with little or no variation.
Debugging shows me that ColorMeasureScale_PrepareCompleted fires before the PreviewReadShapesCompleted event and apparently sets it range of values from the original DBF values.
I tried to read the shape files in manually ( http://docs.telerik.com/devtools/wpf/controls/radmap/features/information-layer/shapefiles-support) ) , modify the stream, and pass that into the ShapeReader, but the "shapes" do not contain an ExtendedPropertySet so I can't manipulate the values.
StreamResourceInfo shapeResourceInfo = Application.GetResourceStream(new Uri("/InformationLayerColorizerModeCount;component/Resources/world.shp", UriKind.RelativeOrAbsolute));StreamResourceInfo dbfResourceInfo = Application.GetResourceStream(new Uri("/InformationLayerColorizerModeCount;component/Resources/world.dbf", UriKind.RelativeOrAbsolute));Telerik.Windows.Controls.Map.ExtendedPropertySet extData = new ExtendedPropertySet();List<FrameworkElement> shapes = new List<FrameworkElement>();var x = ShapeFileReader.Read(shapeResourceInfo.Stream, dbfResourceInfo.Stream);foreach (var shape in shapes){ this.informationLayer.Items.Add(shape);}​
In the foreach loop, I want to grab a value from my model for the specific country, and then either change the value of an existing ExtendedData or create a new one, but the "shape" instance does not have any property that allows me to do this despite the fact that I included the DBF file in the Read method.
Maybe I should use a different technique altogether ? It seems that this requirement would be quite common, i.e. user picks a variable, program colorizes the map according to that variable. What am I missing ?
Thanks
​
​
​
I already have created some Shapefiles (*.shp) using OpenJump 1.7.1. which are working fine when used as local resource for a MapShapeReader
in an InformationLayer.
But i want the shapefiles to be stored in my database as byte[].
Even loading of the files works perfectly in my viewmodel (via service call).
So now to my problem and actual questions (keep in mind that I am using MVVM):
-) Is it possible to load many (about 20-30) shapefiles from database and bind them to the same radmap control in my view and if so, HOW?
-) Which datatypes do i have to use?
-) Is saving *.shp files to the database the best solution?
-) Would it be better to use *.kml or *.wkt files?
Regards,
Thomas
I am trying to set the selected Item of a TreeListView by code (two way binding), but I see the selected item is set back to null by telerik on few cases.
Have a complex hierarchy tree structure, their child parent level goes down to 10 level at-least. I am trying to set the selected item by code when some one picks the respective item from some where else. And I see, the selected item is set to null by telerik code when an at-least two ancestors nodes are collapsed, but works only one ancestor node is collapsed or when the ancestor nodes are expanded. Not sure about this behavior, could you explain this behavior ? and is there any work around ?
Anand​
Hi,
We are using Rad Map in one of our application where we have used Visualization Layer to show labels on the map.
As per our requirement we need to show current position of active device on map. To make it functional we are using timer to get updated position of the device at regular interval and then we are binding the data with Map using Visualization Source class. But each time when we are binding the data labels on the map are blinking.
Hi,
When I add a new item to the bound collection in my view model the radgridview scrolls to the top on its own.
How to prevent this from happening ? I saw a similar thread with no solution : http://www.telerik.com/forums/disable-scroll-on-changing-collection
Hi,
I need my scatter graph to have equal x and y spacings so the grid lines will appear square. I've attached images of the default spacing I currently have and the square spacing I need.
Thanks for any help,

As the title suggests, I'm trying to work with the max value of the gauge with my data and I'm having little luck. I am fairly new to telerik/wpf, so maybe that's also part of the issue, but what I'm wanting to do is stop the needle at the maximum value (my gauge goes from 0-200, if it's over that value, it just continues along the gauge until it goes past 0 again and the data is skewed).
I've seen an example somewhere of a gauge that when the maximum is exceeded, it stops there and kind of bounces back and forth, as if to indicate it's trying to reach past that point but can't. Is there a way to do this that I'm unaware of?