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.

Minor issues in grouping grid foreign key reference

Thread ID:

Created:

Updated:

Platform:

Replies:

28055 Apr 22,2005 07:03 AM Apr 24,2005 05:10 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On April 22, 2005 07:03 AM

1. I have a foreign key reference (similar to the ForeignKeyReference example) where the displayed column is a name while the key column is a number. If I paste something to the displayed name column I get a format error. It seems that the pasted value go directly to the numeric key column instead of using the lookup mechanism. The behaviour of the control is fine when I type in the name instead of pasting. A similar behaviour is seen in the ForeingKeyReference example. In that case the pasted value is lost, but there is no error message. Is there a simple way to make pasting to foreign key columns work? 2. When I double click a foreign key column, the value changes. I think this is a bit confusising and can easily make the user change the value by accident, e.g. when trying to select. Is there a simple way to disable this behaviour?

Administrator [Syncfusion]
Replied On April 22, 2005 08:52 AM

1)I see this behavior and will forwarded it to the grid architect to see if this is something we can address in a future release. If you want to handle it now, one can subscribe to the this.gridGroupingControl1.TableModel.PasteCellText event. In the handler, check the string value in e.Text and convert it to a string holding the proper key. 2) Try handling the this.gridGroupingControl1.TableModel.QueryCellModel event. There you can set a property to avoid this behavior.
private void TableModel_QueryCellModel(object sender, GridQueryCellModelEventArgs e)
{
	if(e.CellType == "ForeignKeyCell")
	{
		GridTableDropDownListCellModel model = new GridTableDropDownListCellModel(e.GridModel);
		model.AllowDoubleClickChangeSelectedIndex = false;
		e.CellModel = model;
	}
}

Administrator [Syncfusion]
Replied On April 24, 2005 05:10 AM

1) For now I simply decided to prevent paste to foreign key cells. Since I typically sort on these cells, a proper handeling of paste would also need to adress the sorting issue I have mentioned in a previous post. 2) Works perfectly, Thanks.

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.

;