//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);
}
<
telerik:RadRibbonTab
x:Class
=
"TAS2.RibbonMenuItems.CustomersTab"
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)
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()
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;
}
}
}