Telerik Forums
UI for WPF Forum
3 answers
247 views
Hello,

Can you please attach/supply a simple example of a RadGrid having RadComboBox, RadButton on its cells/rows? Thanks!
I badly need it. Thank you!

A
Pankaj
Top achievements
Rank 1
 answered on 01 Jan 2013
1 answer
193 views
HI, 

I have a simple RadGridView on which I want to change the color of the text in a specific row (= 3 cells). Unfortunately, this code doesn't work:

//add new row to the grid
EventLogGrid.Items.Add(new EventLogRow(eventType, occured, msg));
 
//change the color of the text of all cells if it's an exception
if (eventType == EventLogger.EventType.Exception)
{
   var rows = this.EventLogGrid.ChildrenOfType<GridViewRow>();
   rows.Last().Foreground = new SolidColorBrush(Colors.Yellow);
}

What is wrong?

Thanks in advance.
Nick
Telerik team
 answered on 01 Jan 2013
0 answers
79 views
Hi,
I want to apply an effect to a  Richtextbox I've used in my form. But Don't know how.
Please put a sample XAML here.
Thanks.
Tooraj
Top achievements
Rank 1
 asked on 01 Jan 2013
1 answer
123 views
Hi there,

I have a requirement where the GridView Column has multiple currencies and the aggregate needs to show the result separately for each currency. For example, consider the attachment where screenshots are shown from the Demos of GridView Totals. In the attached screenshot from the demos, dollar is the only currency and hence the sum works fine. But, can we display separate results for each type of currency when some rows have Currency "C1" and some have Currency "C2" etc.. ???


~ Harsha
Siva Harsha Vardhan
Top achievements
Rank 1
 answered on 31 Dec 2012
1 answer
124 views
Hi,

I'm creating a RadRibbonTab as a user control but I keep getting the following design time error in VS2010.


<telerik:RadRibbonTab x:Class="TAS2.RibbonMenuItems.CustomersTab"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             Header="Customers">
    <telerik:RadRibbonGroup Header="General">
        <telerik:RadRibbonButton x:Name="btnSaveSpec2" Text="Save" Size="Large" LargeImage="Icons/Spec-Editor-Menu/Save-Disk.png" >
        </telerik:RadRibbonButton>
    </telerik:RadRibbonGroup>
</telerik:RadRibbonTab>


System.InvalidOperationException

Layout measurement override of element 'Telerik.Windows.Controls.RibbonView.Primitives.RibbonGroupsPanel' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size.

