Telerik Forums
UI for WPF Forum
1 answer
126 views
Hi All,

i am using Wpf 4.0 and PRISM for my dot net application (Visual Studio 2010).

I have one requirement that I have to open a new screen (View) on the click of one of the items of context menu.
I have written the following code for it in my XAML :
<framework:RTPOGridView Grid.Row="1"
         x:Name="orderList" Margin="7,0,7,0"
         VerticalAlignment="Stretch" ItemsSource="{Binding dailyload}" >
                 <telerik:RadContextMenu.ContextMenu>
  
                    <telerik:RadContextMenu x:Name="ViewErrorsContextMenu" IsEnabled="True" >
                        <telerik:RadContextMenu.Items>
                        <telerik:RadMenuItem Header="View Errors" x:Name="itemViewErrors" IsEnabled="True" Command="{Binding Path=ViewErrorsCommand}" >
                                  
                            </telerik:RadMenuItem>
                       </telerik:RadContextMenu.Items>
                    </telerik:RadContextMenu>
  
  
                </telerik:RadContextMenu.ContextMenu>
  
  
            <framework:RTPOGridView.Columns>
                <telerik:GridViewDataColumn  Header="Customer" DataMemberBinding="{Binding CustomerPerson}" Width="*" />
                <telerik:GridViewDataColumn  Header="Product" DataMemberBinding="{Binding Product}" Width="*" />
                        </framework:RTPOGridView>

 

 

and the code which i wrote for it in View Model is as follows.

public void OnViewErrorsCommand(object sender, RoutedEventArgs e)
        {
            _dialogController.ShowDialog(_moduleController, ApplicationConstants.OrdersViewNames.ViewErrors);         
  
        }
Where "ViewErrors" is my new screen need to be opened on the click of the context menu.

kindly let me know the solution.

Thanks in advance !!!!!!!
George
Telerik team
 answered on 09 May 2011
1 answer
373 views
Hi,

I seem to have a small problem when data binding a RadGridView Control with a Data Table via a Boolean Converter. The scenario is as follows .... I have  a DataTable of which one of the columns is of type Boolean. I would like to convert the True value to YES and False to NO. When I bind the DataColumn of the grid via a Converter class, no value is displayed. However, when I click on the filter icon of the column I can filter by YES and NO. I have gone through the forums and documentation and applied the solutions to similar problems with no success.

Converter Class
    [ValueConversion(typeof(Boolean), typeof(String))]
   class IsWhiteAreaConverter : IValueConverter
   {
       public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
       {
           return (bool)value ? "Yes" : "No";
       }
 
       public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
       {
           if ((string)value == "Yes")
           {
               return true;
           }
           else
           {
               return false;
           }
       }
   }

XAML
  <Grid.Resources>
            <my:IsWhiteAreaConverter x:Key="isWhiteAreaConverter" />
        </Grid.Resources>
 
 
 
 <telerik:RadGridView Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Name="rgvPlan" ItemsSource="{Binding}" AutoGenerateColumns="False">

      <telerik:GridViewDataColumn Header="HalfLevel" DataMemberBinding="{Binding HalfLevelName}" />
<telerik:GridViewDataColumn Header="Is White Area" DataMemberBinding="{Binding IsWhiteArea, Converter={StaticResource isWhiteAreaConverter}}">
      <telerik:GridViewDataColumn.CellTemplate>
             <DataTemplate>
                      <TextBlock Text="{Binding IsWhiteArea, Converter={StaticResource isWhiteAreaConverter}, Mode=Default}" Foreground="AliceBlue" />
             </DataTemplate>
      </telerik:GridViewDataColumn.CellTemplate>
      <telerik:GridViewDataColumn.CellEditTemplate>
              <DataTemplate>
                     <TextBox Text="{Binding IsWhiteArea, Converter={StaticResource isWhiteAreaConverter}}" />
              </DataTemplate>
      </telerik:GridViewDataColumn.CellEditTemplate>
</telerik:GridViewDataColumn>
Ivan Ivanov
Telerik team
 answered on 09 May 2011
6 answers
294 views
When NumbricUpDown is on focus or button be clicked, the border colour will change to organe by default. Is there anyway I can turn the colour changing off?

Thanks

Jing
Jing
Top achievements
Rank 1
 answered on 09 May 2011
10 answers
201 views

Hi,

    We are using Prism, MVVM and rad docking.  I have two Panes (Pane1 and Pane2) as modules injected at application startup ... each Pane displays some client information.  In a seperate Pane I have a tree view listing all clients.  When a client is selected the information in the Panes (Pane1 and Pane2) are updated.  The Panes, Pane1 and Pane2, are bound to seperate view models.  The view models implement the IPropertyChangedNotification interface.  The information on the Pane1 and Pane2 are updated until you change panes (ie.  the UI is updated with the new client information on Pane1 ... and continues to be updated on Pane2 as you scroll through the list of clients but when you switch back to Pane1 the UI no longer updates ... similarly if you revisit Pane 2 ... the UI is no longer updating.)

