Telerik Forums
UI for WPF Forum
4 answers
71 views
I have a problem with my TreeListView not responding the INotifyCollectionChanged events immediately.

When a user requests to change the order of a node, my code will remove and then reinsert all of the children of the node into a different position with a different display name. But the tree list view still displays the children in the old order and with the old name. If I expand some unrelated node, the children will change to the new order and the new display names.
Is there a way to get the tree list view change immediately?
My ItemsSource is an IQuerable against an ObservableCollection. It looks like this:
Public ReadOnly Property Children As IQueryable(Of BaseLimb)
  Get
    Return pGrouper.Children.Select(Function(e) e.Owner).AsQueryable
  End Get
End Property

I had other problems when I just may it an IEnumerable.
Is there some else I should be doing to make the change immediate?




Vlad
Telerik team
 answered on 07 Dec 2012
1 answer
97 views
I have a set of tabbed views that correspond to RadTreeViewItems so that when the treeViewItem is clicked, the correct tab is selected and when a different tab is clicked, the correct treeViewItem is selected.  I am binding to the RadTreeViewItem.Command property so that I am notified when the user clicks on the treeViewItem..

The problem is that programmatically changing the IsSelected property of a treeViewItem does not "reset the active" treeViewItem, meaning that the original treeVIewItem will not fire its Command when the user clicks on it.  Visually, everything looks correct, but I don't know how to notify the treeview that I programmatically changed the active treeViewItem.

Example, the user clicks on treeViewItem1 --> treeViewItem1 highlights and then highlights tab1.  The user then selects tab2 --> tab2 highlights and treeViewItem2.IsSelected is set to true.  When the user clicks back on treeViewItem1, its Command is not fired. 

Additionally, I do not want the treeViewItem that is programmatically set as IsSelected to fire its Command.  That would cause in infinite loop in my current code.
Ricky
Top achievements
Rank 1
 answered on 06 Dec 2012
0 answers
90 views
Hi,

We created a custom column (based on GridViewBoundColumnBase using the CreateCell* methods to create the various controls) to display a TextBox and a RadButton.  The purpose of the button is to show a modal window to display the content of the TextBox (because our TextBox cannot not accept multilines).

 Here an example of what we're doing:

|    SSN       |  Another column  | My Custom column |
--------------------------------------------------------------
|                  |                             |  *Text Box*   |Button|   <----- New Row
--------------------------------------------------------------
| 111111111 |                             |  *Text Box*   |Button|
--------------------------------------------------------------

There is a validation on the mandatory SSN column.


First implementation
Both the Cell and cell edit template define the button with IsEnabled = true.

  • When we click on the button on row #2, the Click Event of the button is triggerred (showing our modal window).  Then, the row validating of the first row is fired.  This leaves us in a bizarre situation where our modal shows info from the second row while the grid marks the first row with validation errors.

Second implementation
The button in the Cell Template is IsEnabled = False and the one in the CellEdit is IsEnabled=true.

In this scenario, when we click on the disabled button on row #2, the validation of row #1 is triggered.  The focus on row #2 is set only when row #1 is valid. 

However, on row #2 when the Cell Edit template is shown, the focus is set to the first control (Textbox)...

In the second approach, there are 2 problems: 1 - The "click" is not sent to the "Cell Edit" button AND 2 - the "Cell" button is disabled (at first, the user thinks that the button is not accessible.

--------------------------------------------

With that in mind, is there a way to this :

  • In the first implementation, is there a way to trigger Validation of the first row within our Custom column and giving back the focus on row #1;
  • In the second implementation, is there a way to visually make the the RadButton looks like an Enabled button event when disabled AND is there a way to catch the click on the disabled button and to trigger it on the enabled button;
  • A new and better implementation ;-)

Thanks.
-----------------------------------------------------

Using version: 2012.2.607.35 with WPF
Michel Loubier
Top achievements
Rank 1
 asked on 06 Dec 2012
1 answer
143 views
Hello everyone,

I'm using ChartView control and getting a wierd out of memory exception when messing with minimum of DateTimeContinuousAxis on the chart view control. I'm not sure whether I'm doing something wrong here or is this a bug so I'm asking for second opinion.  I've prepared a small project and attached it to this post for reproducing this issue. It creates a small graph with 5 DateTimes from 2012/12/3 10:00 - 2012/12/3 10:40. Axis minimum is set to DateTime.MinValue and maximum to DateTime.MaxValue. When I set new minimum in same hour ie. 2012/12/3 10:59:59, everything is ok. When you set minimum to 2012/12/3 11:00:00 it will cause OutOfMemory exception (not very nice in production environment). :)
Solution: http://dl.dropbox.com/u/2085626/TelerikException.rar
I've also attached a stack trace where it breaks.
Petar Kirov
Telerik team
 answered on 06 Dec 2012
6 answers
253 views

Hi,
I am using RadScheduleView for Calendar type implementation.
I  implemented filter that works fine for all ViewDefinitions except the ViewDefinition which is first on the NavigationHeader or in other words the ViewDefinition at Index=0 is not performing Filter.

