Telerik Forums
UI for WPF Forum
2 answers
186 views
I had a grid view which contains a template column and other columns are autogenerated. I found that "AddingNewDataItem" event is fired when i press insert when the grid view is focused. but it gives me an exception that

Exception has been thrown by the target of an invocation.

System.Reflection.TargetInvocationException was unhandled
  Message="Exception has been thrown by the target of an invocation."
  Source="mscorlib"
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, 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)
       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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       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.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at Cerebrata.CloudStorage.UI.WPF.App.Main() in D:\Projects\CerebrataCloudStorage\UI.WPF\obj\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.NullReferenceException
       Message="Object reference not set to an instance of an object."
       Source="Telerik.Windows.Controls.GridView"
       StackTrace:
            at Telerik.Windows.Controls.GridView.GridViewCell.ShowEditor() in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 488
            at Telerik.Windows.Controls.GridView.GridViewCell.<ToggleEditor>b__0() in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 593
            at Telerik.Windows.Controls.GridView.GridViewCell.ModifyCellTemplate(Action executeAction) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 461
            at Telerik.Windows.Controls.GridView.GridViewCell.ToggleEditor() in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 593
            at Telerik.Windows.Controls.GridView.EditContext.OnCellEditModeChanged(GridViewCell cell, Boolean newIsInEditMode) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Editing\EditContext.cs:line 231
            at Telerik.Windows.Controls.GridView.GridViewCell.IsInEditModeChanged(DependencyObject target, DependencyPropertyChangedEventArgs e) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 586
            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, OperationType operationType)
            at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
            at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
            at Telerik.Windows.Controls.GridView.GridViewCell.set_IsInEditMode(Boolean value) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 214
            at Telerik.Windows.Controls.GridView.EditContext.SwitchCellToEditMode(GridViewCell cell) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Editing\EditContext.cs:line 243
            at Telerik.Windows.Controls.GridView.EditContext.BeginEdit(GridViewCell gridViewCell) in c:\Builds\WPF_Scrum\X1_Q1_2009\Sources\Development\WPF\GridView\GridView\Editing\EditContext.cs:line 259
       InnerException:


Nedyalko Nikolov
Telerik team
 answered on 22 May 2009
1 answer
79 views
Hi all;

First, I need to preface this by saying I'm a newbie when it comes to the WPF world.  But I'm having some trouble with the design time experience for WPF grid view.  Can anybody summarize how I can set up a design time experience that lets me work with the data I'll be using at runtime, so that I don't wind up with XML parser errors on the design surface, rather than a representation of my grid?

For example, if I set up a grid similar to the following:
    <Grid> 
        <telerik:RadGridView Margin="0" Name="radGridView1" AutoGenerateColumns="False"
            <telerik:RadGridView.Columns> 
                <telerik:GridViewColumn UniqueName="salesperson_name" IsVisible="False"/> 
            </telerik:RadGridView.Columns> 
            <telerik:RadGridView.GroupDescriptions> 
                <telerik:RadGroupDescription PropertyName="salesperson_name" SortDirection="Ascending"/> 
            </telerik:RadGridView.GroupDescriptions> 
        </telerik:RadGridView> 
    </Grid> 

I wind up with an Unhandled Exception on the design surface.

Thanks,
Jason


Hristo Deshev
Telerik team
 answered on 21 May 2009
3 answers
383 views
Hello. 

I'm back with more questions and problems.

  1. When inserting new row into master grid (master/child scenario), new row is out of alignment with other rows. This is clearly a bug?
  2. When cell in grid has focus, routed commands (trigerred through button in a toolbar) get selected GridViewCell as ExecutedRoutedEventArgs.OriginalSource. When only row has focus (row is selected but no cell has focus) nothing (button itself) is returned as OriginalSource. Shouldn't selected GridViewRow be passed in OriginalSource?
  3. 4. After adding new record to child grid (in a way explained here here), that new row is immediately removed. I add record to database (LINQ) in RowEditEnded, so after restarting an application record does show. The cause seems to be RadGrid not inserting data into underlying LINQ container. This does not happen in master grid. Child grid ItemsSource is set to "{Binding MasterRecord.Data.Addresses}". Addresses is a property of class EntitySet. The workaround is adding new record manually into this collection, which works fine, but I'd like to know this this is the way it's supposed to be or is it some kind of bug (my code or RadGrid doing something wrong).
  4. I'm using binding validation (based on IDataErrorInfo implemented in business objects). I have problems marking cells that have validation errors. Setting Validation.ErrorTemplate has more or less unpredictable results. So I use code like this:
        <Style TargetType="{x:Type telerik:GridViewCell}"
            <Style.Triggers> 
                <Trigger Property="Validation.HasError" Value="true"
                    <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" /> 
                    <Setter Property="Background" Value="Red" /> 
                </Trigger> 
            </Style.Triggers> 
        </Style> 
  • This leaves misaligned red borders (where inserted cells were marked red for validation errors) in first row even after row has been commited and moved. This remains in place event when scrolling grid. It works fine for row's that were already in database or were only modified, but not for new rows.
  • Red background does not show for fields containging date.

