Telerik Forums
UI for WPF Forum
1 answer
145 views
Hello,

I'm experiencing an issue with using the mouse selection zooming (where you select a rectangle to zoom in on).  After a few successful zooms, an error is thrown (ArgumentException: Width and Height must be non-negative.) when trying to zoom in to fine detail.  I assume this has something to do with rendering the pan/zoom bar, but I'm not certain.

I can catch the previewMouseUp event, but I'm not sure how to correctly check/handle this issue.

Any help/guidance would be appreciated.

Also, the interesting bit of the stacktrace from the exception:

at System.Windows.Size..ctor(Double width, Double height)
   at Telerik.Windows.Controls.ChartView.ChartPanAndZoomBehavior.UpdatePanAndZoom(Double startX, Double endX, Double startY, Double endY) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartPanAndZoomBehavior.Branch.cs:line 278
   at Telerik.Windows.Controls.ChartView.ChartPanAndZoomBehavior.AdornerLayerMouseLeftButtonUp(Object sender, MouseButtonEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Behaviors\ChartPanAndZoomBehavior.Branch.cs:line 252
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
Paul
Top achievements
Rank 1
 answered on 18 Jun 2012
1 answer
190 views
I am writing this lines of code 

  <telerik:RadComboBox Height="28" Margin="0,112.051,12,0" Grid.Row="1" VerticalAlignment="Top">
      <telerik:RadComboBox.SelectionBoxTemplate>
       <DataTemplate>
        <TextBlock Text="{Binding}" Foreground="Red"/>   
    </DataTemplate>   
   </telerik:RadComboBox.SelectionBoxTemplate>
      <telerik:RadComboBoxItem Content="Item 1"/>
      <telerik:RadComboBoxItem Content="Item 2"/>
      <telerik:RadComboBoxItem Content="Item 3"/>
     </telerik:RadComboBox>
But this is not working. Please tell me what i am doing worng ?
Thank you.
Vladi
Telerik team
 answered on 18 Jun 2012
8 answers
194 views
Hi,

i'm using two RadGridViews with one MVVM (ObservableCollection<foptxt>()). With Drag and Drop i moove the items from GridA to GridB.

How do i add a DropHandler for the dropped items? I just found an example for a Listbox, but i can't change this to run with a GridView.

Thanks
Best Regards
Rene
Dimitrina
Telerik team
 answered on 18 Jun 2012
4 answers
123 views
Hi there,

We need to support some customised formats for user to type in the input box. e.g. if I type a "+5" in the input box today (03/03/2010), it needs to be converted to 08/03/2010  (the 5th day from today's date).

We've tried to bind a converter to the datepicker, but it's too late as the input has already been updated by the default parsing logic. And the fact that having inputText as a private member is not helping either.

So, Is there a way to change/extend the datepicker's default inputbox text parsing mechanism? Thanks in advance.




Cheers,






Doots
Top achievements
Rank 1
 answered on 18 Jun 2012
1 answer
69 views
Hello support
i have problem to run telerik sample , i have send screen shot and zip file of the sample
i want to send the "DragAndDrop" smple how i do this?
please advice 
best  regards shimon
Dimitrina
Telerik team
 answered on 18 Jun 2012
1 answer
268 views
Hello All,

RadComboBox has a property called "EmptyText" which displays when the combo box has not been set (meaning SelectedIndex = -1).  Is there similar functionality in the RadGridView that is *already baked in*?  When a user changes the filter and the grid has not rows to display, I want to display a message in the body of the grid like "No rows to display". 

- Rashad Rivera
Vlad
Telerik team
 answered on 18 Jun 2012
2 answers
173 views
Hi,

Please could you inform me why I cannot set an ItemContainerStyle for a RadBreadcrumbItem. I thought that I may be able to use a style to set a default image, with the following XAML...

<telerik:RadBreadcrumb.ItemContainerStyle>
                <Style TargetType="{x:Type telerik:RadBreadcrumbItem}">
                    <Setter Property="Image" Value="{StaticResource Folder16}"/>
                </Style>
            </telerik:RadBreadcrumb.ItemContainerStyle>

However, I get the following error at runtime....

{"'RadBreadcrumbItem' type must derive from FrameworkElement or FrameworkContentElement."}

Thanks
reg
Top achievements
Rank 1
 answered on 17 Jun 2012
2 answers
190 views
Hi,

After upgrading to RadControls for WPF 2012.2.607, the Demos app crashes on launch with the following error:

"WPF Demos has stopped working".

We are running Windows 7 64 bit.

Problem signature:
  Problem Event Name: CLR20r3
  Problem Signature 01: wpf demos.exe
  Problem Signature 02: 1.0.0.0
  Problem Signature 03: 4fd0cd4f
  Problem Signature 04: mscorlib
  Problem Signature 05: 4.0.0.0
  Problem Signature 06: 4ee9af8e
  Problem Signature 07: 3fda
  Problem Signature 08: 13c
  Problem Signature 09: System.UnauthorizedAccess
  OS Version: 6.1.7601.2.1.0.256.48
  Locale ID: 3081
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Legoless
Top achievements
Rank 1
 answered on 16 Jun 2012
0 answers
209 views
I have a form with a couple of RadGridView controls on it.  The form in question is a UserControl, embedded in a TabItem in a TabControl on the MainWindow.  There is another UserConrol on another TabItem in the same TabControl, which is used to display details of the selected item in one of the RadGridView controls, and other that is used to display the details of the selected item in the other RadGridView.

Here is the Xaml for one of the RadGridView controls:
<telerik:RadGridView AutoExpandGroups="True"
                     AutoGenerateColumns="False"
                     CanUserDeleteRows="False"
                     CanUserFreezeColumns="False"
                     CanUserInsertRows="False"
                     CanUserResizeColumns="True"
                     CanUserSortColumns="True"
                     EnableColumnVirtualization="True"
                     EnableRowVirtualization="True"
                     FontSize="16"
                     FontWeight="Bold"
                     IsReadOnly="True"
                     MouseDoubleClick="ReadsGrid_MouseDoubleClick"
                     Name="ReadsGrid"
                     RowStyleSelector="{StaticResource StyleSelector}"
                     SelectionChanged="ReadsGrid_SelectionChanged"
                     SelectionUnit="FullRow"
                     ScrollViewer.CanContentScroll="True"
                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     ShowGroupFooters="True"
                     ToolTip="Matching Reads">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Plate,       Mode=OneWay}"
                                    Header="Plate"
                                    Width="*" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding State,       Mode=OneWay}"
                                    Header="State"
                                    Width="75" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding TimeStamp,  Mode=OneWay, Converter={StaticResource DateConverter}}"
                                    Header="Date & Time"
                                    Width="175" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding GPSInformation.Position.Latitude, Converter={StaticResource CoordConverter}, ConverterParameter=NS}"
                                    Header="Latitude"
                                    Width="142" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding GPSInformation.Position.Longitude, Converter={StaticResource CoordConverter}, ConverterParameter=EW}"
                                    Header="Longitude"
                                    Width="142" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

