Checkbox List Column

11 posts, 0 answers
  1. Jeff
    Jeff avatar
    11 posts
    Member since:
    Mar 2008

    Posted 18 Nov 2011 Link to this post

    How do I add a checkbox list column to the WinForms GridView control?

    Thank you,
    Jeff
  2. Stefan
    Admin
    Stefan avatar
    2911 posts

    Posted 23 Nov 2011 Link to this post

    Hi Jeff, 

    Thank you for writing.

    To add a check box column to RadGridView, simply create an instance of GridViewCheckBoxColumn and add that instance to the Columns collection of RadGridView

    Here is a link to the online documentation concerning this column: http://www.telerik.com/help/winforms/gridview-columns-gridviewcheckboxcolumn.html.

    I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  3. Jeff
    Jeff avatar
    11 posts
    Member since:
    Mar 2008

    Posted 23 Nov 2011 Link to this post

    Stefan,

    Thanks for your response, but I was actually looking for a CheckBoxList column instead of a single checkbox.

    Any idea on a "checkbox list" column?

    Thank you,
    Jeff
  4. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 30 Nov 2011 Link to this post

    Hi Jeff,

    This is to inform you that are currently working on your case. We will get back to you soon.

    All the best,
    Nikolay
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  5. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 01 Dec 2011 Link to this post

    Hello Jeff,

    Thank you for your patience.

    Generally, the case of having a multiple checkbox column implies having a RadDropDownListEditor with checked items, because of the big area that will be consumed by the checkboxlists. Still, please find attached a sample project which demonstrates the scenario you desire - a CheckBoxList column.

    Please note, however, that such a solution is not recommended to be used in RadGridView. As you will see yourself, the fact that there are many additional elements and layouts in the RadGridView cells, makes the process of scrolling up and down slow.

    I am attaching the performance-wise solution, where just one RadDropDownEditor is displayed upon user request. You will notice that this solution makes RadGridView much more responsive and you are still able to select multiple items from a checked (drop-down) list.

    I hope this helps. Feel free to write back if you have additional questions.

    All the best,
    Nikolay
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  6. Daniel
    Daniel avatar
    5 posts
    Member since:
    Aug 2012

    Posted 21 Jan 2013 Link to this post

    Hello.

    Really nice example, I have used such custom control i my solution, but after update to Q3 version it stopped work :(

    Also Your example doesn't work.

    Drop down items are empty (see attachment) and its generates some exceptions:

    System.InvalidOperationException was unhandled
    Message="Zmodyfikowano kolekcję. Nie można wykonać operacji wyliczania."
    Source="mscorlib"
    StackTrace:
    w System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
    w Telerik.WinControls.RadElementCollection.RadElementEnumerator.MoveNext()
    w Telerik.WinControls.UI.DefaultListControlStackContainer.ForceVisualStateUpdate()
    w Telerik.WinControls.UI.RadListElement.EndUpdate()
    w Telerik.WinControls.UI.RadListElement.set_DataSource(Object value)
    w Telerik.WinControls.UI.RadDropDownListElement.set_DataSource(Object value)
    w RadMultiSelectDropDownInGrid.Form1.radGridView1_EditorRequired(Object sender, EditorRequiredEventArgs e) w C:\software\telerik\sample\RadMultiSelectDropDownInGrid\RadMultiSelectDropDownInGrid\Form1.cs:wiersz 112
    w Telerik.WinControls.UI.EventDispatcher.RaiseEvent[T](Object eventKey, Object sender, T args)
    w Telerik.WinControls.UI.GridViewEditManager.GetDefaultEditor(IEditorProvider provider)
    w Telerik.WinControls.UI.GridViewEditManager.BeginEdit()
    w Telerik.WinControls.UI.GridViewEditManager.OnPositionChanged(PositionChangedEventArgs args)
    w Telerik.WinControls.UI.GridViewEditManager.Telerik.WinControls.UI.IGridViewEventListener.ProcessEvent(GridViewEvent eventData)
    w Telerik.WinControls.UI.GridViewEventProcessEntity.ProcessCollection(GridViewEvent gridEvent, PriorityWeakReferenceList list, GridEventProcessMode processMode)
    w Telerik.WinControls.UI.GridViewSynchronizationService.NotifyListeners(GridViewEvent gridEvent)
    w Telerik.WinControls.UI.GridViewSynchronizationService.FlushEvents()
    w Telerik.WinControls.UI.GridViewSynchronizationService.DispatchEvent(GridViewEvent gridEvent)
    w Telerik.WinControls.UI.GridViewSynchronizationService.RaiseCurrentChanged(GridViewTemplate template, GridViewRowInfo row, GridViewColumn column, Boolean user)
    w Telerik.WinControls.UI.BaseGridNavigator.SelectCore(GridViewRowInfo row, GridViewColumn column)
    w Telerik.WinControls.UI.GridRowBehavior.SelectPositionOnMouseDownLeft(MouseEventArgs e, GridRowElement rowElement, GridCellElement cellElement)
    w Telerik.WinControls.UI.GridRowBehavior.OnMouseDownLeft(MouseEventArgs e)
    w Telerik.WinControls.UI.GridRowBehavior.OnMouseDown(MouseEventArgs e)
    w Telerik.WinControls.UI.BaseGridBehavior.OnMouseDown(MouseEventArgs e)
    w Telerik.WinControls.UI.RadGridView.OnMouseDown(MouseEventArgs e)
    w System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)
    w System.Windows.Forms.Control.WndProc(Message& m)
    w Telerik.WinControls.RadControl.WndProc(Message& m)
    w System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
    w System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    w System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
    w System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
    w System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
    w System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
    w RadMultiSelectDropDownInGrid.Program.Main() w C:\software\telerik\sample\RadMultiSelectDropDownInGrid\RadMultiSelectDropDownInGrid\Program.cs:wiersz 18
    w System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
    w Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
    w System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    w System.Threading.ThreadHelper.ThreadStart()
    InnerException:

     

  7. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 23 Jan 2013 Link to this post

    Hello Daniel,

    Please refer to the following knowledge base article which demonstrates how to achieve the desired behavior with our latest version: Mutiselect drop down list column in RadGridView.

    At the bottom of the article, you will find sample projects in C# and VB.NET that would allow you to incorporate the proposed solution in your application more easily.

    I hope this helps.

    Greetings,
    Nikolay
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  8. Daniel
    Daniel avatar
    5 posts
    Member since:
    Aug 2012

    Posted 23 Jan 2013 Link to this post

    Hello

    I'm afraid it's not the same problem.

    In Your example whole column is as custom (multi select) column.

     I need different editors type in one column (dependent on values in other columns). That was possible in RadMultiSelectDropDownInGrid project.
  9. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 28 Jan 2013 Link to this post

    Hi Daniel,

    I modified the project from the Knowledge Base article and now you can use the multi-select editor only in a selected set of cells of a column. Please find the attached project for additional information.

    I hope this helps.

    All the best,
    Nikolay
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  10. Daniel
    Daniel avatar
    5 posts
    Member since:
    Aug 2012

    Posted 29 Jan 2013 Link to this post

    Hello.

    Yes, that is what I need! :)

    Thank You.
  11. Andrey Kipetcoff
    Andrey Kipetcoff avatar
    4 posts
    Member since:
    Jan 2010

    Posted 23 Aug 2013 Link to this post

    Thank you, guys. Very useful control.
Back to Top