Telerik Forums
UI for WPF Forum
2 answers
225 views
I Have a GridView bound to a ItemsSource and I'm using mvvm. The problem is when I click "Insert" and/or "Click here to add new item" nothing happens. I can edit the data in the rows and delete row and then grid updates. But not insert new rows.

WPF Code:
<telerik:RadGridView ItemsSource="{Binding WellCompletionEvaluation.CompletionItems}" AutoGenerateColumns="False" CanUserInsertRows="True" Grid.Row="24" Grid.Column="0" Grid.ColumnSpan="6"
               MinHeight="200" MaxHeight="500" ShowInsertRow="True" ShowGroupPanel="False"
               CanUserFreezeColumns="False" RowIndicatorVisibility="Collapsed">

In my model I have this kind of code:
public class WellCompletionEvaluationViewModel : ValidatedViewModelBase
    {
        private readonly JobInfoOperationWellCompletionEvaluation model;
 
        public ObservableCollection<WellCompletionEvaluationCompletionItemsViewModel> CompletionItems { get; private set; }
 
 
        public WellCompletionEvaluationViewModel(JobInfoOperationWellCompletionEvaluation model)
        {
            this.model = model;
 
            WTConfiguration = new WellCompletionEvaluationWTConfigurationViewModel(model.WTConfiguration);
 
            this.CompletionItems = new ObservableCollection<WellCompletionEvaluationCompletionItemsViewModel>(
                from p in this.model.completionItems
                select new WellCompletionEvaluationCompletionItemsViewModel(p));
 
             
        }
 
        public JobInfoOperationWellCompletionEvaluation Model { get { return this.model; } }
 
 
        public WellCompletionEvaluationWTConfigurationViewModel WTConfiguration
        {
            get;
            set;
        }
}


ValidatedViewModelBase implements IDataErrorInfo and ViewModelBase that implements INotifyPropertyChanged and IDisposable

Is there something wrong with my view model+

Best Regards
Rune
Rune
Top achievements
Rank 1
 answered on 04 Jul 2012
3 answers
215 views
Hi.

I have a problem with the ScheduleView.  When changing the view from Month to Day, i get a NullReferenceException.

I've attached a sample.

Steps to reproduce the problem :
* run the sample
* expand the cell filled with data
* switch the view to Day

I get a NullReferenceException at that point.

The stack trace is :
  
at Telerik.Windows.Controls.GroupHeader.InitializeColumnsAndUpdateMaxIntersectedAppointmentsCount()
   at Telerik.Windows.Controls.GroupHeader.Initialize()
   at Telerik.Windows.Controls.AppointmentsPanel.AddHeaders(GroupHeader header, Boolean isHorizontal, Boolean showWeekHeaders, Calendar calendar, CalendarWeekRule weekRule, DayOfWeek firstDayOfWeek)
   at Telerik.Windows.Controls.AppointmentsPanel.MeasureOverride(Size availableSize)
   at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
   at System.Windows.UIElement.Measure(Size availableSize)
   at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV)
(...)

The xaml i used is :

<Window x:Class="scheduleViewError.MainWindow"
        xmlns:scheduleView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.ScheduleView"
        Title="MainWindow" Height="350" Width="525">
     
    <Grid>
 
        <telerik:RadScheduleView x:Name="scheduleview" Grid.Row="2" Grid.Column="2" Margin="0"
                                 AppointmentsSource="{Binding Appointments}"
                                 BorderThickness="0 1 1 1"
                                 FirstVisibleTime="06:00">
 
         
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:MonthViewDefinition />
                <telerik:DayViewDefinition />
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
    </Grid>
 
</Window>

the code-behind is :

public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new ViewModel();
        }
    }
 
public class ViewModel
    {
        private ObservableAppointmentCollection _apppointments;
 
 
        public ViewModel()
        {
            var today = DateTime.Today;
 
            var x = new ObservableCollection<Appointment>(Enumerable.Range(9, 14).Select(i =>
                new Appointment
                {
                    Start = today.AddMinutes(i * 60 + 15),
                    End = today.AddMinutes((i + 1) * 60),
                    Subject = string.Format("Appointment num. {0}", i),
                }));
 
            _apppointments = new ObservableAppointmentCollection();
            _apppointments.AddRange(x);
 
        }
 
        public ObservableAppointmentCollection Appointments
        {
            get
            {
                return _apppointments;
            }
            set
            {
                if (_apppointments == value)
                    return;
                _apppointments = value;
            }
        }
 
    }


I used the 2012.2.607.40 version of the library with .Net Framework 4.0.

Vladi
Telerik team
 answered on 04 Jul 2012
1 answer
83 views
First, I'm a beginner. I saw the examples/demos but all asume that the list of pages for the book is hardcoded in the program. How to make a book that can load any number of pictures by simply placing those pictures in a folder? Or, better, if those files are listed in a text file or xml file how to read from this file and load the items in the book.
Another issue: In the binding example you are using a xmlns:viewModels="clr-namespace:Telerik.Windows.Examples.Book.Binding". Durring build I get an error about that line (I have exacly the same lines of code as your example and added the same pictures in the project). Can you help me find what I'm missing?
Petar Mladenov
Telerik team
 answered on 04 Jul 2012
