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.

GBDG.Model[r, c].CellValue = x problem

Thread ID:





28390 May 1,2005 11:59 AM May 2,2005 10:02 AM Windows Forms 9
Tags: GridControl
Administrator [Syncfusion]
Asked On May 1, 2005 11:59 AM

Hi, decimal v = 5.5; this.gridDataBoundGrid1.Model[2, 9].CellValue = v; will set Model[1, 9] to the value also. whats going on?? dont think this happened in now using, occured in 3.2 also thanks in advance

Administrator [Syncfusion]
Replied On May 1, 2005 12:28 PM

Using 3.2.1, I tried this code and it displayed what I would expect to see with first line in the output window showing 123.123 and the second line showing the entry above it.
private void button1_Click(object sender, System.EventArgs e)

	this.gridDataBoundGrid1[2,3].CellValue = 123.123;
Are you using an hierarchical GridDataBoundGrid? If so, there are extra header rows for each levels that you would have to take into account. Can you upload a little sample showing the problem you are having, or tell us how to see the problem in one of our samples?

Administrator [Syncfusion]
Replied On May 1, 2005 01:10 PM

could you try putting it in a CurrentCellMoving event, see if that reproduces it.

Administrator [Syncfusion]
Replied On May 1, 2005 02:58 PM

Try setting DirectSaveCellInfo around setting the value to see if that takes care of this problem. this.gridDataBoundGrid1.Binder.DirectSaveCellInfo = true; this.gridDataBoundGrid1[2,3].CellValue = 123.123; this.gridDataBoundGrid1.Binder.DirectSaveCellInfo = false;

Administrator [Syncfusion]
Replied On May 1, 2005 05:44 PM

yep that fixed it. thanks

Administrator [Syncfusion]
Replied On May 1, 2005 06:04 PM

woops this caused another problem... i type a value in say 2,3 which now sets 2,9 properly but 2,3 gets reset to the old value after the recalc. its a currency cell set to % if that makes a difference. gbcc["Percentage"].StyleInfo.CellType = "Currency"; gbcc["Percentage"].StyleInfo.CellValueType = typeof(string); gbcc["Percentage"].StyleInfo.Format = "C"; gbcc["Percentage"].StyleInfo.CurrencyEdit.NullString = "0.00 %"; gbcc["Percentage"].StyleInfo.CurrencyEdit.CurrencyNegativePattern = 5; gbcc["Percentage"].StyleInfo.CurrencyEdit.CurrencyPositivePattern = 3; gbcc["Percentage"].StyleInfo.CurrencyEdit.CurrencySymbol = "%"; gbcc["Percentage"].StyleInfo.CurrencyEdit.ClipMode = Syncfusion.Windows.Forms.Tools.CurrencyClipModes.ExcludeFormatting;

Administrator [Syncfusion]
Replied On May 1, 2005 06:58 PM

Try moving your code from CurrentCellMoving to CurrentCellMoved.
private void gridDataBoundGrid1_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
	GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
	if(cc.MoveFromColIndex == 2)
		this.gridDataBoundGrid1.Binder.DirectSaveCellInfo = true;
		this.gridDataBoundGrid1[cc.MoveFromRowIndex,3].CellValue = 123.123;
		this.gridDataBoundGrid1.Binder.DirectSaveCellInfo = false;

Administrator [Syncfusion]
Replied On May 1, 2005 11:25 PM

that wont work because i need the row col before the move. i''d recommend these two issues get fixed ASAP anyway, so i''ll wait for a fix in my direct track, we are going to prod now so sooner the better. thanks

Administrator [Syncfusion]
Replied On May 2, 2005 03:50 AM

The CurrentCell.MoveFromRowIndex and CurrentCell.MovefromColIndex that I used in my snippet give you the current row and column index from before the move in CurrentCellMoved. If you want to do this from CurrentCellMoving, the call this.gridDataBoundGrid1.CurrentCell.ConfirmChanges(); to save the changes on the CurrentCell before you set DirectSaveCellInfo to true to change the other value.

Administrator [Syncfusion]
Replied On May 2, 2005 10:02 AM

yes adding this.gridDataBoundGrid1.CurrentCell.ConfirmChanges(); works fine thanks again


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.