Example:-
Below is the definition of RadSchedulerView that I am using.

      <telerik:RadScheduleView  Name="xRadScheduleView" 
                                AppointmentsSource="{Binding Appointments}"
                                ResourceTypesSource="{Binding ResourceTypeCollection, Mode=TwoWay}" 
                                GroupDescriptionsSource="{Binding GroupDescriptions}"
                                MinAppointmentHeight="60" 
                                NavigationHeaderVisibility="Visible" 
                                SpecialSlotStyleSelector="{StaticResource SpecialSlotStyleSelector}"
                                SpecialSlotsSource="{Binding SpecialSlots}"
                                ShowCurrentTimeIndicator="True"
                                CurrentTimeIndicatorStyle="{StaticResource CurrentTimeIndicatorStyleCustom}"
                                CurrentDate="{Binding CurrentDate, Mode=TwoWay}"
                                Grid.Row="1" 
                                VerticalScrollBarVisibility="Auto"
                                VerticalAlignment="Stretch" 
                                SelectedSlot="{Binding SelectedSlot, Mode=TwoWay}"
                                SelectedAppointment="{Binding SelectedAppointment, Mode=TwoWay}"
                                HorizontalScrollBarVisibility="Visible" >
<telerik:RadScheduleView.DragDropBehavior>
          <Helper:AppointmentDragDropConditionalBehavior/>
</telerik:RadScheduleView.DragDropBehavior>
<telerik:RadScheduleView.ViewDefinitions>
          <telerik:TimelineViewDefinition AppointmentFilter="{Binding FilterValue}"/>
          <telerik:MonthViewDefinition AppointmentFilter="{Binding FilterValue}"/>
          <telerik:WeekViewDefinition AppointmentFilter="{Binding FilterValue}"/>
          <telerik:DayViewDefinition AppointmentFilter="{Binding FilterValue}" />
        </telerik:RadScheduleView.ViewDefinitions>
</telerik:RadScheduleView>


Below are the view definitions .

<telerik:RadScheduleView.ViewDefinitions>
          <telerik:TimelineViewDefinition AppointmentFilter="{Binding FilterValue}"/>
          <telerik:MonthViewDefinition AppointmentFilter="{Binding FilterValue}"/>
          <telerik:WeekViewDefinition AppointmentFilter="{Binding FilterValue}"/>
          <telerik:DayViewDefinition AppointmentFilter="{Binding FilterValue}" />
</telerik:RadScheduleView.ViewDefinitions>

The FilterValue is a property in my ViewModel. Some terminology to understand code.
  1. AppointmentBase is Custom Appointment derived from Appointment class as suggested in your Help website.
  2. Process is Resource derived from Resource class as suggested in your Help website.
  3. CheckedProcesses is the local property which is List of Process ( Resource)

public Predicate<IAppointment> FilterValue
{
  get
  {
    return Filter;
  }
}
public bool Filter(IAppointment appt)
{
  if (SelectedProcess == null && !SelectAllProcesses)
    return false;
  if (SelectAllProcesses)
    return true;
  AppointmentBase app = appt as AppointmentBase; //Custom Appointment
  return app != null && FilterByProcess(app);
}
public bool FilterByProcess(DZNEAppointmentBase app)
{
  bool isFiltered = false;
  isFiltered = this.CheckedProcesses.Where(s => s.ProcessID.Equals(app.Process.ProcessID)).FirstOrDefault() != null;
  return isFiltered;
}

Filtering Scenario:

  1. When all Resources are checked we need to show all Appointment associated with each checked Resource. 
  2. When user uncheck a Resource, all Appointment associated with that Resource should get disappear from Calendar.


Above scenario works well for all ViewDefinitions  such as Day, Week, Month, Timeline and other Custom View definitions if an only if the ActiveViewDefinitionIndex is not ZERO.

So, for above view definition list in code snippet, filter is not working for very first view definition i.e. “TimelineViewDefinition”.

 


I just want to know what setting I am missing or if there are other ways to implement filter.
Any input will be highly appreciated.

Elgan
Top achievements
Rank 1
 answered on 06 Dec 2012
6 answers
654 views
Hello,

I am using GridViewRowDetails to display information regarding a row in a GridView.  I am using the GridViewToggleRowDetailsColumn to toggle the information off and on.  I am developing with the MVVM pattern and extensive databinding.  I want to be able to hide the plus sign on a per row basis using binding.  In addition I would like to be able to toggle the button in my ViewModel code as needed.  Do you have any suggestions on how this can be accomplished using MVVM and binding?

Thanks,

Jason
Rob Ainscough
Top achievements
Rank 1
 answered on 06 Dec 2012
2 answers
141 views
One of your Diagram samples contains a nice RadDiagramToolbox that I would like to use. However, the "Code" section merely contains a stripped Example.xaml...?

How can I make the RadDiagramToolbox look like in the attached image?
Kristoffer
Top achievements
Rank 1
 answered on 06 Dec 2012
3 answers
212 views
Hi,

I'm having problems with binding my items within a gridview controltemplate. I've already followed the WPF examples of it (GridView Examples - Appearence - Custom Row Layout), but whatever I try, binding isn't working when the RowStyle/ControlTemplate is active.

