Telerik Forums
UI for WPF Forum
1 answer
121 views
I have a record in my database which i need  to display in the radschedule view. Please suggest me how to do it.
Nasko
Telerik team
 answered on 30 Oct 2014
5 answers
398 views
Hi guys,

I am try my best to make myself clear. I have two pages with one of them being Config page. In the config page, I have a RadCombox to choose a time span value. The code snippets are below.
<telerik:RadComboBox Width="125" FontSize="{DynamicResource FontSizeBig}"
        VerticalAlignment="Center" Height="32" Margin="0,0,5,0" SelectedValue="{Binding Realtime.TimeRemaining, Converter={StaticResource DetectionDurationConverter}, Source={StaticResource Locator}}">
              <telerik:RadComboBoxItem Content="10 s" />
              <telerik:RadComboBoxItem Content="10 minutes"/>
              <telerik:RadComboBoxItem Content="1 hour"/>
              <telerik:RadComboBoxItem Content="Custom" Margin="0"/>
</telerik:RadComboBox>

As you can see from the above code, I binds the selected value to TimeRemaing property and I would use a customized converter named DetectionDurationConverter to turn 10 s, 10 minutes and 1 hour into a time span value in C#.  Here is my converter. 
public class DetectionDurationConverter : IValueConverter
{
    private static readonly string[] durationSet = new[] {"10 s", "10 minutes", "1 hour"};
 
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        var timeSpan = (TimeSpan) value;
        if (timeSpan == TimeSpan.FromSeconds(10.0))
        {
            return durationSet[0];
        } else if (timeSpan == TimeSpan.FromMinutes(10.0))
        {
            return durationSet[1];
        } else if (timeSpan == TimeSpan.FromHours(1.0))
        {
            return durationSet[2];
        }
        return string.Empty;
    }
 
    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        var timeSpan = TimeSpan.MinValue;
        if (value is RadComboBoxItem)
        {
            var val = System.Convert.ToString((value as RadComboBoxItem).Content);
            if (val == durationSet[0])
            {
                timeSpan = TimeSpan.FromSeconds(10.0);
            }
            else if (val == durationSet[1])
            {
                timeSpan = TimeSpan.FromMinutes(10.0);
            }
            else if (val == durationSet[2])
            {
                timeSpan = TimeSpan.FromHours(1.0);
            }
        }
        return timeSpan;
    }
}

For example, when I select a '10 s', it goes to ConvertBack method as expected and TimeRemaining is a 10 second time span value. Then I switched to another page and switched back, it goes to Convert method with TimeRemaining being 10 seonds still. Note, the method Convert would be entered twice. However, in the UI, no items have been selected. I just hope the selected item would be consistent with the value of TimeRemaining.

Thanks,
-J
Jackey
Top achievements
Rank 1
 answered on 30 Oct 2014
1 answer
122 views

How do I tell the SpellChecker to do a case-insentitive word comparison?

So if my dictionary of valid words contains "Foo" how do I tell the SpellChecker not to underline lower-case "foo"?