Thanks.
Branko
Nedyalko Nikolov
Telerik team
 answered on 21 May 2009
1 answer
371 views
Can you please post some sample code as to how I could change the theme for a chart in code behind?  I just want to switch from the balck theme to either Vista or Simple.

 For the life of me I can't find the method or property to set.

Thanks!!

--Tad Richard
Ves
Telerik team
 answered on 21 May 2009
1 answer
137 views
If tabbing into a TimePicker control, can it be changed to select all the text instead of setting it into a character position?
Bobi
Telerik team
 answered on 20 May 2009
1 answer
137 views
I have a RadGridView on a page defined as :

 

 

<Grid Height="115">

 

 

 

<telerik:RadGridView AutoGenerateColumns="False" ItemsSource="{Binding PatientMedications}">

 

 

 

<telerik:RadGridView.Columns>

 

 

 

<telerik:GridViewDataColumn Width="2*" HeaderText="Name" DataType="{x:Type System:String}" DataMemberBinding="{Binding Path=Drug_.Name}" UniqueName="{x:Null}"/>

 

 

 

<telerik:GridViewDataColumn Width="3*" HeaderText="Dosage" DataType="{x:Type System:String}" DataMemberBinding="{Binding Path=Dosage}" UniqueName="{x:Null}" />

 

 

 

<telerik:GridViewDataColumn Width="85" HeaderText="Started" DataType="{x:Type System:String}" DataMemberBinding="{Binding Path=StartTime}" UniqueName="{x:Null}" />

 

 

 

<telerik:GridViewDataColumn Width="85" HeaderText="Ended" DataType="{x:Type System:String}" DataMemberBinding="{Binding Path=EndTime}" UniqueName="{x:Null}" />

 

 

 

<telerik:GridViewDataColumn Width="*" HeaderText="Comments" DataType="{x:Type System:String}" DataMemberBinding="{Binding Path=Comments}" UniqueName="{x:Null}" />

 

 

 

</telerik:RadGridView.Columns>

 

 

 

</telerik:RadGridView>

 

 

 

</Grid>

 


My problem is that it is forcing the with of its bounding container to expand instead of its own size being set by the container.  I want the grid to expand to the full size of its bounding container.

What do I need to do to accomplish this?

Thanks,

Billy Jacobs
StevenDale
Top achievements
Rank 2
 answered on 20 May 2009
4 answers
205 views
Hello all,
Are there any built-in themes for RadExpander? And what are the advantages of it over the Expander from the WPF framework?

Thanks,
Kenny.
Kenny
Top achievements
Rank 1
 answered on 20 May 2009
6 answers
493 views
I am loading one grid that will need to be filtered by user input of a value in a seperat textbox. The filter is a CONTAINS filter on one column of the grid.

Basically as the user types, the available values need to go down to better and better match the input. Do you guys have a good example of this?

Note: Values are plain text CONTAINS matching, so no special custom filters seem to be needed.
Kenny
Top achievements
Rank 1
 answered on 20 May 2009
1 answer
92 views
Another question is how do we set the initial time to null or blank instead of 00:00 ?  Sorry, the docs seem kinda sparse..
Bobi
Telerik team
 answered on 20 May 2009
7 answers
274 views
Is it possible to use the first look example with objects?

I have a list of objectA and each object has 3 sublists. I want to display each sublist in a tab when the parent record is expanded, similar to the first look example provided.

I have managed a workaround by modifying the Custom Row Layout example and using an expander but it is not as clean as the First Look Example.

Thanks,

Billy Jacobs
Vlad
Telerik team
 answered on 20 May 2009
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?