Telerik Forums
UI for WinForms Forum
7 answers
243 views
Hi,

I'm evaluating the Telerik GridView for use in a new project and am coming up against a couple of difficulties. I haven't found answers in the Forum, so I thought I would ask.

The situation. We are binding CSLA collections to a data grid. We want to use comboboxes for certain columns. Due to customer restraints, we are forced to use WinForms.

First. For GridViewComboBoxColumns. Is it possible to bind not to a value of the SelectedItem but to the item itself? We use readonly "Mini Objects" for things like Products and try not to expose the ID for that product. It shouldn't be necessary for the UI Developer to know what the ID is. You might think about adding the option SelectedItem to the ValueMember options. Then the SelectedItem is bound to the object and not the ID. I would think this would also be interesting for things like EF Entities where you also want to bind to an object and not directly to an ID.

I found a partial workaround for the above problem, see below, but it seems very cludgy.

 Private Sub RadGridView1_ValueChanged(ByVal sender As ObjectByVal e As System.EventArgsHandles RadGridView1.ValueChanged

        Dim dataRow As GridViewDataRowInfo = TryCast(Me.RadGridView1.CurrentRow, GridViewDataRowInfo)
        If dataRow Is Nothing Then
            Return
        End If

        Dim orderDetail As BO.OrderDetail = TryCast(dataRow.DataBoundItem, BO.OrderDetail)

        Dim cbEditor As RadDropDownListEditor = TryCast(Me.RadGridView1.ActiveEditor, Telerik.WinControls.UI.RadDropDownListEditor)

        If cbEditor IsNot Nothing Then
            Dim editorElement As RadDropDownListEditorElement = TryCast(cbEditor.EditorElement, RadDropDownListEditorElement)
            Dim prod As BO.ProductInfo = DirectCast(editorElement.SelectedItem.DataBoundItem, BO.ProductInfo)
            orderDetail.ProductInfo = prod
            orderDetail.UnitPrice = prod.UnitPrice
        End If
    End Sub


Second: Our Business objects are based on bindinglists. That means they have logic for determining default values for new items added to collections. For example for the OrderDetail object will automatically set the default discount depending on the Customer defined in the OrderObject.

Does the RadGridView support this kind of senario?  How can I convince the grid to use my 'correct' value instead of an empty version?

Also, since the RadGridView adds a "Phantom" object, the above code doesn't work. I can't set the editable price for the OrderDetail. It gets ignored.

Note, the default object works perfectly in the Windows datagrid but causes problems with the Telerik product. Interestingly, if I have both controls on the same form, bound to the same bindinglist and click on the "new row" in the Windows DataGrid, the Telerik gets all the events and shows the right information.

Thanks for any help.
Julian Benkov
Telerik team
 answered on 13 Sep 2010
1 answer
124 views
Hi All,

I am using Radcombobox for my application and I am facing the following problem i.e., when the user inputs data in the combobox it should only allow type those values/data which are present in the combobox items and it should restrict the user in inputting the text/data which doesn't match with the dropdown list values .

Example: Take suppose i have already 4 values in the dropdownlist namely 1)Sanfrancisco 2)Newyork 3)London 4) Australia
 When the user types 'New' the system allow the user to input and also should suggest what are the values/records starting with New but needs to restrict the user when he enters something like 'Flo' (i.e., the item which doesn't matches with the dropdownlist values).

Can anyone suggest how to acheive this. Also it would be great if you can provide me code snippet
Currently I am using Q3 2009 SP1 version.

Regards,
Prasad.
Peter
Telerik team
 answered on 13 Sep 2010
1 answer
40 views
Hello,

I have a L = List<A>  of classes A { int X, int Y, int Z,  DateTime Timestamp }

And want to set chart.DataSource = L and 3 line series should be drawn with the Timestamp property on the x-Axis and respectively the values of X,Y and Z on the y-Axis.

How can I do this ? Is set the DataXColumn values in the series...  but no reaction ...

could you give a small example ?


Benedict
Top achievements
Rank 1
 answered on 12 Sep 2010
1 answer
164 views
Hi,

I have two columns in my grid for which i add image in CellFormatting event. But when i re-bind my grid, those images come up in all columns.I am not able to trace the issue. I have tried adding GridviewImageColumn as well, but with that also i am facing the same problem. I have attached the screen shot.
My Code:

 DataTable dtTemp = new DataTable();
            for (int i = 0; i < dsTemp.Tables.Count; i++)
            {
                dtTemp.Merge(dsTemp.Tables[i]);
            }
            SetSummaryInFooterForCoaching(dtTemp);            
            CoachingGrd.DataSource = dtTemp.DefaultView;
            //if (CoachingGrd.Columns.Contains("Settings") || CoachingGrd.Columns.Contains("Agents Connected"))
            //{
            //    CoachingGrd.Columns.Remove(CoachingGrd.Columns["Settings"]);
            //    CoachingGrd.Columns.Remove(CoachingGrd.Columns["Agents Connected"]);
            //}
            //AddImageColumn(CoachingGrd.Columns.Count);
            
            (this.CoachingGrd.GridElement as GridTableElement).TableHeaderHeight = 35;
            CoachingGrd.MasterTemplate.AllowEditRow = true;
            CoachingGrd.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
            CoachingGrd.AllowColumnReorder = false;
            CoachingGrd.ThemeName = "ControlDefault";
            foreach (GridViewDataColumn column in CoachingGrd.Columns)
            {
                HideCoachingColumns(column);
                column.ReadOnly = true;
                if (column.FieldName == SalesCenterSettingsColumns.Range)
                    column.ReadOnly = false;           
                column.WrapText = true;
                column.TextAlignment = ContentAlignment.MiddleCenter;
            }

private void CoachingGrd_CellFormatting(object sender, CellFormattingEventArgs e)
        {
            GridViewDataColumn column = e.CellElement.ColumnInfo as GridViewDataColumn;

            if (column != null && column.FieldName == "Agents Connected")
            {
                e.CellElement.TextAlignment = ContentAlignment.MiddleLeft;
                e.CellElement.Image = global::PoseidonClient.Properties.Resources.People;
                e.CellElement.ImageAlignment = ContentAlignment.MiddleRight;
            }
            if (column != null && column.FieldName == "Settings")
            {
                e.CellElement.Image = global::PoseidonClient.Properties.Resources.Settings;
            }
        }

Thanks,
Pinaki
Jack
Telerik team
 answered on 11 Sep 2010
3 answers
231 views
hi all

i want to display image in rad gridview ,image name is save in database and image is save in application folder

how can i show in vb.net window application.
Jack
Telerik team
 answered on 11 Sep 2010
3 answers
485 views
If there a way to change the first day of the week for the datetimepicker in winforms
Dobry Zranchev
Telerik team
 answered on 11 Sep 2010
9 answers
244 views
Issue 1:
I get an error on a heirarchical gridview:

An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.

I have not been able to properly establish what causes this error, but I can see that it comes when I click on the child rows. The error is somewhat sporadic but it is always after expanding and clicking on childrows. The childrows in my grid are readonly.

Issue 2:
When I double click on childrows, the grid sometimes automatically scrows to the bottom (i.e. to the last row in the gridview mastertable) and I cannot explain this behaviour.

Issue 3:
I have observed yet another error.. see below (couldnt attach it as a *.txt):
=========================================================================================
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>Docwize.Client.vshost.exe</AppDomain><Exception><ExceptionType>System.Reflection.TargetInvocationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Exception has been thrown by the target of an invocation.</Message><StackTrace>   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp;amp; 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.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   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.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)
   at Telerik.WinControls.RadControl.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at DocwizeClient.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
   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()</StackTrace><ExceptionString>System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.RadGridViewElement.get_CurrentColumn()
   at Telerik.WinControls.UI.GridCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridVirtualizedCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridDataCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridCellElement.UpdateInfo()
   at Telerik.WinControls.UI.GridVirtualizedCellElement.Initialize(GridViewColumn column, GridRowElement row)
   at Telerik.WinControls.UI.GridDateTimeCellElement..ctor(GridViewColumn column, GridRowElement row)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct&amp;amp; signature, IntPtr declaringType)
   at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at Telerik.WinControls.UI.GridRowElement.CreateCell(GridViewColumn column)
   at Telerik.WinControls.UI.GridDataRowElement.CreateCell(GridViewColumn column)
   at Telerik.WinControls.UI.CellElementProvider.CreateElement(GridViewColumn data, Object context)
   at Telerik.WinControls.UI.CellElementProvider.GetElement(GridViewColumn data, Object context)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.UpdateElement(Int32 position, T data)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeElement(RadElement element, RectangleF clientRect, RectangleF finalRect)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeHorizontally(SizeF finalSize)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.GridVisualElement.ArrangeElement(RadElement element, SizeF finalSize, RectangleF clientRect)
   at Telerik.WinControls.UI.GridVisualElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.ArrangeElement(IVirtualizedElement`1 element, Int32 position)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOnScrollUp()
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp;amp; 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.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
   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.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)
   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()
   at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)
   at Telerik.WinControls.RadControl.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp;amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp;amp; m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp;amp; msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at DocwizeClient.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
   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()</ExceptionString><InnerException><ExceptionType>System.Reflection.TargetInvocationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Exception has been thrown by the target of an invocation.</Message><StackTrace>   at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct&amp;amp; signature, IntPtr declaringType)
   at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at Telerik.WinControls.UI.GridRowElement.CreateCell(GridViewColumn column)
   at Telerik.WinControls.UI.GridDataRowElement.CreateCell(GridViewColumn column)
   at Telerik.WinControls.UI.CellElementProvider.CreateElement(GridViewColumn data, Object context)
   at Telerik.WinControls.UI.CellElementProvider.GetElement(GridViewColumn data, Object context)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.UpdateElement(Int32 position, T data)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeElement(RadElement element, RectangleF clientRect, RectangleF finalRect)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeHorizontally(SizeF finalSize)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.GridVisualElement.ArrangeElement(RadElement element, SizeF finalSize, RectangleF clientRect)
   at Telerik.WinControls.UI.GridVisualElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.ArrangeElement(IVirtualizedElement`1 element, Int32 position)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOnScrollUp()
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)</StackTrace><ExceptionString>System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&amp;gt; System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.RadGridViewElement.get_CurrentColumn()
   at Telerik.WinControls.UI.GridCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridVirtualizedCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridDataCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridCellElement.UpdateInfo()
   at Telerik.WinControls.UI.GridVirtualizedCellElement.Initialize(GridViewColumn column, GridRowElement row)
   at Telerik.WinControls.UI.GridDateTimeCellElement..ctor(GridViewColumn column, GridRowElement row)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeConstructor(Object[] args, SignatureStruct&amp;amp; signature, IntPtr declaringType)
   at System.RuntimeMethodHandle.InvokeConstructor(Object[] args, SignatureStruct signature, RuntimeTypeHandle declaringType)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at Telerik.WinControls.UI.GridRowElement.CreateCell(GridViewColumn column)
   at Telerik.WinControls.UI.GridDataRowElement.CreateCell(GridViewColumn column)
   at Telerik.WinControls.UI.CellElementProvider.CreateElement(GridViewColumn data, Object context)
   at Telerik.WinControls.UI.CellElementProvider.GetElement(GridViewColumn data, Object context)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.UpdateElement(Int32 position, T data)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeElement(RadElement element, RectangleF clientRect, RectangleF finalRect)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeHorizontally(SizeF finalSize)
   at Telerik.WinControls.UI.StackLayoutElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.GridVisualElement.ArrangeElement(RadElement element, SizeF finalSize, RectangleF clientRect)
   at Telerik.WinControls.UI.GridVisualElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.ArrangeElement(IVirtualizedElement`1 element, Int32 position)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOnScrollUp()
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeElements(SizeF finalSize)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.ArrangeOverride(SizeF finalSize)
   at Telerik.WinControls.RadElement.ArrangeCore(RectangleF finalRect)
   at Telerik.WinControls.RadElement.Arrange(RectangleF finalRect)
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayout()
   at Telerik.WinControls.Layouts.ContextLayoutManager.UpdateLayoutCallback(ILayoutManager manager)</ExceptionString><InnerException><ExceptionType>System.NullReferenceException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Object reference not set to an instance of an object.</Message><StackTrace>   at Telerik.WinControls.UI.RadGridViewElement.get_CurrentColumn()
   at Telerik.WinControls.UI.GridCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridVirtualizedCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridDataCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridCellElement.UpdateInfo()
   at Telerik.WinControls.UI.GridVirtualizedCellElement.Initialize(GridViewColumn column, GridRowElement row)
   at Telerik.WinControls.UI.GridDateTimeCellElement..ctor(GridViewColumn column, GridRowElement row)</StackTrace><ExceptionString>System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.RadGridViewElement.get_CurrentColumn()
   at Telerik.WinControls.UI.GridCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridVirtualizedCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridDataCellElement.UpdateInfoCore()
   at Telerik.WinControls.UI.GridCellElement.UpdateInfo()
   at Telerik.WinControls.UI.GridVirtualizedCellElement.Initialize(GridViewColumn column, GridRowElement row)
   at Telerik.WinControls.UI.GridDateTimeCellElement..ctor(GridViewColumn column, GridRowElement row)</ExceptionString></InnerException></InnerException></Exception></TraceRecord>
Jack
Telerik team
 answered on 11 Sep 2010
1 answer
109 views
I have an application that used another vendors ribbon control. We were very unhappy with it, so just replaced it with your RibbonBar control. We understood that to get the benefits from the ribbon control, that we should use the RadRibbonForm. Since we already had all of the code written for this form, we just changed the inherits statement from Forms.Form to RadRibbonForm.

Now when we run the application, we cannot use the title bar. We cannot move the window. We cannot min/max the window. And we cannot access the close or control icons.

Is there another step we need to do to get the RadRibbonForm title bar to work correctly?

Thanks!
Deborah
Top achievements
Rank 1
 answered on 11 Sep 2010
10 answers
226 views
I have a hierarchical grid, but I need to allow users only to be able to select rows in the top level (not sub-levels).
I tried to detect when the selection is in the sub-level and deselect that row and select corresponding parent row, but it didn't work out.

Is it possible in general to disallow row selection in a grid?

I am using Q1 2010 SP1.
Suggestions? Thanks.
Svett
Telerik team
 answered on 10 Sep 2010
7 answers
444 views
Hello,

How can i open the EditAppointmentDialog programmatically? It is because i wanna update the database after the user clicks btnOK. Is this possible to get back dialog result?

Thanks,
Angus

Dobry Zranchev
Telerik team
 answered on 10 Sep 2010
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
GanttView
Diagram, DiagramRibbonBar, DiagramToolBox
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
CheckedListBox
StatusStrip
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
WaitingBar
DataEntry
ScrollablePanel
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
Barcode
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Licensing
Localization
TimePicker
ButtonTextBox
FontDropDownList
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+? 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?