10 answers
1.2K+ views
Right now if you change the RadTreeListView.FontSize it changes ALL FONTS on the control.

I want to be able to independently set the Font Size of the data displayed in the rows and the column headers. Basically I want to fix the column header text to one size, and then allow the user to change the font size of the data in the rows.

However it looks really bad when the user is changing this and the header changes with it.  I basically have hooked up the scroll wheel to change the font size on the TreeListView and it works just kind of looks bad that the header is changing with it and would like to lock that down if possible.

Thanks.
Rodney Foley
Top achievements
Rank 1
 answered on 03 Jul 2012
12 answers
313 views
Hi,

We have been using 2010 Q2 all this while. We recently upgraded to 2012 Q1. After the upgrade we are running into multiple issues.

We are using Docking in our application. On one of the radpanes we have gridview. On this gridview the showgrouppanel is set to false.
Now when we undock one of the pinned dockpanes, the gridview displays grouppanel and the data is grouped.
This should not be the case.

Pavel Pavlov
Telerik team
 answered on 03 Jul 2012
3 answers
441 views
Hey Guys,

Can you give me a hand and tell me how to change Background Color of TextBox of disabled DatePicker? I attached the screenshot.

Regards,
Tom
Tom
Top achievements
Rank 1
 answered on 03 Jul 2012
1 answer
80 views
Hello Telerik,

I would be grateful if you could answer me on the following question: Does Coded UI recognize and fully support the following WPF Rad controls:
  1. RadDatePicker
  2. RadMaskedTextBox
  3. RadGridView
  4. RadTreeView
  5. RadTreeListView
  6. RadOutlookBar
  7. RadTimePicker
  8. RadComboBox
  9. RadBusyIndicator
  10. RadTileView
  11. RadChart
  12. RadCalendar
  13. RadColorPicker
  14. RadProgressBar

I look forward to hearing from you at your earliest convenience.

Thank you.

Stas.
Yordanka
Telerik team
 answered on 03 Jul 2012
6 answers
320 views
I have a scenario where one column in the table is a timestamp (date + time). I have my grid column configured as follows:

<telerik:GridViewDataColumn
        UniqueName="Timestamp"
        DataMemberBinding="{Binding Timestamp}"
        Header="Timestamp"
        DataFormatString="{} {0:MM/dd/yyyy HH:mm:ss}"
        IsFilterable="False" />

The property is coded as:
public DateTime? Timestamp
{
    get
    {
        ... returns either NULL or datetime object
    }
    set
    {
        _timestamp = value;
    }
}

The display part is working fine: an example of the value displayed is:  12/20/2020 18:40:00

The problem I have is when adding a new row or editing an existing row. When adding a new row, the grid displays an empty row, and if I type in "12/20/2020 18:40:00" and tab out of the column to go to the next column, the timestamp column value is set to NULL (when putting a breakpoint on setter) and the timestamp I entered is wiped out. If I just type the date part (12/20/2020) and tab out, things work fine: the value is set correctly and the column displays "12/20/2020 00:00:00".  I observe similar behavior when trying to edit a row. Do I need to specify a mask, a converter, or something else to get the column to properly accept the timestamp?

Thanks

Andrey
Eric
Top achievements
Rank 1
 answered on 03 Jul 2012
1 answer
90 views
I have a gantt chart wherein the time is measured in days, at the finest level.  So time is not necessary for me.

I am using RadDateTimePicker controls for start/end, and I can control their behavior (limit to days input) by setting the attribute:

 InputMode="DatePicker"

So, basically, if CustomResizeBehavior|CustomDragDropBehavior is turned on, I would like the resizing or dragging of a gantt task to lock to days, and not fall to times in between days.  Is there any way to accomplish this behavior?
Ventzi
Telerik team
 answered on 03 Jul 2012
0 answers
163 views
I'm seeing the following behavior with the DateTimePicker when InputMode=TimePicker.

  1. With cursor in textbox, hit down arrow to open time picker popup.
  2. Then hit tab key to move focus to list of selectable times
  3. Keep hitting tab until focus is on the time you would like to select
  4. Hit enter.  Popup closes but time was NOT selected.  Appears that only a mouse click will select a time.  Is there a setting that will enable selecting a time with the keyboard?

Also,

  1. With cursor in textbox, hit down arrow to open time picker popup.
  2. Then hit tab key to move focus to list of selectable times
  3. Keep hitting tab until focus is on the time you would like to select
  4. Hit enter and popup closes.
  5. Hit down arrow to open time picker.  
  6. Hit tab key to move focus to a selectable time.  Focus does not move to list of times.  How can I get the focus back into the popup to select a time with the keyboard?

Thanks in advance!



Ed
Top achievements
Rank 1
 asked on 03 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?