(I don't mean DocumentSpellChecker.Settings.SpellCheckUppercaseWords feature)

Petya
Telerik team
 answered on 29 Oct 2014
2 answers
155 views
Hello,

I have a RadListBox with 10 items in it, when I drag and drop them to re-order everything is working correctly except when I drop in the very last position.

I expect to get position 10 from DragDropState state.InsertIndex, however, I get position 0 and my item will get added to the top of the list.

Thank,

Kevin
Nasko
Telerik team
 answered on 29 Oct 2014
1 answer
144 views
How to set RadButtonElement's Properties like FontSize, Padding, Margin???
Milena
Telerik team
 answered on 29 Oct 2014
2 answers
213 views
I guess I am missing something on the outlook bar.  I have the outlook bar in a grid with horizontal and vertical size set to stretch.  When I resize the form, the outlook bar resizes, great.  However, when I do a minimize with either the header icon or with the right side sizer, the outlook bar doesn't move to the left, it "pinches" together in the center of the column.  I know that you can have the bar collapse to the left, one of the demos show it, but I can't figure it out.  How can I collapse the outlook bar to the left?

Thanks.
Milena
Telerik team
 answered on 29 Oct 2014
11 answers
581 views
Hi,
I want to change the default behavior of autohide are, 

at present if i mouseover on auto hide area a panel will opens from left to right with a animation, but i want to open the panel on clicking on auto hide area. 

is it possible if yes can you please tell me how can i do that ?
please check the attached png for more information.

Thanks in advance,
Srinivas.
Kalin
Telerik team
 answered on 29 Oct 2014
2 answers
170 views
I want to bind the properties PeriodStart, PeriodEnd, VisiblePeriodStart, and VisiblePeriodEnd to my ViewModel, but it doesn't work like expected. Could this be a bug in the RadTimeline control?

My ViewModel class is called ParentViewModel:

public class ParentViewModel : ViewModelBase
{
    public String Name { get; set; }
    //public DateTime Start { get { return ChildItems.Min(x => x.Start); } }
    //public DateTime End { get { return ChildItems.Max(x => x.End); } }
    public DateTime Start { get { return DateTime.Now; } }
    public DateTime End { get { return DateTime.Now.AddDays(7.0);  } }
    public TimeSpan Duration { get { return End - Start; } }
    public ObservableCollection<TestViewModel> ChildItems { get; private set; }
 
    public ParentViewModel()
    {
        ChildItems = new ObservableCollection<TestViewModel>();
    }
 
    public void AddChilds(IEnumerable<TestViewModel> childs)
    {
        foreach (var x in childs)
        {
            ChildItems.Add(x);
        }
    }
 
    public void FirePropertysChanged()
    {
        OnPropertyChanged("Start");
        OnPropertyChanged("End");
    }
}

I set an instance of this class as the DataContext of a RadTimeline, and bind the PeriodStart and PeriodEnd properties like this:

<Grid x:Name="LayoutRoot">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
 
    <StackPanel Orientation="Horizontal" Margin="2">
        <TextBlock FontWeight="Bold" Text="PeriodStart: " />
        <TextBlock Text="{Binding Start}"/>
    </StackPanel>
 
    <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="2">
        <TextBlock FontWeight="Bold" Text="PeriodEnd: " />
        <TextBlock Text="{Binding End}"/>
    </StackPanel>
 
    <telerik:RadTimeline x:Name="radTimeline1" Grid.Row="2"
                         PeriodStart="{Binding Start}"
                         PeriodEnd="{Binding End}"
                         StartPath="Start"
                         DurationPath="Duration"
                         ItemsSource="{Binding ChildItems}">
        <telerik:RadTimeline.Intervals>
            <telerik:MonthInterval />
            <telerik:WeekInterval />
            <telerik:DayInterval />
            <telerik:HourInterval />
            <telerik:MinuteInterval />
        </telerik:RadTimeline.Intervals>
    </telerik:RadTimeline>
 
</Grid>

The Start and End properties are correctly bound to the TextBlocks and the Dates are displayed. 
However, the RadTimeline's content is blank. 
I tried to raise the OnPropertyChanged events (in the method FirePropertysChanged in my ViewModel), but that doesn't help.
When the date values are hardcoded in XAML, the RadTimeline works. But it doesn't work if bound to a ViewModel.
Could this be a bug?
Ola
Top achievements
Rank 1
 answered on 29 Oct 2014
1 answer
108 views
I'm getting back to a project I started some time ago. I'm generating map tiles with TileMill and placing the tiles in a Postgres database for use in an offline application. Is there any documentation or code sample that shows how to use a database for the RadMap data source? The first solution that comes to mind is hosting a local service that fetches the map tiles from the database. This seems like an overly complicated solution and there should be an easier way.

Thanks,
Petar Mladenov
Telerik team
 answered on 29 Oct 2014
3 answers
191 views
Hi - I'm hoping to use the combo of the RadPropertyGrid with the Dynamic Linq library and generic types as a way to support business rules.  I've already got fully working code with a TextBox and now am hoping to replace that with a  more feature-rich ExpressionEditor.

The idea is this: given an arbitrary class (well known at runtime), create an object of the class and wire it up to the RadPropertyGrid as a "sample".  Then use the RadExpressionEditor (also wired to the same object) to enable the user to craft an expression that can select that item later during some other business processing (again, I have this basically working).

My three questions are as follows:
* the RadPropertyGrid supports DataAnnotations for things like [Browsable(false)] to suppress a given property from the RadPropertyGrid.  I'm wondering if the same DataAnnotation support could be added to the ExpressionEditor Fields list so that fields like "IsChanged" (just part of the IChangeTracking interface) could be suppressed.
* Can the Fields list of the ExpressionEditor be updated to support complex types like the Property Grid (like nested properties)?  (e.g. Class a has three string properties and a fourth property of "ClassB" with three int properties -- I want to see the deep property names for the three ints in the field list).
* Can the Editor itself support intellisense for an enum type?  (e.g. property X if of type Choices which is an enum -- so then I add "X = " using the Expression Editor functions and manually start typing "Choices." in the editor and can see the possible values.

I'm guessing the information I've provided above is enough to answer, but if you would like some code snippets and/or screenshots of this, I can provide those.

Thanks in advance for your consideration.  (and congrats on the Progress thing :)  )

Erik Dahl
​
Dimitrina
Telerik team
 answered on 29 Oct 2014
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?