We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to embed CheckedListBox in GroupGridControl cell

Thread ID:

Created:

Updated:

Platform:

Replies:

64351 Jul 18,2007 07:44 PM UTC Jul 20,2007 06:05 PM UTC Windows Forms 5
loading
Tags: GridControl
Kiran Guptha
Asked On July 18, 2007 07:44 PM UTC

Hi,
I need to embed CheckedListBox in GroupGridControl cell. Pls point to me some example

Thanks
-Kiran

Rajagopal [Syncfusion]
Replied On July 19, 2007 01:07 AM UTC

Hi Kiran,

Thanks for your interest in Syncfusion Products.

You need to create a custom celltype as in the below sample which is shipped with the browser samples.

\\Syncfusion\EssentialStudio\5.1\Windows\Grid.Windows\Samples\2.0\CustomCellTypes\DropDownFormAndUserControlSample

A custom CellType requires a model class and a renderer class. The model class handles the serialization requirements for the control and creates the renderer class. The renderer class handles the UI requirements of the cell.

For GridGroupingControl, custom celltypes has to be registered through TableModel.CellModels.Add function.
Refer this shipped sample for more details
\\Syncfusion\Essential Studio\5.1\windows\Grid.Grouping.Windows\Samples\FeatureSamples\CustomCellTypes

Here is a sample in GridGroupingControl with CheckedListBox cells.
http://www.syncfusion.com/Support/user/uploads/GGC_CustomCellType_9a3e118e.zip

Have a nice time.
Regards,
Rajagopal

Kiran Guptha
Replied On July 19, 2007 04:21 PM UTC

Hi Rajgopal,
Thanks for the examples. How to avoide useng OK & Cancel buttons on the User control. If user changes & click outside I w ant to save the changes to cell.
DropDownContainerCloseDropDown(object sender, PopupClosedEventArgs e) e.PopupCloseType has canceled or deactivated. I tried setting
ControlValue = this.ddUser.GetValuesToString(); which doesn't work.
Pls let me know the work around

Thanks
-Kiran


haneefm [Syncfusion]
Replied On July 19, 2007 11:12 PM UTC

Hi Kiran,

I have modified the above attached sample as per your requirement. Please refer the attached sample for implementation and let me know if this helps.

////Modified code in DropDownUserControl.cs
[c#]
protected override bool OnDeactivating()
{
// closethe dropdown with a Done setting
if (this.CurrentCell.IsDroppedDown)
{
this.CurrentCell.IsModified = true;
this.Grid.CurrentCell.CloseDropDown(Syncfusion.Windows.Forms.PopupCloseType.Done);
}
return base.OnDeactivating();
}

Sample :ModifiedGGC_CustomCellType.zip

Best regards,
Haneef

Kiran Guptha
Replied On July 20, 2007 03:15 PM UTC

Hi Haneef,
Thaks for the reply. I found refresh issue with Tab button click when dropdown is open. Pls find the sample attached below.

Steps to reproduce
1. Click on the DropDown button in a cell
2. Do some selection changes
3. Click Tab. The Dropdown closes & the selection is not changed in the cell. Click Tab again the cell Refreshes.
I need a fix or workaround for this.
Pls let me know

Thanks
-Kiran





testLCB.zip

haneefm [Syncfusion]
Replied On July 20, 2007 06:05 PM UTC

Hi Kiran,

You would probably have to set the celltext using GridModel in DropDownContainerCloseDropDown override method. You could use code such as:

public override void DropDownContainerCloseDropDown(object sender, PopupClosedEventArgs e)
{
if (e.PopupCloseType != PopupCloseType.Canceled)
{
if (this.NotifyCurrentCellChanging())
{
ControlValue = this.ddCtrl.GetValuesToString();
this.ControlText = ControlValue.ToString();
this.Grid.Model[RowIndex, ColIndex].Text = this.ControlText;
this.NotifyCurrentCellChanged();
Grid.InvalidateRange(GridRangeInfo.Cell(RowIndex, ColIndex), GridRangeOptions.MergeCoveredCells); // Merge all cells
}
}
base.DropDownContainerCloseDropDown(sender, e);
}

Best regards,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;