Stepping through the debugger we noticed that in the FirePropertyChanged event below PropertyChanged was now null (it wasn't originally when the UI was being updated).  Am I doing something incorrectly here or is this a problem with the control.


 

 

 

    public class SelectedClientViewModel : PropertyChangedImplementation
    {
  
        public SelectedClientViewModel(IClientService clientService, IEventAggregator eventAggregator)
        {
            this._clientService = clientService;
  
            SelectedClientChangedEvent evt = eventAggregator.GetEvent<SelectedClientChangedEvent>();
            evt.Subscribe(OnSelectedClientChangedEvent);
        }
  
        public void OnSelectedClientChangedEvent(Client newClient)
        {
            _currentClient = newClient;
  
            FirePropertyChanged("name");
            FirePropertyChanged("address");
            FirePropertyChanged("city");
            FirePropertyChanged("country");
            FirePropertyChanged("telephone");
            FirePropertyChanged("province");
        }
  
...
  
  public class PropertyChangedImplementation : INotifyPropertyChanged
  {
    public event PropertyChangedEventHandler PropertyChanged;
  
    protected void FirePropertyChanged(string property)
    {
      if (PropertyChanged != null)
      {
        PropertyChanged(this, new PropertyChangedEventArgs(property));
      }
    }
  }

Thanks,
Randy

If you need additional info please let me know.

 

 

jagmohan
Top achievements
Rank 2
 answered on 08 May 2011
1 answer
151 views
I'm trying to store the values of the headers of dragged items into a generic list. It appears to be happening twice.

tvDirectoryDragStarted(object sender, RadTreeViewDragEndedEventArgs e)
{
     for(int i = 0;i<e.DraggedItems.Count;i++)
     {
            RadTreeViewItem item = (RadTreeViewItem)e.DraggedItems[i];
            _fileQueue.Items.Add(item.Header.ToString());
             
     }
 
}

_fileQueue is just a generic list I instantiate at runtime. The method is iterating through the dragged items twice though. I set a breakpoint and stepped through it, and it looks like the method is just firing twice. What could be the cause of this? I'm dragging the items into another RadTreeView, but I haven't wired any event handlers to it if that helps. 
Tina Stancheva
Telerik team
 answered on 06 May 2011
1 answer
190 views
I have implemented a custom appointment class that is always recurring weekly.
When you hit the delete key on an appointment, neither the AppoinmentDeleting nor the AppointmentDeleted events are fired.
Likewise, these events are not fired if click the "X" button to delete the appointment and you do not select "Delete series" option.

I look forward to hearing any advise on how to handle the appointment delete action.

Thank you.

Rebecca
Top achievements
Rank 1
 answered on 06 May 2011
2 answers
161 views
I am implementing a DragAndDropBehavior class and have overwritten the Resize function; however I cannot figure out how to Resize the appointment without passing the state to the MyBase.Resize() method.

I have tried the following to resize the appointment, and the start&end properties of the underlying objects (the appointment) change but visual GUI representation for the appointment does not.

How do I resize the appointment's GUI representation?

Public Overrides Sub Resize(ByVal state As Telerik.Windows.Controls.DragDropState)

        Dim draggedAppointment As myCustomAppointment = Nothing
        If state.Appointment.GetType Is GetType(Occurrence) Then
            draggedAppointment = DirectCast(state.Appointment, Occurrence).Appointment
        ElseIf state.Appointment.GetType Is GetType(Appointment) Then
            draggedAppointment = DirectCast(state.Appointment, myCustomAppointment)
        End If

        If draggedAppointment IsNot Nothing Then
            Dim startTS As New TimeSpan(state.DestinationSlots(0).Start.DayOfWeek, state.DestinationSlots(0).Start.Hour, state.DestinationSlots(0).Start.Minute, state.DestinationSlots(0).Start.Second)
            Dim endTS As New TimeSpan(state.DestinationSlots(0).[End].DayOfWeek, state.DestinationSlots(0).[End].Hour, state.DestinationSlots(0).[End].Minute, state.DestinationSlots(0).[End].Second)

            If startTS <> draggedAppointment.TimePeriod.StartTime Then
                draggedAppointment.Start = state.DestinationSlots(0).Start
                state.DestinationSlots(0).Start = draggedAppointment.Start
            End If

            If endTS <> draggedAppointment.TimePeriod.EndTime Then
                draggedAppointment.End = state.DestinationSlots(0).End
                state.DestinationSlots(0).End = draggedAppointment.End
            End If
        End If

       'MyBase.Resize(state)
End Sub


Thank you for your time.
Rebecca
Top achievements
Rank 1
 answered on 06 May 2011
1 answer
213 views
Hi,

We have a problem with getting the SelectedItem of the RadTreeView
when we right clicking it to show it's ContextMenu.

the solutions that are presented in the posts are both written in the code behind
and involve an explicit casting to a RadTreeView / RadTreeViewItem in order to
get the SelectedItem.

We are looking for a solution where there is no need to use this code in the code-behind:
http://www.telerik.com/community/forums/wpf/treeview/right-click-to-select-item.aspx
as in Syncfusion there is a property: IsSelectOnRightMouseClick that does that.

We are also looking into avoiding mentioning 3rd-party controls in our ViewModel,
in our Syncfusion mockup we are able to produce this handler:

       void OurTree_MouseRightButtonDown(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e)
        {
            SelectedItem = e.NewValue as OurSpecificObject;
        }

is it possible to do this with telerik?

thank you.
Tina Stancheva
Telerik team
 answered on 06 May 2011
3 answers
486 views
Hi

I need to bind the images in combobox at load . I using MVVM Pattern for my development.
 
Can anyone suggest me what should I do.

Regards
Yana
Telerik team
 answered on 06 May 2011
1 answer
91 views
hey guys,

not sure if this belongs on this forum OR the RadRibbon forum, but its the RichTextBox that i'm most interested in, basically the problem we have, is i have a list of 0 - N controls we call these ActivityControls, each Activity has a TWO RichTextBox controls,

So I have a Ribbon control to control my list of controls, with a Contextual Tab for the Text and Table Controls (taken from the telerik demo)

Is it possible for this singular set of controls to control potentially hundreds of RichText Controls?

If you have a demo of this functionality that'd be brilliant!

Cheers
Regards
Kevin.

Iva Toteva
Telerik team
 answered on 06 May 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
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?