Telerik Forums
UI for WPF Forum
1 answer
108 views
I am using the TimeBar control to display some data and it seems like the data is being shifted somewhat.
For instance, the data I am loading has the spike at 8 PM on the 21st instead of early on the 22nd.

 
Missing User
 answered on 14 Jun 2011
1 answer
131 views
I want this above code to be writen in c# rather then using XAML, anyone knows how to do this?
<
telerik:RadTreeListView x:Name="radTreeListView">
   
<telerik:RadTreeListView.ChildTableDefinitions>
       
<telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}">
       
</telerik:TreeListViewTableDefinition>
   
</telerik:RadTreeListView.ChildTableDefinitions>
</
telerik:RadTreeListView>

Thanks,
Faheem
Faheem
Top achievements
Rank 1
 answered on 13 Jun 2011
4 answers
179 views
I am using a radgridview to show a list of data on a day by day basis, and one of the columns is a DateTime column representing the date that each line was created.

The issue that I face is this.  The column in question shows the full date and time (down to the second).  When you open the filter control for that column however, in the section where you can check individual unique values, it does NOT display down to the second, which makes it impossible to pick the specific ones you want.

Is there a way to adjust the filter to display the seconds as well as everything else?

Thanks
Alex Fidanov
Telerik team
 answered on 13 Jun 2011
5 answers
1.3K+ views
I'm relatively new to WPF and currently evaluating Telerik components. I got stuck when trying to bind RadTabControl items to content control objects. Probably the automatically generated RadTabItem doesn't like to wrap a content control (e.g. HeaderedContentControl) because regular objects work as expected. Am I trying to accomplish something that can't be done? Below you'll find a example that illustrates what I mean. Any help will be appreciated very much.

XAML:
<Window x:Class="RadControlsWpfApp1.MainWindow"
        xmlns:local="clr-namespace:RadControlsWpfApp1"
        xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
        Title="MainWindow" Height="350" Width="525">
      
    <Window.Resources>
        <DataTemplate x:Key="TabItemTemplate">
            <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                <Image Width="18" Height="18" Source="{Binding Icon}" Stretch="Fill" Margin="0,0,3,0" />
                <TextBlock Text="{Binding Header, diagnostics:PresentationTraceSources.TraceLevel=High}"/>
            </StackPanel>
        </DataTemplate>
    </Window.Resources>
  
    <Grid>
        <telerik:RadTabControl
            ItemsSource="{Binding Tabs}"
            ItemTemplate="{StaticResource TabItemTemplate}" />
    </Grid>
</Window>

Code behind:
using System.Windows;
  
namespace RadControlsWpfApp1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            DataContext = new MainWindowViewModel();
            InitializeComponent();
        }
    }
}

View model:
using System;
using System.Collections.ObjectModel;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Telerik.Windows.Controls.QuickStart;
  
namespace RadControlsWpfApp1
{
    public class MainWindowViewModel
    {
        private BitmapImage Bullet = new BitmapImage(new Uri("/RadControlsWpfApp1;component/bullet_red.png", UriKind.Relative));
  
        public ObservableCollection<IItem> Tabs { get; set; }
  
        public MainWindowViewModel()
        {
            Tabs = new ObservableCollection<IItem>();
            Tabs.Add(new ItemControl { Header = "Item 1", Icon = Bullet });
            Tabs.Add(new Item { Header = "Item 2", Icon = Bullet });
        }
    }
  
    public interface IItem
    {
        object Header { get; set; }
        ImageSource Icon { get; set; }
    }
  
    public class Item : IItem
    {
        public object Header { get; set; }
        public ImageSource Icon { get; set; }
    }
  
    public class ItemControl : HeaderedContentControl, IItem
    {
        public ImageSource Icon { get; set; }
    }
}
Tina Stancheva
Telerik team
 answered on 13 Jun 2011
9 answers
127 views
Hi there,

