Telerik Forums
UI for WPF Forum
6 answers
381 views
Hello,
I am using TreeviewList in my WPF appication using MVVM. I want to show all nodes in expanded mode but by default it shows me only parent node. Is there any way to show all nodes (in expanded mode) automatically?
Mark
Top achievements
Rank 1
 answered on 12 Sep 2011
2 answers
178 views
With the WPF Q2 2011 release, the autoscroll for dragging treeview items has stopped working.  I have verified that by modifying your TreeView Drag and Drop example for both Q1 and Q2 releases.  If you give the RadTreeView1 control a Height of 200 ( enabling it to have a scroll bar ) and then drag an item to the bottom of the tree view, it will autoscroll for Q1 release, but does not for the Q2 release.

Please advise.

Troy
Hristo
Telerik team
 answered on 12 Sep 2011
2 answers
435 views
I'm using WPF 4.0, v2011.2.712.40.

I have a grid with two columns that have hyperlink controls in the datatemplate so I can launch to another view within my application when a user clicks on the link.  Periodically the hyperlinks do not trigger the command it is bound to.  If I refresh the list that the grid is bound to then the item with the issue will start to work but sometimes other items stop working.  Here is the column definition.  As you can see from the commented parts of the datatemplate I have also tried using a button but have issues there as well.  If I let the button (or radbutton) look like a regular button without styling it everything seems to work better but if I put a style on it to make it look like a link button the memory usage of my app increases dramatically as the grid is scrolled.

<telerik:GridViewDataColumn Header="Account" DataMemberBinding="{Binding AccountName}" FooterCellStyle="{StaticResource GridNoLinesFooterStyle}">
  <telerik:GridViewDataColumn.CellTemplate>
    <DataTemplate>
      <!--<Button Content="{Binding AccountName}" Command="{Binding DataContext.OpenAccountCommand, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" 
              CommandParameter="{Binding}"/>-->
      <!--<telerik:RadButton Content="{Binding AccountName}" Command="{Binding DataContext.OpenAccountCommand, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" CommandParameter="{Binding}" 
                         Style="{StaticResource hyperlinkButtonStyle}" />-->
      <TextBlock>
          <Hyperlink Command="{Binding DataContext.OpenAccountCommand, RelativeSource={RelativeSource AncestorType={x:Type telerik:RadGridView}}}" CommandParameter="{Binding}"
              <TextBlock Text="{Binding AccountName}"></TextBlock>
          </Hyperlink>
      </TextBlock>
    </DataTemplate>
  </telerik:GridViewDataColumn.CellTemplate>
  <telerik:GridViewBoundColumnBase.AggregateFunctions>
    <telerik:CountFunction Caption="Count:" />
  </telerik:GridViewBoundColumnBase.AggregateFunctions>
</telerik:GridViewDataColumn>
Betsy
Top achievements
Rank 1
 answered on 12 Sep 2011
0 answers
138 views
Hi,
I am using context menu in my page. I have defined in following way.

<

 

telerik:RadTreeListView x:Name="rtlvPeopleInfo" >

 

 

 

<!--Context Menu-->

 

 

 

<telerik:RadContextMenu.ContextMenu>

 

 

 

<telerik:RadContextMenu x:Name="radPeopleContextMenu" Opened="radPeopleContextMenu_Opened" >

 

 

 

<telerik:RadMenuItem x:Name="rmiAssign_Engineer" Header="Assign Engineer"/>

 

 

 

</telerik:RadContextMenu>

 

 

 

</telerik:RadContextMenu.ContextMenu>

 

 

 

<telerik:RadTreeListView.Columns>

 

 

 

<telerik:GridViewDataColumn Header="Future Hrs" TextAlignment="Right"/>

 

 

 

<telerik:GridViewDataColumn Header="Previous Hrs" TextAlignment="Right"/>

 

 

 

</telerik:RadTreeListView.Columns>

 

 

 

</telerik:RadTreeListView>

Whenever I normally right click on any cell then it opens correctly and that is fine. But my requirement was if there is any unsaved data on page by cell edit, then when user right click on other cell it should show a message that "User changes will be lost, do u want to continue?". If yes then open the context menu as it is. So when there is any change on page then I show a messagebox with above confirmation message. Now if user selects "Yes" then the context menu opens on the top most left corner of the TreeListView, not on the cell right clicked. Please help me how I will open on same position the user mouse clicked, not the topmost left corner.

So the problem arises only when i open the messagebox confirmation.

 