From the code-behind, here is the code for the SelectionChanged event handler and for the MouseDoubleClick event handler:
private void ReadsGrid_MouseDoubleClick( object sender, MouseButtonEventArgs e ) {
    if ( OkToSwitchToRecordDetails ) {
        TabItem searchTabItem = (TabItem) Parent;
        TabControl tabControl = (TabControl) searchTabItem.Parent;
        TabItem recordDetailsTabItem = FindTab( typeof( EditRecordDetails ) );
        recordDetailsTabItem.IsSelected = true;
    }
    e.Handled = true;
}
private void ReadsGrid_SelectionChanged( object sender, SelectionChangeEventArgs e ) {
    ReadViewModel read = (ReadViewModel) ReadsGrid.SelectedItem;
    ReadsGrid.ScrollIndexIntoView( ReadsGrid.Items.IndexOf( read ) );
    HavePrevRecord = ReadsGrid.Items.IndexOf( read ) > 0;
    HaveNextRecord = ReadsGrid.Items.IndexOf( read ) < ( Reads.Count - 1 );
    RecordDetailsControl.DisplayRead( read );
    e.Handled = true;
}

Everything works, but there's something very odd going on.  When you double click on the row, the RadGridView seems to scroll.  In fact, it scrolls far enough to bring the row you just double clicked on off the screen. Note that the call to ScrollIndexIntoView has no effect:  I added that to try to bring the row back into view and it's doing nothing.