at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at Telerik.Windows.Controls.RibbonView.Primitives.RibbonScrollViewer.MeasureOverride(Size availableSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\RibbonView\RibbonView\Primitives\RibbonScrollViewer.cs:line 117 at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Media.VisualBrush.DoLayout(UIElement element) at System.Windows.Media.VisualBrush.LayoutCallback(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)

Robert
Top achievements
Rank 1
 answered on 31 Dec 2012
1 answer
205 views
Hi
how to show the context menu anywhere the mouse location is
i tried to set the placement to MousePoint but it always opens in the left upper corner of the screen.

is this possible to do with RadContextMenu?

Thanks,
Akram
Rosen Vladimirov
Telerik team
 answered on 30 Dec 2012
0 answers
150 views
Hello

I'm creating a RadGridView with a RadDataPager in a WPF window. All seem to work correclty but when I try to add a new item to the grid (New row), the application crach and generate a cast exception that a can neither understand nor catche. My GridView is binded to the data collection and the Pager in linked to the GridView.

Here is the Exception message :

Unable to cast object of type 'App.BO.Entitys.Article' to type  'System.Data.Entity.DynamicProxies.Article_3C0917478FAD0B1FFBB724608BC9377A6E5813A3464003EFD3914700EBF2EA8C'

And here is the StackTrace : 

at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
at lambda_method(Closure )
at System.Linq.EnumerableExecutor`1.ExecuteBoxed()
at Telerik.Windows.Data.QueryableExtensions.Count(IQueryable source) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableExtensions.cs:ligne 409
at Telerik.Windows.Data.QueryableCollectionView.GetPagingDeterminativeItemCount() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Paging.cs:ligne 432
at Telerik.Windows.Data.QueryableCollectionView.get_PagingDeterminativeItemCount() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Paging.cs:ligne 419
at Telerik.Windows.Data.QueryableCollectionView.GetEffectiveItemCount() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Paging.cs:ligne 402
at Telerik.Windows.Data.QueryableCollectionView.UpdateItemCount() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Paging.cs:ligne 395
at Telerik.Windows.Data.QueryableCollectionView.AddItemToSourceList(Object newItem) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Editing.cs:ligne 485
at Telerik.Windows.Data.QueryableCollectionView.AddNewInternal(Object newItem) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Editing.cs:ligne 458
at Telerik.Windows.Data.QueryableCollectionView.AddNew(Object newItem) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Editing.cs:ligne 281
at Telerik.Windows.Data.QueryableCollectionView.AddNewItem(Object newItem) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.Editing.cs:ligne 261
at Telerik.Windows.Data.DataItemCollection.AddNew(Object newItem) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.Editing.cs:ligne 63
at Telerik.Windows.Controls.GridView.GridViewDataControl.CreateNewItem() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:ligne 5523
at Telerik.Windows.Controls.GridView.GridViewDataControl.ShowInsertRowIfNeeded() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:ligne 5455
at Telerik.Windows.Controls.GridView.GridViewDataControl.BeginInsert() dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:ligne 5077
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnBeginInsertCommand(Object sender, ExecutedRoutedEventArgs e) dans c:\TB\135\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Commands.cs:ligne 382
at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Controls.Button.OnClick()
at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
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.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
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.Input.InputManager.ProcessStagingArea()
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)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(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.Application.RunInternal(Window window)
at System.Windows.Application.Run()
at App.GUI.App.Main() dans d:\Work\Projects\Apps\Dev\App\App.GUI\obj\Debug\App.g.cs:ligne 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()


So, is there a way to resolve the problem.
Thanks
Bilel
Top achievements
Rank 1
 asked on 30 Dec 2012
4 answers
293 views
Hi,

I am new to this telerik controls. I want to align the expand arrow to the left corner of the bar. currently it is in the right corner. How can i acheive it.

Thanks,
Subash
Vijay
Top achievements
Rank 1
 answered on 30 Dec 2012
0 answers
201 views
When I create a table with LayoutMode = TableLayoutMode.Fixed, multiple columns and different size TableCells, the cells in the second row and onwards have incorrect widths.

When running the code below (see also the attached screenshot):
  • the widths of the cells in the first row are correct
  • the first cell in the second and third row are too wide
  • the second and fourth cell in the second and third row should be the same width, but they are not

Am I doing something wrong? Should I take some margin or border width into account when working with fixed with TableCells?

I'm using version 2012.3.1129.40

using System.Collections.Generic;
using System.Windows.Media;
using Telerik.Windows.Documents.Model;
 
namespace RadDocumentTableTest
{
    public partial class MainWindow
    {
        public MainWindow()
        {
            InitializeComponent();
 
            var document = new RadDocument();
            var section = new Section();
            section.Blocks.Add(new Paragraph());
 
            var table = new Table
            {
                LayoutMode = TableLayoutMode.Fixed,
                Style = document.StyleRepository["TableGrid"],
                PreferredWidth = new TableWidthUnit(618)
            };
 
            table.Rows.AddRange(CreateRows());
 
            section.Blocks.Add(table);
            document.Sections.Add(section);
 
            RichTextBox.Document = document;
        }
 
        private static TableCell CreateTableCell(int colSpan, double width, string text)
        {
            var cell = new TableCell
            {
                ColumnSpan = colSpan,
                PreferredWidth = new TableWidthUnit(TableWidthUnitType.Fixed, width),
            };
 
            var par = new Paragraph();
            var span = new Span
            {
                Text = text,
                FontFamily = new FontFamily("Calibri"),
                FontSize = 15
            };
 
            par.Inlines.Add(span);
            cell.Blocks.Add(par);
            return cell;
        }
 
        private static IEnumerable<TableRow> CreateRows()
        {
            var rows = new List<TableRow>();
 
            var row1 = new TableRow();
            row1.Cells.Add(CreateTableCell(1, 55, "r1c1:cs1:w55"));
            row1.Cells.Add(CreateTableCell(2, 125, "r1c2:cs2:w125"));
            row1.Cells.Add(CreateTableCell(1, 90, "r1c3:cs1:w90"));
            row1.Cells.Add(CreateTableCell(3, 348, "r1c4:cs3:w348"));
            rows.Add(row1);
 
            var row2 = new TableRow();
            row2.Cells.Add(CreateTableCell(2, 90, "r2c1:cs2:w90"));
            row2.Cells.Add(CreateTableCell(3, 219, "r2c2:cs3:w219"));
            row2.Cells.Add(CreateTableCell(1, 90, "r2c3:cs1:w90"));
            row2.Cells.Add(CreateTableCell(1, 219, "r2c4:cs1:w219"));
            rows.Add(row2);
 
            var row3 = new TableRow();
            row3.Cells.Add(CreateTableCell(2, 90, "r3c1:cs2:w90"));
            row3.Cells.Add(CreateTableCell(3, 219, "r3c2:cs3:w219"));
            row3.Cells.Add(CreateTableCell(1, 90, "r3c3:cs1:w90"));
            row3.Cells.Add(CreateTableCell(1, 219, "r3c4:cs1:w219"));
            rows.Add(row3);
 
            return rows;
        }
    }
}
Erik
Top achievements
Rank 1
 asked on 29 Dec 2012
1 answer
98 views
That title should read "Grouping fails for nullable columns when no data rows are present in the grid"

When the grid has data in it, all columns group and ungroup normally by dragging them to the group bar.
If the grid has no data rows, only a header is showing, then only non-nullable columns (DateTime in my case) can dragged to the group bar and all the others show a red circle with a line through it as you drag them over the bar.

Same is true for sorting. If you click on a nullable column with no data rows, sort indicator does not change. Non-nullable (DateTime) do.
Also, the nullable columns, when no data rows are present, have no filter icon. Non-nullable (DateTime) do.

Has anyone else noticed this? Is there any solution or is this a bug in the grid?

I code behind generate all the columns of the grid, and everything works perfectly if the grid has data rows. It could be the generation, but the code behind is fairly straightforward and again works fine with data.

I have attached a picture of the filter absence/presence. The types are easily identifiable.

Any input would be appreciated.
Matt
Top achievements
Rank 2
 answered on 29 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?