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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





28390 May 1,2005 03:59 PM UTC May 2,2005 02:02 PM UTC WinForms 9
Tags: GridControl
Administrator [Syncfusion]
Asked On May 1, 2005 03:59 PM UTC

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 04:28 PM UTC

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 05:10 PM UTC

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

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

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 09:44 PM UTC

yep that fixed it. thanks

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

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 10:58 PM UTC

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 2, 2005 03:25 AM UTC

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 07:50 AM UTC

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 02:02 PM UTC

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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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