Telerik Forums
UI for WPF Forum
4 answers
184 views
Hi,

I am trying to build a window, where user can select different material types by selecting from a menu type interface. The top level is material class (Stainless Steel, Aluminum etc.) where one lower level is going to be the type (like, 304, 316... for Stainless Steel and 6061, 7075... for Aluminum). I would like to use breadcrumb control for this interface.

My question is, when I first show the top level in the control, (Stainless Steel and Aluminum), when the user picks either one, can I make the next selection window shown without clicking the little arrow on the right side? I really would like this to be a click by click event, if possible.

Can anyone help me on implementing a similar procedure?

Thanks,

Ahmet Unal
Milena
Telerik team
 answered on 17 Apr 2015
2 answers
202 views

Is there a built-in way to convert from the "{ColumnLetter}{RowNumber}" notation to the CellIndex format?

Example:

"C5" becomes ColumnIndex=2, RowIndex=4

"AA2" becomes ColumnIndex=26, RowIndex=1

 

It's not the end of the world to write my own conversion, but I was just curious if this is already supported.

 

Thanks!

 

 

 

Stephen
Top achievements
Rank 1
 answered on 16 Apr 2015
5 answers
182 views

I would like to use the 'accent'/'selected' color from my office 2013 implicit theme for a generic control (in my case I am using a Hyperlink inside a TextBlock - I have two of those) in code/xaml to show the selected/unselected color depending on whether the user clicks on one or the other link, i.e. if the user clicks on option 1, I'd like to apply the corresponding color/brush that'd show that it is selected, when the user clicks on option 2, then, I'd like to return option 1 to the default color and have Option 2 switch to the 'selected' one. 

 I have approached it somehow as follows (I changed the hyperlink to a RadButton hopping that it'd help):

                        <telerik:RadButton  x:Name="ShowDashboardHyperlink" Click="ShowDashboardHyperlink_OnClick" Content="DASHBOARD">

                                <telerik:RadButton.Style>
                                    <MultiBinding Converter="{StaticResource StyleConverter}">
                                        <MultiBinding.Bindings>
                                            <Binding RelativeSource="{RelativeSource Self}" />
                                            <Binding Path="DashboardStyle" />
                                        </MultiBinding.Bindings>
                                    </MultiBinding>
                                </telerik:RadButton.Style>
                            </telerik:RadButton>

 

With a style converter like:

 

public class StyleConverter : IMultiValueConverter

{

blah...

}

And on my view model:

 

        public string DashboardStyle
        {
            get { return _dashboardStyle; }
            set
            {
                _dashboardStyle = value;
                RaisePropertyChanged(() => DashboardStyle);
            }
        }

Somewhere in my constructor I initialize my colors:

            DashboardStyle = "AccentMainBrush";
            CalendarStyle = "BasicBrush";

It compiles and all but I think the part that I don't get right is the binding.

 

I'll appreciate any help.

Vanya Pavlova
Telerik team
 answered on 16 Apr 2015
3 answers
183 views
My ComboBox is editable for filtering, i need to type Chinese characters and i found some popular Chinese IME's pop-up windows apprear behind RadComboBox's.
It makes me cannot see matched Chinese character options. So is there any IME functionality with Telerik controls.
Nasko
Telerik team
 answered on 16 Apr 2015
2 answers
116 views

So I am trying to figure out how to change the category of an occurrence. Lets say a custom has an appointment every wednesday at 1pm.  When they make the appointment, I will mark that occurrence as Blue. If they miss the appointment, I mark the occurrence as Red.

I was looking at sourcecode of ScheduleView and it seems an occurrence is nothing more then the original appointment with the occurrence start and duration added to the object, which makes up the Occurrence object.  So if I change the Category of one,it changes them on all because it is really the same Appointment object with just different dates.  So is there anyway to treat an Occurrence like a unique object that you can change Category or properties of, but it still stays part of the RecurrencePattern?

 Or is it possible on an appointment, when you call GetOccurrences, the return custom appointments that have more properties?

On an Occurrence, I don't see the different between the appointment and the Master. 

 

Vladi
Telerik team
 answered on 16 Apr 2015
1 answer
66 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
85 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
603 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
102 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
81 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?