i'm having a strange issue with my gridview control in that when i set autogeneratecolumns to true and bind to a dataset, i am able to input values into cells and exit edit mode with the values still present in the cells but not so if i generate these columns programmatically.

i had to switch to programmatic cell loading because we need to load a dynamic list of columns to the grid based on user selections and so certain columns would only be added under certain conditions. however when i add a column to the grid, any input that i make in the cell just gets lost as soon as i exit edit mode.

this is how i create and add the gridviewdatacolumn:

GridViewDataColumn min = new GridViewDataColumn();
            min.UniqueName = "minCol";
            min.Header = "Min";
            min.FooterTextAlignment = TextAlignment.Right;
            min.TextAlignment = TextAlignment.Right;
            min.DataMemberBinding = new Binding("Min");
            min.DataType = Type.GetType("System.Int32");
            min.AggregateFunctions.Add(new SumFunction { SourceField = "Min"});
            radStoreGrid.Columns.Add(min);

what am i doing wrong? i've been sitting with this for over an hour and i just don't see the difference between this and the xaml declaration which worked fine...

thanks,
Nemanja
Maya
Telerik team
 answered on 13 Jun 2011
9 answers
161 views
hi
i need return all item rad tree view in hierarchical mode?
Davood
Top achievements
Rank 1
 answered on 12 Jun 2011
2 answers
82 views
Hi,
I use RadGridView in Grid panel:
<Grid.RowDefinitions>
    <RowDefinition Height="60"/>
    <RowDefinition Height="500"/>
</Grid.RowDefinitions>
The first row is Header and the second one RadGridView.
It works fine according to performance.


<Grid.RowDefinitions>
    <RowDefinition Height="60"/>
    <RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
On the other hand this RadGridView works fine according to flexibility but not UI performance.


How to achieve such effect like having RadGridView fast UI and on the other hand when user change size of the window,
RadGridView also adjust visible amount of rows to fulfill window size.
Thanks in advance.
Robert
Robert
Top achievements
Rank 1
 answered on 11 Jun 2011
0 answers
151 views
Hi,

I get two crashes when adding a new appointment in a RadScheduleView.
The type of the appointments is a custom BFAppointment class that I made which inherits from AppointmentBase.
The type of the AppointmentsSource of the control is a BFAppointmentList class I made, and this one inherits from ObservableCollection<BFAppointment>, so this shouldn't be an INotifyCollectionChanged bug.

