Telerik Forums
UI for WPF Forum
7 answers
428 views
Hello. I want scrolling my RadDiagram.
<ScrollViewer HorizontalScrollBarVisibility="Auto"  VerticalScrollBarVisibility="Auto">
         <telerik:RadDiagram IsZoomEnabled="False" AllowDrop="True" Name="radDiagram1"
                      SelectionChanged="radDiagram1_SelectionChanged" />
</ScrollViewer>

When I add some shape on diagram in runtime, scroll still not enable. Maybe I need do some refresh diagram? Help me, please.
Miro Miroslavov
Telerik team
 answered on 19 Jul 2012
2 answers
135 views
Hi all,
I need to know if the last version  of Telerik WPF supports .NET 3.5 SP1.

Thank you,
Emanuele
Emanuele
Top achievements
Rank 1
 answered on 19 Jul 2012
5 answers
172 views
Hi all,

I have a treeview as outlined below. Whenever an item is checked/unchecked, I 'do something' in the code-behind.

However, if the user checks the root, all items are checked /unchecked and I get an event for each. I just want to know when it's done so I can inspect the state of the relevant items.

I can't find a relevant event; even mouseDown doesn't seem to 'fire' in my case?! What could you recommend?

Thanks for any commments,

Anders, Denmark

        <Controls1:RadTreeView
            ItemsSource="{Binding Path=Children, NotifyOnSourceUpdated=True}"
            Name="treeview"
            IsLineEnabled="True"
            IsOptionElementsEnabled="True"
            ItemsOptionListType="CheckList"
            IsTriStateMode="True" Checked="treeview_Checked" Unchecked="treeview_Checked">
Pedro
Top achievements
Rank 1
 answered on 19 Jul 2012
2 answers
175 views
Hi,
I'm developing an application that users can drag and drop items on a  radmap and move them around. I wanted to use ClusteredDataSource for drill down ability, but i'm struggling on binding the location property of my custom class.

here is my custom object:
    public class ToolboxItem : ContentControl
    {
        public String IconPath { get; set; }

        public String Description { get; set; }

        public Location Location { get; set; }

    }

And my ObservableCollection :

    public class ItemsDataSource : ObservableCollection<ToolboxItem>
    {
        Random rnd = new Random();

        public ItemsDataSource()
        {
            this.GeoBoundsNW = new Location(39, -120);
            this.GeoBoundsSE = new Location(32, -113);
            CreatePointsInRect(100);
        }

        private LocationRect dataRectangle = new LocationRect();
        public LocationRect DataRectangle
        {
            get { return dataRectangle; }
            set
            {
                dataRectangle = value;
            }
        }

        private Location geoBoundsNW = Location.Empty;
        public Location GeoBoundsNW
        {
            get { return geoBoundsNW; }
            set
            {
                geoBoundsNW = value;
                UpdateGeoBounds();
            }
        }

        private Location geoBoundsSE = Location.Empty;
        public Location GeoBoundsSE
        {
            get { return geoBoundsSE; }
            set
            {
                geoBoundsSE = value;
                UpdateGeoBounds();
            }
        }

        private void UpdateGeoBounds()
        {
            if (!this.GeoBoundsNW.IsEmpty && !this.GeoBoundsSE.IsEmpty)
            {
                this.DataRectangle = new LocationRect(this.GeoBoundsNW, this.GeoBoundsSE);
            }
        }

        #region Test
        private void CreatePointsInRect(int count)
        {
            if (!this.dataRectangle.IsEmpty)
            {
                for (int i = 0; i < count; i++)
                {
                    ToolboxItem item = new ToolboxItem();
                    Location loc = new Location(
                        this.DataRectangle.North - this.DataRectangle.GeoSize.Height * rnd.NextDouble(),
                        this.DataRectangle.West + this.DataRectangle.GeoSize.Width * rnd.NextDouble());
                    item.Name = "item" + i;
                    item.Location = loc;
                    
                    this.Add(item);
                }
            }
        }
        #endregion

    }

and my clustered data source defiifnition in xaml file:

                    <local:ItemsDataSource x:Key="ItemsDataSource" />

                    <telerik:ClusteredDataSource x:Key="clusteredDataSource"
                                                 ClusterItemTemplate="{StaticResource ClusterTemplate}"
                                                 ItemTemplate="{StaticResource ClusteredItemTemplate}"
                                                 GenerateClustersOnZoom="True"
                                                 ItemsSource="{StaticResource ItemsDataSource}">

                    </telerik:ClusteredDataSource>

