Telerik Forums
UI for WPF Forum
1 answer
97 views

My app was developed back in 2013 and I want to implement this behavior now. This behavior was introduced in 2014

http://docs.telerik.com/devtools/wpf/controls/radautocompletebox/features/filteringbehavior.html

I don't want to update Telerik becuase it will mess some other stuff.

 Can I implement this ?

 

Nasko
Telerik team
 answered on 16 Apr 2015
2 answers
113 views

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

Luke
Top achievements
Rank 1
 answered on 16 Apr 2015
7 answers
682 views
Is there a way to bind to lookup values in a gridview?

What I'm trying to achieve is nothing more complex than in Windows Forms ValueMember and DisplayMember:
This code is from the RadControls for WinForms example:Column Types
          
  //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"

Given the classes below where the GridView binds to PriceList which is a collection of Price(s), I want the CommodityId column to be a combo box which, when in edit mode gives me a list of Commodity entities showing the Description text and when in view  mode shows me the Description text, but saves the Commodity.Id value back to AppPresenter.PriceList.

By including DataMemberPath in the CommodityId field of the DataView, I am able to display Commodity.Description. However, the selected value from the combo is not reflected in the underlying datasource (PriceList).
If I remove DataMemberPath from the markup - it is clear to see that the PriceList is never updated with the newly selected value.

I'm guessing that the reason for this is that I am not binding Commodity.Id (in the lookup) to CommodityId in the GridView. So my question is - how do I do this binding? The example for DataBinding doesn't seem to cover this case.


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 {getset;} 
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>                 
 
 

Many thanks in advance for your help
Jeremy Holt

Dimitrina
Telerik team
 answered on 16 Apr 2015
2 answers
141 views

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();
}
}

 

Harald
Top achievements
Rank 2
 answered on 15 Apr 2015
1 answer
108 views

A simple problem .. I need to insert an ExtendedData  property dynamically during runtime based on a user selection.  (Or, I could hack it and change the value of an existing extended property - I don't really care at this point).    I tried added the new property in the PreviewReadShapesCompleted event, but the colorizer doesn't recognize it.  Even if I change an existing ExtendedData property's value, the colorizer does not reset it's range. 

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

​

​

​

Pavel R. Pavlov
Telerik team
 answered on 15 Apr 2015
12 answers
313 views
Hello,

My scenario is similar to the Hotel Floorplan given in your online demos. 

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

Petar Mladenov
Telerik team
 answered on 15 Apr 2015
1 answer
226 views

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​

Dimitrina
Telerik team
 answered on 15 Apr 2015
1 answer
193 views

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. 

 

 

 

Petar Mladenov
Telerik team
 answered on 15 Apr 2015
3 answers
471 views

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

Dimitrina
Telerik team
 answered on 15 Apr 2015
5 answers
149 views

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,

Milena
Telerik team
 answered on 15 Apr 2015
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
DataPager
PersistenceFramework
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
LayoutControl
ProgressBar
Sparkline
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
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?