Telerik Forums
UI for WPF Forum
1 answer
551 views
Hi, I'm looking for a way to remove excess height in GridView rows. I need to display a lot of rows in as small a vertical space as possible, so ideally, I'd like to adjust the padding that seems to be present in the grid rows (or perhaps it's actually applied in the grid cells; I couldn't be sure when I ran Snoop over the GridView control). This image shows the areas I'd like to reduce, in red. I have attached styles to the GridViewCell and GridViewRow, and set the Margin and Padding to be 0, but to no avail. As I mentioned, I tried to use Snoop to determine which control was applying extra padding to the rows, but couldn't locate it. It seems like a default. I'd like to avoid explicitly setting a height for each row, but that doesn't seem to work anyway (setting the MinHeight and Height to something like 12 causes the row to be 12px high, but the content inside is cut off at the bottom, not vertically centred in the row. And setting VerticalContentAlignment on the row style doesn't work, either).

So, any help with this issue would be much appreciated.
Vanya Pavlova
Telerik team
 answered on 11 Jul 2011
1 answer
135 views
Dear all,
I have to implement a gridview with the following behaviour:
  • User enables a mode (new, update or delete)
  • and when he manipulates some data - let's say changes the contents of a cell - the new contents is displayed bold - to visualize the change.
  • So, after some changes he can press an "update" button and this works like a DB commit - all bold cells are saved and drawn with standard font weight again.
  • If he enters the original value before commit, the font weight should go back to normal.
  • If he presses a "cancel" button, all changed values should switch back to the original ones - and be shown with normal font weight.

Question is where to start?
I have seen the HistoryManager example, which deals with dirty data, this is a little bit more than I need.
There is also a nice example showing the CellStyleSelector using a UnitPriceConveter to change the cell style depending on its contents.

So my theortical approach is:
ItemSource class is an observable collection of IEditableObject items. Each editable item as an "oldvalue" field.
and this is somehow connected to the StyleSelector.

One of the missing parts is, when the user deletes a row, how should this be shown? I have seen other grids, that show a marker on the left side, indicating that this row will be deleted at next save/commit. How difficult is this to achieve?

Has someone done something similar?
Any help would be really appreciated.

Cheers,
Hermann

 
Ivan Ivanov
Telerik team
 answered on 11 Jul 2011
2 answers
235 views
Hello Telerik team,

First of all I would like to thank and congratulate your team for providing guidance with demos wherever required for almost all the queries that we raise.

I am aware that currently the WPF telerik grid allows creating a new row on a button click.

But I would like to know if it is possible to paste multiple new rows onto the WPF telerik rad grid that are being copied from an excel.

Also, is it possible to add a context menu to the row indicator column.



Thanks,
Regards,
Mausami
Mausami
Top achievements
Rank 1
 answered on 11 Jul 2011
3 answers
206 views

Hello All,

I have complained in the past about the RadWindow's inability to show consistantly (seen here), and even with Teleriks recomendations to invoke the window via Dispatcher.BeginInvoke(), the simple truth is the window just won't show if the host application is not the active window.  But that is another topic and not the focus of this thread.

Currently, I have a need to build a re-authentication function in my application that shows a RadWindow dialog to the user; requesting their credentials.  This re-authentication process fires 10 minutes before the user's logon token expires.  The issue I'm having is as follows:

  1. If the user does not have the window focused (let's say they are checking e-mail), the Re-authentication RadWindow does not show.  =(
  2. If the user is interacting with an other active RadWindow dialog (call it ActiveWindow1 for short), while the Re-authentication RadWindow is trying to display, it false behind the ActiveWindow1 and the user is unaware of the fact that thier logon is about to expire. 

My question is this:  Is there a way to test for the discover the top most RadWindow dialog before invoking my Re-authentication window?  This way I can either minimize it, hide it, or assign it as the Owner of the new dialog.  Short of creating my own custom RadWindow class that tracks every window via some private static collection; I don't see a way of accomplishing this beahavior.

- Rashad Rivera
  www.omegusprime.com

Miroslav Nedyalkov
Telerik team
 answered on 11 Jul 2011
11 answers
144 views

Hi, i have this serie of data :

 

 

liste.Add(new Score() { Level = "L1", Name = "AAA", Status = Status.Success});
liste.Add(new Score() { Level = "L1", Name = "AAA", Status = Status.Unknown});
liste.Add(new Score() { Level = "L1", Name = "AAA", Status = Status.Missed});
liste.Add(new Score() { Level = "L1", Name = "BBB", Status = Status.Success});
liste.Add(new Score() { Level = "L1", Name = "BBB", Status = Status.Unknown});
liste.Add(new Score() { Level = "L1", Name = "BBB", Status = Status.Missed});
liste.Add(new Score() { Level = "L2", Name = "CCC", Status = Status.Success});
liste.Add(new Score() { Level = "L2", Name = "AAA", Status = Status.Unknown);

and i need to provide a stacked bar 100 where the data are first grouped by level, then by name and the
stacked value is the weigth of the status.
So i should get a first bar for AAA with (33%, 33%, 33%) then an other bar with the same values for the L1 group
then a bar for AAA with 100%, and a bar for CCC with 100%
i think it s possible but i can t manage to do it !
And is it possible to display the first two groups with a legend owning only 3 values (Success, Missed, Unknown)
and having only 3 colours in the stacked elements ?

Attached file is a sample of what i want to get
Thx in advance

 

Cedric
Top achievements
Rank 1
 answered on 11 Jul 2011
3 answers
152 views
After updating RadControls for WPF Q1 2011, bugs occurred.
I want to know how can i fix this problem


Startup URI: C:\Users\Justin\Documents\Visual Studio 2010\Projects\WebClient\WebClient\bin\Debug\WebClient.xbap
Application Identity: file:///C:/Users/Justin/Documents/Visual%20Studio%202010/Projects/WebClient/WebClient/bin/Debug/WebClient.xbap#WebClient.xbap, Version=1.0.0.136, Culture=neutral, PublicKeyToken=f179182db26508cc, processorArchitecture=msil/WebClient.exe, Version=1.0.0.136, Culture=neutral, PublicKeyToken=f179182db26508cc, processorArchitecture=msil, type=win32
  
System.InvalidOperationException: 'System.Windows.Documents.Hyperlink' is not a Visual or Visual3D.
   at MS.Internal.Media.VisualTreeUtils.AsVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
   at MS.Internal.Media.VisualTreeUtils.AsNonNullVisual(DependencyObject element, Visual& visual, Visual3D& visual3D)
   at System.Windows.Media.Visual.IsAncestorOf(DependencyObject descendant)
   at Telerik.Windows.Controls.TabControl.RadTabControlBase`1.UpdateFocusOnSelectionChange() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 193
   at Telerik.Windows.Controls.TabControl.RadTabControlBase`1.HandleSelectionChanged(IList removedItems, IList addedItems) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 1025
   at Telerik.Windows.Controls.TabControl.RadTabControlBase`1.Selector_SelectionChanged(Object sender, SelectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 364
   at Telerik.Windows.Controls.RadOutlookBar.Selector_SelectionChanged(Object sender, SelectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\OutlookBar\RadOutlookBar.cs:line 1092
   at System.Windows.Controls.SelectionChangedEventArgs.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.Selector.OnSelectionChanged(SelectionChangedEventArgs e)
   at System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(List`1 unselectedItems, List`1 selectedItems)
   at System.Windows.Controls.Primitives.Selector.SelectionChanger.End()
   at System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(Object item, Boolean assumeInItemsCollection)
   at System.Windows.Controls.Primitives.Selector.OnSelectedIndexChanged(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 Telerik.Windows.Controls.TabControl.RadTabControlBase`1.<SetSelectedindexOnStartUp>b__e() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 964
   at Telerik.Windows.Controls.TabControl.RadTabControlBase`1.SetSelectedindexOnStartUp() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 974
   at Telerik.Windows.Controls.TabControl.RadTabControlBase`1.RadTabControl_Loaded(Object sender, RoutedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Navigation\TabControl\RadTabControlBase.cs:line 951
   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.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
   at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
   at MS.Internal.LoadedOrUnloadedOperation.DoWork()
   at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
   at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   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.StartDispatcherInBrowser(Object unused)
   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)
  
Petar Mladenov
Telerik team
 answered on 11 Jul 2011
3 answers
327 views
hello.
Can i use radcalendar for generate persian calendar?
Yasin
Top achievements
Rank 1
 answered on 10 Jul 2011
4 answers
77 views
Guys, I notice that the navigation menu for the pane is not working as intended if there are 2 panes with the same name. They will appear in the menu as separate item but clicking on all of them will just focus/activate the first pane. For example, you have panes with header "A", "B","C", "A". They appear correctly in the menu but the A's focus are linked only to the first pane. How do I go about this?
Twistur
Top achievements
Rank 1
 answered on 08 Jul 2011
1 answer
86 views
Hi,
my ItemSource contains an ObservableCollection of Players, (taken from the GridViewComboBoxColumn-ChangeDataContext.zip)
where Player has an extra property, a class named CombinedID. It is defined as
public partial class CombinedID
          : INotifyPropertyChanged
          , IEquatable<CombinedId>
          , IComparable<CombinedId>
          , IEqualityComparer<CombinedId>
{
    private int DbIdField;
    private Guid GuidField;
 
    public CombinedID(int i, Guid guid){
        DbId = i;
        Guid = guid;
    }
 
    public int DbId {
        get {   return this.DbIdField; }
        set {
            if ((this.DbIdField.Equals(value) != true)) {
                this.DbIdField = value;
                this.RaisePropertyChanged("DbId");
            }
        }
    }
 
    public System.Guid Guid {
        get { return this.GuidField; }
        set {
            if ((this.GuidField.Equals(value) != true)) {
                this.GuidField = value;
                this.RaisePropertyChanged("Guid");
            }
        }
    }
 
    public event PropertyChangedEventHandler PropertyChanged;
    protected void RaisePropertyChanged(string propertyName) {
        PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
        if ((propertyChanged != null)) {
            propertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    }
 
    public override string ToString() {
        return DbId.ToString();
    }
 
    public bool Equals(CombinedID other) { // for IEquitable<T>
        if (other == null) return false;
        return this.DbId == other.DbId;
    }
    public bool Equals(CombinedID a, CombinedID b) { // for IEqualityComparer<T>
        if(a != null && b != null)
            return a.DbId == b.DbId;
        if (a == null && b == null) return true;
        return false;
    }
     
    public int CompareTo(CombinedID other) { // for IComparable<T>
        if (other == null) return 1;
        return this.DbId.CompareTo(other.DbId);
    }
 
    public override int GetHashCode()   { // for IEquitable<T>
        return DbId.GetHashCode() ^ Guid.GetHashCode();
    }
 
    public int GetHashCode(CombinedID a)     { // for IEqualityComparer<T>
        return a.GetHashCode();
    }
}

So, Player has the following properties (excerpt):
  • public int SortID
  • public string Name
  • public CombinedID ID

Unfortunately, despite all the implemented interfaces, the DataGrid column containing this CombinedId refuses sorting. It just does nothing.
The XAML code for the extra column is
<telerik:GridViewDataColumn DataMemberBinding="{Binding ID}"/>
and I have tried SortMemberPath="DbId" and SortMemberPath="ID.DbId"
but nothing seems to work.
Can you please give me a hint why this column cannot be sorted?
hermann
Top achievements
Rank 1
 answered on 08 Jul 2011
2 answers
125 views
I'm trying to bind RadGridView SelectedItems property to a property on my ViewModel using the custom Behavior approach mentioned in the Vladimir Enchev's blog post and it works fine.
However, when gridview contains several thousands items and I try to select them all, the time necessary to select all items is tens of seconds, sometimes even minutes. This is not unacceptable by ours customers.
Can you help me solve this problem?

Thanks

David Renza

PS: I've prepared sample project to show this behavior but there is no way to post it.
David Renza
Top achievements
Rank 1
 answered on 08 Jul 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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?