and of course my rad map control:

        <telerik:RadMap Name="radMap"
                        AllowDrop="True"
                        Grid.Column="2"
                        Grid.Row="1"
                        ZoomBarVisibility="Collapsed"
                        ZoomLevel="4"
                        Center="39,-120">
            <telerik:RadMap.Provider>
                <telerik:OpenStreetMapProvider />
            </telerik:RadMap.Provider>
            <telerik:InformationLayer x:Name="infLayer" AllowDrop="True"
                                      ClusteredDataSource="{StaticResource clusteredDataSource}">
            </telerik:InformationLayer>
        </telerik:RadMap>

and Clustered Item Template :
                    <DataTemplate x:Key="ClusteredItemTemplate">
                        <telerik:MapPinPoint telerik:MapLayer.Location= "{Binding Converter={StaticResource locConverter}}"
                                             MouseLeftButtonUp="ClusteredItemMouseClick"/>
                    </DataTemplate>

On data template i tried to bind Location property of my ToolboxItem but it was an unsuccessful attempt so then i provided an IValueConverter which is just below.

    public class LocationConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            var item = value as ClusteredItem;
            var toolboxItem = item.Data as ToolboxItem;

            return toolboxItem.Location;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }

    }


The problem is if i change type of the ObservableCollection to Location it works perfectly, but i need to provide additional information for the visual and also for the status of the item. So i have to use my ToolboxItem as a type on my ObservableCollection, but i couldn't bind the Location property from toolboxItem.

Does anybody have any idea how to do that.

Thanks,

Mehmet
Top achievements
Rank 1
 answered on 19 Jul 2012
3 answers
138 views
Hello,

I have a sparkline in a time bar, and I am looking to match the x values of the sparkline with the times of the timebar.  Currently, the first item in the sparkline is always shown at the start of the timebar, no matter if the times match or not.  Is there a way I can do this?

Thanks,
Eric
Rosko
Telerik team
 answered on 19 Jul 2012
9 answers
557 views
Whenever I type into a MaskedTextInput the words have a space.   Whenever the box loses focuses the spaces are truncated and the resultant combined single phrase is left in the box.  Once that box gains the focus again the phrase is broken out into its separate words again.  Is there a to prevent this from happening and have it not truncate the spaces whenever the boxes don't have focus?

Also, I can't seem to get the boxes character limit past 20 some odd characters.  Is there a way to increase that limit?

Thanks for any help.
Tina Stancheva
Telerik team
 answered on 19 Jul 2012
1 answer
187 views
Hello,

i created any GridViewComboBoxColumns on code behind with:


        private void MyGridView_AutoGeneratingColumn(object sender, Telerik.Windows.Controls.GridViewAutoGeneratingColumnEventArgs e)
        {
            DirInfoPropertyDescriptor propertyDecriptor = e.ItemPropertyInfo.Descriptor as DirInfoPropertyDescriptor;
            GridViewDataColumn datacolumn = e.Column as GridViewDataColumn;
            if (datacolumn != null)
            {
                IList<FieldDropDownItem> dropdownItems = DirInfo.FieldsDropdownItemsCache[propertyDecriptor.Name];
                if(dropdownItems.Count != 0)
                {
                    GridViewComboBoxColumn comboColumn = new GridViewComboBoxColumn();
                    comboColumn.Header = datacolumn.Header;
                    comboColumn.DataMemberBinding = datacolumn.DataMemberBinding;
                    comboColumn.SelectedValueMemberPath = "Id";
                    comboColumn.DisplayMemberPath = "Description";
                    comboColumn.SortMemberPath = "Description";
                    comboColumn.ItemsSource = dropdownItems;
                    (sender as RadGridView).Columns.Add(comboColumn);
                    e.Cancel = true;
                }                    
            }           
        }

It works nice: i can see and edit my dropdown values, but i cant sort.
After sorting my grid is empty, see screenshot

Kravetsker
Top achievements
Rank 1
 answered on 18 Jul 2012
7 answers
1.0K+ views
I am upgrading from Q3 2011 to Q2 2012 and ran into a problem with the numeric input.  I cannot enter a negative value into my textboxes.  It doesn't throw an error - it just ignores the negative sign.  I have tried the number pad and the regular keyboard and I have tried entering the negative first and entering it last.  Nothing seems to work.
See below for an example of one of the text boxes.  I checked the value in the validator and it is positive there so it isn't the validator changing the value.

