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.

GridGroupingControl and Static CellTypes

Thread ID:

Created:

Updated:

Platform:

Replies:

48159 Aug 21,2006 12:47 PM Aug 22,2006 08:55 AM Windows Forms 2
loading
Tags: GridControl
John Patterson
Asked On August 21, 2006 12:47 PM

I am utilizing a GridGroupingControl which is bound to an ArrayList of custom objects. In addition to setting the data source of the grid, I am specifying different properties to modify the appearance and behavior of the grid.

One of the items I am (attempting to) modify is the cell type of the record cells. Because the grid is intended to be read-only, I would like to conver the cell types from the default rendered cell types (i.e. textboxes, checkboxes, etc.) to a cell type of "Static".

I am using the following code.

ArrayList list = this.GetSampleData();
this.grdPrimary.DataSource = list;

// turn off the "add new record" row
this.grdPrimary.TopLevelGroupOptions.ShowAddNewRecordBeforeDetails=false;
this.grdPrimary.TopLevelGroupOptions.ShowAddNewRecordAfterDetails=false;
this.grdPrimary.ChildGroupOptions.ShowAddNewRecordBeforeDetails=false;
this.grdPrimary.ChildGroupOptions.ShowAddNewRecordAfterDetails=false;

// make the entire grid read-only, single row selection, other items
this.grdPrimary.Appearance.AnyCell.ReadOnly=true;
this.grdPrimary.TableOptions.ListBoxSelectionMode=SelectionMode.One;
this.grdPrimary.Appearance.RecordFieldCell.CellAppearance=GridCellAppearance.Flat;
this.grdPrimary.Appearance.AnyRecordFieldCell.CellType="Static";
this.grdPrimary.Appearance.AnyRecordFieldCell.ReadOnly=true;

// get rid of the unnecessary header items
this.grdPrimary.TableOptions.ShowRowHeader=false;
this.grdPrimary.TopLevelGroupOptions.ShowCaption=false;

There are no unhandled exceptions being generated, and the other items process as expected. For instance, even though the "Static" cell type is not being applied, I cannot modify any values in the grid due to the "read-only=true" being specified.

Can you tell me what might be causing the GridGroupingControl to ignore the call to set all Record Field Cells to ''CellType="Static"'' and rendering as the default editor controls?

Thanks for any assistance you can provide.

Administrator [Syncfusion]
Replied On August 22, 2006 01:11 AM

Hi John,

By Default, the Static CellType will display text that cannot be edited. You can select it to make it the current cell but, the cell cannot be activated for editing. Static cells can be deleted by the user if the static cells are part of the selection when the delete key is pressed. (To prevent this deletion behavior, set static cells to Read-only.) Static cells may also include an image in addition to the text. Try the below code snippet.

this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.CellType="Static";

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GGCArrayList_f06c2b68.zip

Let me know if this helps.
Best Regards,
Haneef

John Patterson
Replied On August 22, 2006 08:55 AM

Hi Haneef,

That seems to resolve my issue. Thanks for your help!

>Hi John,

By Default, the Static CellType will display text that cannot be edited. You can select it to make it the current cell but, the cell cannot be activated for editing. Static cells can be deleted by the user if the static cells are part of the selection when the delete key is pressed. (To prevent this deletion behavior, set static cells to Read-only.) Static cells may also include an image in addition to the text. Try the below code snippet.

this.gridGroupingControl1.TableDescriptor.Appearance.AnyRecordFieldCell.CellType="Static";

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/GGCArrayList_f06c2b68.zip

Let me know if this helps.
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.

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.

;