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.

custom cell control that places a DropDown Form/UserControl in a cell not working in the GGC, but works in the GridControl

Thread ID:

Created:

Updated:

Platform:

Replies:

53754 Dec 19,2006 05:54 PM Jan 3,2007 03:22 PM Windows Forms 5
loading
Tags: Grouping
James Blibo
Asked On December 19, 2006 05:54 PM

I saw an example for the gridcontrol in with a custom user control and a windows form were used as drop down popup for a cell.

I tried to port this over to the ggc, which I think should be straight forward by replacing

//2) Register your custom cell type
this.gridControl1.CellModels.Add("DropDownUserControl", new DropDownUserCellModel(this.gridControl1.Model, new DropDownUser()));


//3) Set the style.CellType for the cells
this.gridControl1[6, 2].CellType = "DropDownUserControl";

with...

//2) Register your custom cell type
this.gridGroupingControl2.TableControl.Model.CellModels.Add("DropDownUserControl", new DropDownUserCellModel(this.gridGroupingControl2.TableControl.Model, new DropDownUser()));


this.gridGroupingControl2.TableDescriptor.Columns["DaysOfWeek"].Appearance.AnyRecordFieldCell.CellType = "DropDownUserControl";


... but this is not working. Does the grouping grid supports this?

Administrator [Syncfusion]
Replied On December 20, 2006 01:34 PM

Hi James,

Please try the following code snippet and let us know if you need any further assistance.

>>>>>>>>>>
this.gridGroupingControl2.TableModel.CellModels.Add("DropDownUserControl", new DropDownUserCellModel(this.gridGroupingControl2.TableModel, new DropDownUser()));
this.gridGroupingControl2.TableDescriptor.Columns["DaysOfWeek"].Appearance.AnyRecordFieldCell.CellType = "DropDownUserControl";
>>>>>>>>>>

Thank you for being patience.

Best regards,
Madhan


James Blibo
Replied On December 20, 2006 07:32 PM

sorry... did not work!

James Blibo
Replied On December 21, 2006 12:47 AM

my bad... i saw my mistake... i've got it working...

James Blibo
Replied On December 28, 2006 12:12 AM



In the DropDownUserCell class, the value is being saved to the underlying datasource in this override...

protected override bool OnSaveChanges()
{
string s = this.ddUser.GetValuesToString();

this.Grid.Model[this.RowIndex, this.ColIndex].Text = s;
return true;
}

I am trying to write to another column in the row, how can I do this by column name instead of row and col index.

I want to do something like

this.Grid.Model["colname"].Text = s;

Administrator [Syncfusion]
Replied On January 3, 2007 03:22 PM

Hi James,

Please try the following code snippet and let us know if you need any further assistance or demo sample on this issue.

>>>>>>>>Code Snippet<<<<<<<<<<
protected override bool OnSaveChanges()
{
string s = this.ddUser.GetValuesToString();
int val = this.Grid.Model.NameToColIndex("Col2");
this.Grid.Model[this.RowIndex, val].Text = s;
return true;
}
>>>>>>>>>>>>>><<<<<<<<<<<<<<<<

Have a nice day.

Best regards,
Madhan

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.

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.

;