In the UserControl in the other tab, there are two buttons named "PrevButton" and "NextButton".  Here is the code for their Click event handlers:
private void NextButton_Click( object sender, RoutedEventArgs e ) {
    try {
        SearchControl.NextRecord( LastRecord );
    } catch ( ObjectNotFoundException ex ) {
        string msg = MessageGenerator.ExceptionMessage( "Error getting next record: ", ex );
        Log.Error( msg );
        CarSystemMessageBox.Show( msg, "Error Getting Next Record" );
    }
    // Mark event handled
    e.Handled = true;
}
private void PrevButton_Click( object sender, RoutedEventArgs e ) {
    try {
        SearchControl.PrevRecord( LastRecord );
    } catch ( ObjectNotFoundException ex ) {
        string msg = MessageGenerator.ExceptionMessage( "Error getting next record: ", ex );
        Log.Error( msg );
        CarSystemMessageBox.Show( msg, "Error Getting Next Record" );
    }
    // Mark event handled
    e.Handled = true;
}

And here's the NextRecord and PrevRecord methods in the SearchControl:

public void NextRecord( ReadViewModel read ) {
    // Figure out the index of the last object in the ReadsGrid RadGridView's Items collection
    int lastObj = ReadsGrid.Items.Count - 1;
    // Get the index of this object in the ReadsGrid's Items collection.
    int idxRead = ReadsGrid.Items.IndexOf( read );
    // The next record is the next one in the ReadsGrid's Items collection, if there is one.
    if ( idxRead < lastObj ) {
        // Set HaveNextRecord and HavePrevRecord
        HavePrevRecord = true;
        HaveNextRecord = idxRead < lastObj;
        // Select the next record.
        read = ReadsGrid.Items[ idxRead + 1 ] as ReadViewModel;
    } else {
        // There isn't a next record.  Set HaveNextRecord and HavePrevRecord
        HaveNextRecord = false;
        HavePrevRecord = idxRead > 0;
    }
    // Select the Read & scroll it into view
    ReadsGrid.SelectedItem = read;
    ReadsGrid.ScrollIntoView( read );
}
public void PrevRecord( ReadViewModel read ) {
    // Declare some variables we will need to use
    int idxRead  = -1;
    // Get the index of this object in the ReportRows array.
    idxRead = ReadsGrid.Items.IndexOf( read );
    // The previous record is the previous one in the ReadsGrid's Items collection, if there is one.
    if ( idxRead > 0 ) {
        // Set HaveNextRecord and HavePrevRecord
        HaveNextRecord = true;
        HavePrevRecord = idxRead > 0;
        // Select the next record.
        read = ReadsGrid.Items[ idxRead - 1 ] as ReadViewModel;
    } else {
        // There isn't a previous record.  Set HavePrevRecord to false and HaveNextRecord
        HavePrevRecord = false;
        HaveNextRecord = idxRead < ( ReadsGrid.Items.Count - 1 );
    }
      
    // Select the Read & scroll it into view
    ReadsGrid.SelectedItem = read;
    ReadsGrid.ScrollIntoView( read );
}

Again, everything works, but the ScrollIntoView doesn't work.  I've always had that call there, in case you kept clicking one of the buttons and eventually selected a row that wasn't in view.

All rows are the same height, and turning RowVirtualization off has no effect.  The rows are still off the screen when I come back to the tab with the RadGridViews.

Is this a bug? Is there some property I have turned on that's breaking it?

Tony

P.S.  I am using version 2012.1.326.40
Tony
Top achievements
Rank 1
 asked on 15 Jun 2012
4 answers
195 views
I'm evaluating RadGridView (WPF) with an OData service. Version 2012.2.607.40
Seeing some very strange behavior with a simple application.

My service schema exposes:

ResourceSetA (1 item)
ResourceSetB (3 items)
ResourceSetC (6713 items)

I'm monitoring calls to the service with Fiddler2.

I have a simple test app with a RadGridView in a Window by itself, its ItemsSource bound to a DataServiceQuery<T> property from my service client proxy.

When T=ResourceA, the service calls are essentially:

/Service.svc/ResourceSetA()/$count
/Service.svc/ResourceSetA()?$skip=0&$top=1

and the grid displays the single item correctly.

When T=ResourceB, the service calls are:

/Service.svc/ResourceSetB()/$count
/Service.svc/ResourceSetB()?$skip=0&$top=3

and the grid displays three items correctly.

When T=ResourceC, I only see a single call, which appears to return the correct count according to Fiddler (6713):

/Service.svc/ResourceSetC()/$count

but my client application hangs and makes no further OData calls. Watching the process in Task Manager, it eats memory steadily and eventually falls over with an OutOfMemoryException.

My app is really the simplest example I can craft, and my service is responding correctly when I issue calls to it directly from a browser.
What could I be doing wrong here? 
Wayne
Top achievements
Rank 1
 answered on 15 Jun 2012
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
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?