Below a simplified code snippet from the example, but with my own binding names:
<Grid>
        <Grid.Resources>
            <ControlTemplate x:Key="MyCustomRowTemplate" TargetType="telerik:GridViewRow">
                <Border x:Name="rowsContainer" BorderThickness="0,0,0,1">
                    <Grid Width="Auto" HorizontalAlignment="Stretch">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="20"/>
                            <RowDefinition Height="20"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="150" />
                        </Grid.ColumnDefinitions>
 
                        <TextBlock Text="Data1: " Margin="5,0,0,0" FontWeight="Bold" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left"  />
                        <TextBlock Text="{Binding Data1}" Margin="5,0,0,0" Grid.Row="0" Grid.Column="1"  VerticalAlignment="Center" HorizontalAlignment="Left"/>
                        <TextBlock Text="Data2: " Margin="5,0,0,0" FontWeight="Bold" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"  />
                        <TextBlock Text="{Binding Data2}" Margin="5,0,0,0" Grid.Row="1" Grid.Column="1"  VerticalAlignment="Center" HorizontalAlignment="Left"/>
                        <TextBlock Text="Data3: " Margin="5,0,0,0" FontWeight="Bold" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Center"  />
                        <TextBlock Text="{Binding Data3}" Margin="5,0,0,0" Grid.Row="2" Grid.Column="1"  VerticalAlignment="Center" HorizontalAlignment="Left"/>
                    </Grid>
                </Border>
            </ControlTemplate>
            <Style x:Key="rowStyle" TargetType="telerik:GridViewRow">
                <Setter Property="Template" Value="{StaticResource MyCustomRowTemplate}" />
            </Style>
        </Grid.Resources>
 
        <telerik:RadGridView RowStyle="{StaticResource rowStyle}" ItemsSource="{Binding Contacts}" ShowGroupPanel="False"
             BorderThickness="0" IsFilteringAllowed="False" AutoGenerateColumns="False" CanUserFreezeColumns="False" >
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Data1" DataMemberBinding="{Binding Data1}"/>
                <telerik:GridViewDataColumn Header="Data2" DataMemberBinding="{Binding Data2}"/>
                <telerik:GridViewDataColumn Header="Data3" DataMemberBinding="{Binding Data3}"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
    </Grid>

You see the bindings to Data1, Data2, Data3, but as soon as I run it, those field stay empty, see screenshot 1

However, when I remove the RowStyle="{StaticResource rowStyle}" in my RadGridView then the Data is displayed correctly in the row, see screenshot 2

I've already tried binding with Path=, or CurrentItem.Data1 and several other options, but none of it works, while it works in de example.

I'm problably missing something, but if I compare my code with the example, I don't see any difference in binding, so any help would be appreciated.

Thanks in advance
Rutger Kars
Top achievements
Rank 1
 answered on 06 Dec 2012
4 answers
160 views
Hi,
    I am relatively new to WPF and Telerik RadGridView. I have a requirement to validate my cell column in heiarchical gridview in WPF. Means suppose when the user clicks on the column and enters a value, we should be able to check the db and validate whether the data entered is right or wrong and show proper messages. I am using WPF with MVVM and EF. Can you please suggest me the best possible way to achieve this functionality.

Thanks & Regards
Somasekharan Thampi S
Somasekharan
Top achievements
Rank 1
 answered on 06 Dec 2012
3 answers
625 views
I have some data that is coming from a Stored procedure which i have been able to display in a non-Telerik DataGrid.  using the following code.

CBFdataDataContext conn = new CBFdataDataContext();
List<spTotalRevByZipResult> sptotalrevbyzipresult = (from s in conn.spTotalRevByZip()
select s).ToList();
ZipGrid.ItemsSource = sptotalrevbyzipresult;

But with using the radCartesianChart, It says that there is no ItemSource.
<telerik:RadCartesianChart HorizontalAlignment="Left" Margin="10,104,0,0" Grid.Row="1" VerticalAlignment="Top" Width="723" Height="218" Name="ZipGrid">
           <telerik:RadCartesianChart.VerticalAxis>
               <telerik:LinearAxis/>
           </telerik:RadCartesianChart.VerticalAxis>
           <telerik:RadCartesianChart.HorizontalAxis>
               <telerik:CategoricalAxis/>
           </telerik:RadCartesianChart.HorizontalAxis>
           <telerik:RadCartesianChart.Series>
               <telerik:BarSeries CategoryBinding="subTotal"
                                  ValueBinding="custzip"
                                  ItemsSource="{Binding}"/>
           </telerik:RadCartesianChart.Series>
       </telerik:RadCartesianChart>
So How do i load the chart with Data?
CBFsqldataDataContext conn = new  CBFsqldataDataContext();
            List<spTotalRevByZipResult> sptotalrevbyzipresult = (from s in conn.spTotalRevByZip()
                                                                 select s).ToList();
             
            ZipGrid????????? = sptotalrevbyzipresult;











Petar Kirov
Telerik team
 answered on 06 Dec 2012
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?