This is a migrated thread and some comments may be shown as answers.

GridViewMultiComboBoxColumn implementation issues

7 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rick Glos
Top achievements
Rank 1
Rick Glos asked on 22 Jan 2010, 08:12 PM
Hi there,

I'd really like to make use of the GridViewMultiComboBoxColumn but I'm finding a few problems.

I have the DataSource property of the column bound to a collection of business objects.  That object has all sorts of properties and I really only want to show 2 of them.

I don't see any examples of the GridViewMultiComboBoxColumn in the shipping source code (Q3 2009 SP1) however I did find a couple of posts (here and here) of others trying to do something similar and it appears I need to customize the displayed Grid in the CellBeginEdit event.

A funny implementation detail of this is that since that event gets called everytime the user clicks on a row, I now need to add some class variable to determine if I've customized the grid otherwise the columns I add programmatically get added over and over...  overlooking that for the moment here's my questions.

Question 1:  My first issue is that when I click on the cell with the GridViewMultiComboBoxColumn, it suddenly shows me a Type name 'Telerik.WinControls.UI.GridViewDataRowInfo' instead of the DisplayMember.  Here's a screenshot.

Question 1.1: As a side note, why must a click twice in the cell to get the drop down to display?

Question 2:  My second issue is that when it displays the Grid, even though I've told it to only display 2 columns, it still makes space for all the properties.  Why is this?  It doesn't seem to matter if I call BestFitColumns().  Here's a screenshot.

I've uploaded my source code here for you to see.

7 Answers, 1 is accepted

Sort by
0
Accepted
Svett
Telerik team
answered on 26 Jan 2010, 09:27 AM
Hi Rick Glos,

Regarding your questions the answers are:

1. You have set a wrong DisplayMember property of GridViewMultiComboBoxColumn. You may use the following code snippet:

newColumn.DisplayMember = "ShortDescription";

1.1 The drop down pop up is not shown, because the editor is created dynamically.

2. You should change AutoSizeColumnsMode to fit the all available space in MultiComboBoxColumn drop down.

((RadMultiColumnComboBoxElement)RadGridViewCharts.ActiveEditor).EditorControl.MasterGridViewTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;

All changes are addressed in the attached project.

Best wishes,
Svett
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Rick Glos
Top achievements
Rank 1
answered on 26 Jan 2010, 05:49 PM
Worked great!  Thanks for spotting my bug and showing me the correct way to auto size the columns.
0
Minh
Top achievements
Rank 1
answered on 30 Jul 2011, 03:39 AM
I get an error when use Telerik 2011 (Telerik 2010 worked great!).
When I focus in GridViewMultiComboBoxColumn, after I minimize window I get the error message

************* Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.RemoveElement(Int32 position)
   at Telerik.WinControls.UI.VirtualizedStackContainer`1.BeginMeasure(SizeF availableSize)
   at Telerik.WinControls.UI.BaseVirtualizedContainer`1.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.UI.ScrollableRowsContainerElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.UI.RowsContainerElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.UI.ScrollViewElement`1.MeasureView(SizeF availableSize)
   at Telerik.WinControls.UI.ScrollViewElement`1.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.UI.GridTableElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.Layouts.DockLayoutPanel.MeasureOverride(SizeF constraint)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.UI.LightVisualElement.MeasureElements(SizeF availableSize, SizeF clientSize, Padding borderThickness)
   at Telerik.WinControls.UI.LightVisualElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.RootRadElement.MeasureOverride(SizeF availableSize)
   at Telerik.WinControls.RootRadElement.MeasureCore(SizeF availableSize)
   at Telerik.WinControls.RadElement.Measure(SizeF availableSize)
   at Telerik.WinControls.ComponentLayoutElementTree.PerformInnerLayout(Boolean performMeasure, Int32 x, Int32 y, Int32 width, Int32 height)
   at Telerik.WinControls.ComponentLayoutElementTree.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at Telerik.WinControls.RadControl.SetBoundsCore(Int32 x, Int32 y, Int32 width, Int32 height, BoundsSpecified specified)
   at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.SetBounds(Rectangle bounds, BoundsSpecified specified)
   at System.Windows.Forms.Layout.DefaultLayout.xLayoutDockedControl(IArrangedElement element, Rectangle newElementBounds, Boolean measureOnly, Size& preferredSize, Rectangle& remainingBounds)
   at System.Windows.Forms.Layout.DefaultLayout.LayoutDockedControls(IArrangedElement container, Boolean measureOnly)
   at System.Windows.Forms.Layout.DefaultLayout.xLayout(IArrangedElement container, Boolean measureOnly, Size& preferredSize)
   at System.Windows.Forms.Layout.DefaultLayout.LayoutCore(IArrangedElement container, LayoutEventArgs args)
   at System.Windows.Forms.Layout.LayoutEngine.Layout(Object container, LayoutEventArgs layoutEventArgs)
   at System.Windows.Forms.Control.OnLayout(LayoutEventArgs levent)
   at System.Windows.Forms.ScrollableControl.OnLayout(LayoutEventArgs levent)
   at System.Windows.Forms.Form.OnLayout(LayoutEventArgs levent)
   at System.Windows.Forms.Control.PerformLayout(LayoutEventArgs args)
   at System.Windows.Forms.Control.System.Windows.Forms.Layout.IArrangedElement.PerformLayout(IArrangedElement affectedElement, String affectedProperty)
   at System.Windows.Forms.Layout.LayoutTransaction.DoLayout(IArrangedElement elementToLayout, IArrangedElement elementCausingLayout, String property)
   at System.Windows.Forms.Control.OnResize(EventArgs e)
   at System.Windows.Forms.Form.OnResize(EventArgs e)
   at System.Windows.Forms.Control.OnSizeChanged(EventArgs e)
   at System.Windows.Forms.Control.UpdateBounds(Int32 x, Int32 y, Int32 width, Int32 height, Int32 clientWidth, Int32 clientHeight)
   at System.Windows.Forms.Control.UpdateBounds()
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I don't understand! (Telerik 2010 worked great but 2011 not)
Sorry for my English not well
0
Stefan
Telerik team
answered on 03 Aug 2011, 10:11 AM
Hi Minh,

Thank you for writing.

The provided stack trace is not enough for me to determine what causes the observed exception. For this reason, I would like to kindly ask you to prepare a sample project (where I can observe the issue) and send it to us in a new Support Ticket (since forums does not allow attachments and this thread concerns another topic). This will allow us to investigate your case and provide you with adequate support.

I am looking forward to your response.
 
Regards,
Stefan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Francois
Top achievements
Rank 1
answered on 15 Sep 2011, 07:08 PM
I have the same issue, has anything worked for you Minh?

0
Stefan
Telerik team
answered on 21 Sep 2011, 09:11 AM
Hello Francois,

Thank you for writing.

As I mentioned in my previous post, I was not able to replicate this issue in my local tests. In addition, Minh did not provide us with his project in order to allow us to investigate this case. Could you please provide me with a project, where I can observe the experienced behavior, so I can investigate this case locally and provide you with further support? You need to open a new support ticket in order to be able to attach your project. 

Best wishes,
Stefan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Accepted
Francois
Top achievements
Rank 1
answered on 17 Oct 2011, 03:33 PM
FYI, I sent a sample of code replicating the issue to Telerik and they said it will be fixed in the next release mid-November.

The problem is due to their internal code handling the MultiComboColumn, so the only workaround is to use the ComboColumn.

Thanks,
Francois
Tags
GridView
Asked by
Rick Glos
Top achievements
Rank 1
Answers by
Svett
Telerik team
Rick Glos
Top achievements
Rank 1
Minh
Top achievements
Rank 1
Stefan
Telerik team
Francois
Top achievements
Rank 1
Share this question
or