The two crashes are:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
   at System.Collections.ArrayList.get_Item(Int32 index)
   at System.Windows.Data.ListCollectionView.ProcessCollectionChangedWithAdjustedIndex(NotifyCollectionChangedEventArgs args, Int32 adjustedOldIndex, Int32 adjustedNewIndex)
   at System.Windows.Data.ListCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args)
   at System.Windows.Data.CollectionView.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
   at System.Collections.ObjectModel.Collection`1.RemoveAt(Int32 index)
   at System.Windows.Data.ListCollectionView.CancelNew()
   at Telerik.Windows.Controls.ScheduleView.ScheduleViewDataConnection.HackCollectionViewBug(Boolean isCommit) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleViewDataConnection.cs:line 875
   at Telerik.Windows.Controls.ScheduleViewBase.CommitNew(IAppointment appointment) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Editing.cs:line 341
   at Telerik.Windows.Controls.ScheduleViewBase.Commit() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Editing.cs:line 253
   at Telerik.Windows.Controls.ScheduleViewBase.OpenAppointmentDialog(Occurrence occurrence, AppointmentViewMode viewMode) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.EditingWithDialogs.cs:line 297
   at Telerik.Windows.Controls.ScheduleViewBase.CreateAppointmentWithDialog(Object parameter) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.EditingWithDialogs.cs:line 82
   at Telerik.Windows.Controls.ScheduleViewBase.OnCreateAppointmentExecuted(Object sender, ExecutedRoutedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Commands.cs:line 166
   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
...


and:

System.ArgumentOutOfRangeException: The added or subtracted value results in an un-representable DateTime.
Parameter name: value
   at System.DateTime.AddTicks(Int64 value)
   at System.DateTime.Add(Double value, Int32 scale)
   at Telerik.Windows.Controls.DateTimeExtensions.SubtractInterval(DateTime dt, DateTimeInterval dateTimeInterval) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Extensions\DateTimeExtensions.cs:line 17
   at Telerik.Windows.Controls.ScheduleViewBase.GetFirstPartOfOccurrencesWithNoEndDates(DateSpan range, IEnumerable`1 source, Boolean moveForward, DateTimeInterval interval) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:line 3571
   at Telerik.Windows.Controls.ScheduleViewBase.HasAppointmentsInRange(DateSpan range, Boolean skipIntersectedWithTheRangeAppointments, Boolean moveForward, DateTimeInterval interval) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:line 1316
   at Telerik.Windows.Controls.ScheduleViewBase.OnQueryGoToPreviousAppointmentCanExecuted(Object sender, CanExecuteRoutedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Commands.cs:line 300
   at System.Windows.Input.CommandBinding.OnCanExecute(Object sender, CanExecuteRoutedEventArgs e)

...

I have some custom code when creating an appointment, as shown here:

void m_scheduleView_AppointmentCreating( object sender, AppointmentCreatingEventArgs e )
        {
            BFAppointment appointment = e.Appointment as BFAppointment;
            appointment.Schedule = ViewModel.BaseEntity;

            ScheduleTimespan timespan = new ScheduleTimespan();
            timespan.ScheduleId = ViewModel.BaseEntity.Id;

            appointment.TimespanViewModel = new ScheduleTimespanViewModel( timespan, ServiceLocator.Get<IEntityManager>() );
        }

        /// <summary>
        /// Handles the display of default Telerik dialogs to cancel them and substitute mine.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
        {
            // Dialog used to ask if we want to edit only the current occurrence or the whole series.
            // Since we ONLY support series, we skip the dialog.
            if ( e.DialogViewModel is RecurrenceChoiceDialogViewModel )
            {
                RecurrenceChoiceDialogViewModel vm = e.DialogViewModel as RecurrenceChoiceDialogViewModel;

                vm.IsSeriesModeSelected = true;
                e.DefaultDialogResult = true;
                e.Cancel = true;
            }
            // Replace the Telerik occurrence editor with our own.
            else if ( e.DialogViewModel is AppointmentDialogViewModel )
            {
                AppointmentDialogViewModel vm = e.DialogViewModel as AppointmentDialogViewModel;
                BFAppointment appointment = ( vm.Occurrence.Appointment as BFAppointment );

                if ( appointment.TimespanViewModel != null )
                {
                    // Show a window to edit the appointment.
                    ScheduleTimespanViewModel timespanVM = appointment.TimespanViewModel;

                    ScheduleTimespanControl control = new ScheduleTimespanControl() { ViewModel = timespanVM };
                    GenericEditableWindow window = new GenericEditableWindow( control, "ScheduleProperties", ServiceLocator.Get<IMainWindow>() as Window, GenericEditableWindowModeEnum.OK );
                    window.ShowDialog();
                }

                e.DefaultDialogResult = true;
                e.Cancel = true;
            }
        }

Setting e.Handled = true; in the AppointmentCreating event doesn't fix the issue.
Any pointers would be greatly appreciated.

Sebastien
Sébastien
Top achievements
Rank 1
 asked on 10 Jun 2011
4 answers
114 views
Hi.

I want to know, How can i achieve the func for disabling the certain rows in my grid which are not fulfill the criteria. For eg. I just want to enable only those rows whose shiptime is today. I' using the MVVM pattern.

Nikhil Jain
Top achievements
Rank 1
 answered on 10 Jun 2011
1 answer
69 views
Hi,

I was wondering if I can use the RadMap control to simulate the Interactive Directory Service in Malls and Buildings for the visitor to find their way. The direction locator, routing animation and such. Any suggestion for that, please? :)
Andrey
Telerik team
 answered on 10 Jun 2011
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?