<telerik:GridViewDataColumn DataMemberBinding="{Binding Units}" DataFormatString="{}{0:f2}" IsFilterable="False" Width="80"
                                            IsReadOnlyBinding="{Binding HideUnits}">
                    <telerik:GridViewDataColumn.Header>
                        <TextBlock Text="Units" TextWrapping="Wrap" />
                    </telerik:GridViewDataColumn.Header>
                    <telerik:GridViewDataColumn.CellEditTemplate>
                        <DataTemplate>                                                      
                            <telerikInput:RadMaskedNumericInput x:Name="txtUnits" Mask="#9.2"
                                                                SpinMode="None" IsClearButtonVisible="False" SelectionOnFocus="SelectAll"
                                                                KeyboardNavigation.TabNavigation="Local" TextMode="PlainText"                                                               
                                                                Validation.ErrorTemplate="{StaticResource TextBoxErrorTemplate}" 
                                                                 >
                                <telerikInput:RadMaskedNumericInput.Value>
                                    <Binding Path="Units" Mode="TwoWay" UpdateSourceTrigger="LostFocus">
                                        <Binding.ValidationRules>
                                            <imKASHelper:DoubleValidationRule Min="-100000000.00" Max="100000000.00" />
                                        </Binding.ValidationRules>
                                    </Binding>
                                </telerikInput:RadMaskedNumericInput.Value>
                            </telerikInput:RadMaskedNumericInput>
 
                        </DataTemplate>
                    </telerik:GridViewDataColumn.CellEditTemplate>
                </telerik:GridViewDataColumn>

Koren
Top achievements
Rank 1
 answered on 18 Jul 2012
2 answers
140 views
My boss just showed this to me, though it's been in the application for a while.  If a user double clicks on the divider between columns in the column header on this one RadGridView control in my app, the following exception is thrown:

2012-07-18 09:11:18,106 [1] FATAL CarSystem.App [(null)] -  Invalid value!
Parameter name: value
  
   at Telerik.Windows.Controls.GridViewLength..ctor(Double value, GridViewLengthUnitType type, Double desiredValue, Double displayValue)
   at Telerik.Windows.Controls.GridView.GridViewHeaderCell.OnColumnHeaderGripperDragCompleted(Object sender, DragCompletedEventArgs e)
   at System.Windows.Controls.Primitives.DragCompletedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.Thumb.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(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)

Here is the XAML for the RadGridView in question:

<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="HotListEntriesGrid_MouseDoubleClick"
                     Name="HotListEntriesGrid"
                     SelectionChanged="HotListEntriesGrid_SelectionChanged"
                     SelectionUnit="FullRow"
                     ScrollViewer.CanContentScroll="True"
                     ScrollViewer.HorizontalScrollBarVisibility="Auto"
                     ScrollViewer.VerticalScrollBarVisibility="Auto"
                     ToolTip="Matching Hot List Entries">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Plate,        Mode=OneWay}"
                                    Header="Plate"
                                    Width="1.5*" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding LocaleCode, Mode=OneWay}"
                                    Header="State"
                                    Width="75" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding ListName,   Mode=OneWay}"
                                    Header="Hot List"
                                    Width="150" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding AlarmClass, Mode=OneWay}"
                                    Header="Alarm Class"
                                    Width="175" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Notes,     Mode=OneWay}"
                                    Header="Notes"
                                    Width="1*" />
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

With some experimenting, I've found that the exception is thrown only if you click on those columns that contain "*" in their Widths.  if you set it to Auto or a fixed value, it doesn't happen.

Tony
Tony
Top achievements
Rank 1
 answered on 18 Jul 2012
1 answer
241 views
Hi,

I have a code similar to this:

        RadWindow.Confirm("Are you sure?", AddressOf OnClosed)
MessageBox ("Hi World")        

The alert or message always show it....regardless of response, in fact is an immediate action.

Is there a way that predefined windows you can wait for confirmation or selection by the user?

Something like Windows Desktop. NET:

If (message) = vbYes Then
MessageBox ("Hi World")     
End If

In advance, thank you all.
Vladi
Telerik team
 answered on 18 Jul 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
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?