Telerik Forums
UI for WPF Forum
1 answer
214 views
In WinForms there is (or was?) an attribute "[PasswordPropertyText(true)]" for displaying string properties as "*****" or something like that. How can I achieve this with WPF PropertyGrid?
Ivan Ivanov
Telerik team
 answered on 26 Aug 2013
1 answer
137 views
Hi, I have a RadPropertyGrid with a combination of predefined and auto-generated properties organized in groups. I'm trying to implement a feature that remembers expanded/collapsed state of each group.
There's no problem with saving those states, a simple foreach on GroupDefinitions collection with all the groups is sufficient when a view is closing. But I can't find an event to subscribe to on the RadPropertyGrid when the view is being generated and GroupDefinitions collection is not empty. I have tried Loaded, Grouped, IsVisibleChanged and many more but no luck so far. Only if I pause an application when the view is already showed I can verify, that GroupDefinitions collection is indeed not empty. Maybe there's something I've missed, so I would appreciate any help. Thanks!
Maya
Telerik team
 answered on 26 Aug 2013
5 answers
225 views
Hello,
Is there any reason why the dropdown would not have a Border?
Thanks in advance,
Steve
Masha
Telerik team
 answered on 26 Aug 2013
1 answer
78 views
Hi,

I need the following changes to be applied for my chart.

1. Display data item labels below the point marks in chart.
2. Need to remove green color for Data item labels in chart.
3. Display data item labels in vertical alignment as in desired chart(attachment).

Please find my attachments. I need to make my existing chart look-a-like desired chart.
I am using Q3 2011 version of telerik controls.


Regards,
Rakesh Kumar

Peshito
Telerik team
 answered on 26 Aug 2013
1 answer
93 views
Hello there,

is it possible to access a second SplitContainer in MVVM pattern in the ViewModel which is not the DocumentHost and add new Panes to it ? I have 2 Panes to search for Documents in a SplitContainer and want to re-add them to it in case that they have been closed by the user. The first SplitContainer contains the searchresults, which are editable, this is why that one is the DocumentHost. I can access the RadDocking in the ViewModel, which is passed to it as a CommandParameter. Thank you for your help!

Regards,
Achim
Vladi
Telerik team
 answered on 26 Aug 2013
1 answer
128 views
Hi,

I need to remove the point marks in attached radchart. Please find my attachment.Please let me know how can i achieve this.


Regards,
Rakesh Kumar
Peshito
Telerik team
 answered on 26 Aug 2013
1 answer
144 views
Hi,

I am executing sql queries that are returning over 100,000 rows.  The grid visualization handles these large results easily.  From what I can gather the rows visible on screen are in memory and the rest are in some kind of cache.  I am saving the results that I set in itemssource for future review where the client does not have access to the database. I want to provide a result viewer where the client can drill down on very large data sets using the excellent adhoc filtering capabilities of the grid   The major problem that I am having is the amount of time it takes to serialize and deserialize and sometimes getting out of memory.  Since the grids UI virtualization capabilities must have dealt with these issues in some form I was hoping that you could provide me with some ideas on how to handle the serialization problem.

The following shows the coding to get the data. clientData.Result is what needs to be serialized and deserialized.  As you can see this is generic code to handle any resultset.  

clientData.Result = new ObservableCollection<dynamic>()

while (dataReader.Read())
{
  Dictionary<string, object> clientRow = new Dictionary<string, object>();

         for (int i = 0; i < dataReader.FieldCount; i++)
         {
             string myKey = clientData.ColumnInfo[i].UniqueColumnName;
             object myValue = null;

             if (DBNull.Value != dataReader[i] && clientData.ColumnInfo[i].ProviderSpecificDataType != "Microsoft.SqlServer.Types.SqlHierarchyId")
             {
myValue = dataReader[i];
             }
             clientRow.Add(myKey, myValue);
         }
clientData.Result.Add(new CloudburstUtilities.ClientRow(ToDictionary(clientRow)));
}


public static IDictionary<string, object> ToDictionary(IDictionary<string, object> row)
{
            var dict = new Dictionary<string, object>();
            foreach (KeyValuePair<string, object> column in row)
            {
                dict.Add(column.Key, column.Value);
            }
            return dict;
 }

Thanks
Rich
Rossen Hristov
Telerik team
 answered on 26 Aug 2013
0 answers
158 views
Hi, I have:
1) Telerik 2013 Q2 SP1;
2) Entity Framework DB (Linq to MySql);
3) Simple table: FirstName(NotNull),  LastName(NotNull), Date(Null).
4) Checked for NULL (in MySQL DB and in my Project), i.e. both properties must be NotNull;
5) Made a row validation (it's working, but when I press ESC and then trying to edit another row => the TargetInvocationException fires or smth similar in files such as Cell....cs, Gridview.....cs - I even don't have it);
The question is how to prevent this?
Code:

private TestDB testDB;

public MainWindow()
{
InitializeComponent();
testDB = new testDBEntities();
radGridView.ItemsSource = testDB.Person;

}

private
void radGridView_AddingNewDataItem(object sender, GridViewAddingNewEventArgs e)
       {
           e.NewObject = new Person();
           testDB.Persons.Add((Person)e.NewObject);
       }
        
           private void radGridView_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
       {
           if (e.EditAction == GridViewEditAction.Cancel)  return;
           if (e.EditOperationType == GridViewEditOperationType.Edit)
           {
                   testDB.SaveChanges();
                   radGridView.Rebind();
           }
           else if (e.EditOperationType == GridViewEditOperationType.Insert)
           {
               testDB.SaveChanges();
               radGridView.Rebind();
           }
       }
Dan
Top achievements
Rank 1
 asked on 25 Aug 2013