Manishkumar
Top achievements
Rank 1
 asked on 12 Sep 2011
3 answers
164 views
Do you have an example for row visibility ( show/hide ) achieved by utilizing the filtering approach.

I have two buttons for the TreeListView that a user can click that will
- only show first two levels of tree
 - filter out on a column if cell has data.

Thanks

Jessica
Top achievements
Rank 1
 answered on 12 Sep 2011
8 answers
433 views
Hello,  I have a WPF application that utilizes the MVVM pattern.  On my view is a RadGridView defined as

<telerik:RadGridView Name="grdOrders" Grid.Row="1"
                                 AutoGenerateColumns="False"
                                 ItemsSource="{Binding LineItems}"
                                 SelectedItem="{Binding Path=SelectedLineItem}"
                                 IsSynchronizedWithCurrentItem="True"
                                 IsReadOnly="True"
                                 ClipboardCopyMode="Cells"
                                 RowStyleSelector="{StaticResource backorderStyleSelector}"
                                 ScrollViewer.HorizontalScrollBarVisibility="Auto"
                                 ScrollViewer.VerticalScrollBarVisibility="Auto" MouseDoubleClick="grdOrders_MouseDoubleClick" SelectionMode="Extended">
                                 <i:Interaction.Behaviors>
                    <b:MultiSelectBehavior SelectedItems="{Binding Path=SelectedLineItems}" />
                </i:Interaction.Behaviors>
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=GPPONumber}" Header="GP PO Number" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=LineItemId}" Header="Line Item Id" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Quantity}" Header="Quantity" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=PartNumber}" Header="Part Number" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Description}" Header="Description" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=WarehouseCode}" Header="Warehouse" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=WarehouseBin}" Header="Bin Location" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=ShippingMethod}" Header="Shipping Method" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=VendorName}" Header="Vendor Name" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Salesrep}" Header="Sales Rep" />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=SourcedBy}" Header="Sourced By" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Path=Backordered}" Header="B/O?" />
                </telerik:RadGridView.Columns>
                </telerik:RadGridView>

Corresponding in my ViewModel I have a property

public ObservableCollection<WarehouseLineItemProxy> LineItems
    {
      get
      {
        return lineItems;
      }
      set
      {
        lineItems = value;
        RaisePropertyChanged(() => LineItems);
        ViewOrderInfoCommand.RaiseCanExecuteChanged();
      }
    }

On the View Model is a timer that refreshes the data every 60 seconds

refreshTimer = new DispatcherTimer();
refreshTimer.Interval = TimeSpan.FromSeconds(60);
refreshTimer.Tick += new EventHandler(refreshTimer_Tick);

The tick event and refresh method

/// <summary>
    /// Handles the Tick event of the refreshTimer control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    private void refreshTimer_Tick(object sender, EventArgs e)
    {
      refreshTimer.Stop();
      RefreshLineItems(new object());
      refreshTimer.Start();
    }
 
/// <summary>
    /// Refreshes the line items.
    /// </summary>
    /// <param name="arg">The arg.</param>
    private void RefreshLineItems(object arg)
    {
      if (!worker.IsBusy)
      {
        ShowBusyIndicator = true;
        worker.RunWorkerAsync();
        refreshTimer.Stop();
        refreshTimer.Start();
      }
    }

worker is a BackgroundWorker that allows me to load data asynchronously

/// <summary>
    /// Handles the DoWork event of the worker control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.ComponentModel.DoWorkEventArgs"/> instance containing the event data.</param>
    private void worker_DoWork(object sender, DoWorkEventArgs e)
    {
      e.Result = adapter.LoadWarehouseOrders();
    }
 
/// <summary>
    /// Handles the RunWorkerCompleted event of the worker control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.ComponentModel.RunWorkerCompletedEventArgs"/> instance containing the event data.</param>
    private void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
    {
      Dispatcher.CurrentDispatcher.BeginInvoke(new Action<ObservableCollection<WarehouseLineItemProxy>>(this.UpdateGridData), e.Result);
    }   
 
/// <summary>
    /// Updates the grid data.
    /// </summary>
    /// <param name="lineItems">The line items.</param>
    private void UpdateGridData(ObservableCollection<WarehouseLineItemProxy> lineItems)
    {
      LineItems = lineItems;
      ShowBusyIndicator = false;
    }

Occasionally in Production users will get a NullReferenceException at some point when the grid is trying to re-draw.  Here is the stack trace.