1 answer
179 views

My MVVM app loads user defined polygons from a DB and then databinds the information layer (after the map is initialised, as suggested in the documentation).

When I explicitly declare the colours in the data template the binding works perfectly. But when I data bind the colours (using a converter to convert them to a SolidColorBrush) it doesn't display the shapes at all.

Here's the XAML...

<
telerik:RadMap x:Name="mapControl" Center="53.54245,-2.298817" ZoomLevel="7">
    <telerik:InformationLayer x:Name="shapeLayer" Visibility="Visible">
        <telerik:InformationLayer.ItemTemplate>
            <DataTemplate>
                <telerik:MapPolyline Fill="{Binding Fill, Converter={StaticResource converter}}" Opacity="0.5"  Points="{Binding Points}" Stroke="{Binding Stroke, Converter={StaticResource converter}}" StrokeThickness="2" />
            </DataTemplate>
        </telerik:InformationLayer.ItemTemplate>
    </telerik:InformationLayer>
</telerik:RadMap>

Here's the view model that I'm using for each shape.

    public class ShapeViewModel : ViewModelBase
    {
        private LocationCollection _points;
        private Color _stroke;
        private Color _fill;
 
        public LocationCollection Points
        {
            get { return _points; }
            set
            {
                if (_points != value)
                {
                    _points = value;
                    OnPropertyChanged(() => Points);
                }
            }
        }
 
        public Color Fill
        {
            get { return _fill; }
            set
            {
                if (_fill != value)
                {
                    _fill = value;
                    OnPropertyChanged(() => Fill);
                }
            }
        }
 
        public Color Stroke
        {
            get { return _stroke; }
            set
            {
                if (_stroke != value)
                {
                    _stroke = value;
                    OnPropertyChanged(() => Stroke);
                }
            }
        }
    }

I don't see any binding errors in my output window.

Thanks
Ben

ben crinion
Top achievements
Rank 1
 answered on 23 Aug 2013
3 answers
67 views
We have a requirement to display, along with other columns, a cumulative value column within the RadGridView.  To do this we attach a behavior to the RadGridView.  The relevant code from the behavior is this:

protected override void OnAttached()
       {
           AssociatedObject.DataLoaded += AssociatedObject_DataLoaded;
           AssociatedObject.RowEditEnded += AssociatedObject_RowEditEnded;
           base.OnAttached();
       }
 
       void AssociatedObject_RowEditEnded(object sender, GridViewRowEditEndedEventArgs e)
       {
           // This is the call to Rebind that causes the exception
           AssociatedObject.Rebind();
       }
 
       protected override void OnDetaching()
       {
           AssociatedObject.DataLoaded -= AssociatedObject_DataLoaded;
           AssociatedObject.RowEditEnded -= AssociatedObject_RowEditEnded;
           base.OnDetaching();
       }
 
       void AssociatedObject_DataLoaded(object sender, EventArgs e)
       {
           UpdateTotalLengths();
           UpdateComponentNumber();
       }
 
       private void UpdateComponentNumber()
       {
           Int32 index = 1;
           foreach (MyComponent component in AssociatedObject.Items.OfType<MyComponent>())
           {
               component.Number = index;
               index++;
           }
       }
 
       private void UpdateTotalLengths()
       {
           var totalLength = 0d;
           foreach (var component in AssociatedObject.Items.OfType<MyComponent>())
           {
               totalLength += component.Length;
               component.TotalLength = totalLength;
           }
       }

The basic idea of the above code is that on RowEndEdit and on DataLoaded the cumulativelength value is recalculated.

Everything works as expected when the user selects another row after editing a row (i.e. the cumulative length is updated).  However when the user clicks on anywhere else in the UI an ArgumentNullException is thrown (the message is 'Value cannot be null').  The Stack trace is:

at Telerik.Windows.Controls.ParentOfTypeExtensions.<GetParents>d__0.MoveNext() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Extensions\ParentOfTypeExtensions.cs:line 74
at System.Linq.Enumerable.<OfTypeIterator>d__aa`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Telerik.Windows.Controls.GridView.GridViewCell.HandlePendingEdit(UIElement focusedElement) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 1021
at Telerik.Windows.Controls.GridView.GridViewCell.HandlePendingEditOnLostFocus() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Cells\GridViewCell.cs:line 899
at Telerik.Windows.Controls.GridView.GridViewDataControl.HandleLostFocus(DependencyObject focusedDependencyObject) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Editing.cs:line 508
at Telerik.Windows.Controls.GridView.GridViewDataControl.HandleLostFocus() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Editing.cs:line 456
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnLostFocus(RoutedEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Editing.cs:line 450
at System.Windows.UIElement.IsFocused_Changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)
at System.Windows.DependencyObject.ClearValue(DependencyPropertyKey key)
at System.Windows.Input.FocusManager.OnFocusedElementChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at System.Windows.Input.FocusManager.SetFocusedElement(DependencyObject element, IInputElement value)
at System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(DependencyObject focusTarget)
at System.Windows.FrameworkElement.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
at System.Windows.Input.KeyboardFocusChangedEventArgs.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.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
at System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)
at System.Windows.Input.KeyboardDevice.Focus(IInputElement element)
at System.Windows.UIElement.Focus()
at System.Windows.Controls.ScrollViewer.OnMouseLeftButtonDown(MouseButtonEventArgs e)
at System.Windows.UIElement.OnMouseLeftButtonDownThunk(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.OnMouseDownThunk(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)

I have tracked this down to the call to Rebind() on the RowEditEnded.

Note we are trying to use Rebind here instead of just raising PropertyChanged event from component.TotalLength as we are not in control of that library.
Yoan
Telerik team
 answered on 23 Aug 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?