at Telerik.Windows.Controls.GridView.Automation.GridViewCellAutomationPeer.GetNameCore() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Automation\GridViewCellAutomationPeer.cs:line 146
   at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   at System.Windows.Automation.Peers.AutomationPeer.UpdatePeer(Object arg)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at PartsFinder.Chimera.App.Main() in d:\TeamCityWork\PARTSFinderSlnProd\Chimera\PartsFinder.Chimera\obj\x86\Prod-Warehouse\App.g.cs:line 50

This exception doesn't happen every time, in fact it is very random.  But the users get annoyed when it happens several times during the day.  Does anyone have any ideas?

Thanks
Ivan Ivanov
Telerik team
 answered on 12 Sep 2011
1 answer
173 views
Hi Telerik,
I want to capture the "close" event when the custom scheduler dialog box is closed below (i.e. clicking on the X button), how can I do so?

Thanks, Cheau




        <ControlTemplate x:Key="EditAppointmentTemplate" TargetType="{x:Type telerik:SchedulerDialog}">           

            <Grid VerticalAlignment="Center" Margin="10">

                <Grid.ColumnDefinitions>

                    <ColumnDefinition Width="150"/>

                    <ColumnDefinition/>

                </Grid.ColumnDefinitions>

                <Label Grid.Column="0" Content="Number of Tap Activity" Height="25"/>

                <telerik:RadNumericUpDown Grid.Column="1"  Height="25" Width="50" NumberDecimalDigits="0" ValueFormat="Numeric" HorizontalAlignment="Left"

                                          Value="{Binding Occurrence.Appointment.TapActivityNum, Mode=TwoWay}" />

            </Grid>

        </ControlTemplate>

 

        <Style x:Key="EditAppointmentStyle" TargetType="telerik:SchedulerDialog">

            <Setter Property="Width" Value="250" />

            <Setter Property="Height" Value="100" />

            <Setter Property="IsTabStop" Value="False" />

            <Setter Property="SnapsToDevicePixels" Value="True" />

            <Setter Property="Template" Value="{StaticResource EditAppointmentTemplate}" />

            <Setter Property="HeaderTemplate">

                <Setter.Value>

                    <DataTemplate>

                        <StackPanel Orientation="Horizontal">

                            <TextBlock Text="Number of Tap Activity" />

                        </StackPanel>

                    </DataTemplate>

                </Setter.Value>

            </Setter>

        </Style>


Rosi
Telerik team
 answered on 12 Sep 2011
1 answer
119 views
Hello Telerik Team,

Is it possible to keep the floating panes open (i.e. as is) on the screen when the main window that hosts these panes is minimized?
Currently it minimizes all floating panes. Please let me know.

Regards,
Kumar
Miroslav Nedyalkov
Telerik team
 answered on 12 Sep 2011
6 answers
161 views
Hello,

I am experiencing some annoying effects with the Radchart (however, I don't know if these effects are normal or not).

My user control contains a total of 5 Radcharts, each of them having between 1 and 3 linear series (the total number is 10 series). I am  using a SampleThreshold = 400. For those charts with more than one series I am using a "nested collections" binding schema (as explained in the online documentation).

Each serie has exactly 2880 points that correspond to one point every 30 seconds for an entire day. I make an async call to an WCF service that returns the data for the series. 

The problem is that the charts render in a pretty annoying way. First only some X axis labels are shown, then the series appear but only a piece of them and with an offset respect to their X axis correct position... and so on until the chart is correctly displayed. I am not showing any label or pointmark aside from the X axis and Y axis labels, and animations are disabled. 

I'd like to know if there is any way to prevent the chart to be "pre-painted" in the screen, so that it would only be shown as it is correctly composed. Is there something like a "loading data screen" or similar? 

I am using April 2011 release. 

Thank you in advance, 

Pablo.
Peshito
Telerik team
 answered on 12 Sep 2011
3 answers
148 views
Hello,

Due to the particular needs of our project, we want the user to be able to zoom over the chart's X Axis but without showing any scrollbar. We would do it using the MouseLeftButtonDown and Up belonging to the plot area, calculating the data points and setting a new RangeEnd and RangeStart for the ZoomSettings object. 

However, right now it is only possible to set ZoomSettings to None, Scroll or ScrollAndZoom. Is there any workaround so that zoom can be made (as described above) but hidding the ScrollBar? If so, could you please provide any code sample?

Thank you very much, 

Pablo.

Pablo
Top achievements
Rank 1
 answered on 12 Sep 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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?