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.

User update multiple rows in virtual grid. .

Thread ID:

Created:

Updated:

Platform:

Replies:

42922 Apr 10,2006 09:22 AM Apr 17,2006 03:44 AM Windows Forms 5
loading
Tags: GridControl
Adam K.
Asked On April 10, 2006 09:22 AM

I am using the SaveCellInfo event in a virtual grid to save information from a user change in the grid back into my data structure. A bunch of users want to replicate some excel functionality. Here are the steps in Excel: 1. Highlight cells A1:A5 2. Enter the value "abc" (it will show up in the cell A1. 3. Hit Cntl + Enter and "abc" is put in all cells from A1 to A5. So this is basically a shortcut to update 1 column in multiple rows at once. I want to replicate this in the virtual syncfusion grid. The issue is the that GridSaveCellInfoEventArgs has a rowIndex property. I essentially want this event to fire for all appropriate rows i guess. Please let me know if you have any suggestions. thanks, ak

Administrator [Syncfusion]
Replied On April 11, 2006 05:26 AM

Hi Adam, The indent behaviour can be achieved by using the CurrentCellKeyDown event. In this event, get the range information and accordingly fill it with the currentcell data on the corresponding key down. Code Snippet : private void gridControl1_CurrentCellKeyDown(object sender, System.Windows.Forms.KeyEventArgs e) { if ((e.KeyCode == Keys.Enter)&&(ModifierKeys & Keys.Control)!=0) { GridCurrentCell cc = this.gridControl1.CurrentCell; GridRangeInfo info = this.gridControl1.Selections.Ranges.ActiveRange; for(int i = info.Top; i<=info.Bottom ;i++) for(int j = info.Left; j<= info.Right;j++) this._extData[i-1,j-1] = int.Parse(cc.Renderer.ControlText); this.gridControl1.Refresh(); } } Best regards, Madhan

Adam K.
Replied On April 11, 2006 11:55 PM

Madhan, In your code, what is this._extData[i-1,j-1]. I am assuming this is your external data structure. I would like to have the code follow the SaveCellinfo code path so nothing else in the chain has to change. Any ideas. thks, ak >Hi Adam, > >The indent behaviour can be achieved by using the CurrentCellKeyDown event. In this event, get the range information and accordingly fill it with the currentcell data on the corresponding key down. > >Code Snippet : >private void gridControl1_CurrentCellKeyDown(object sender, System.Windows.Forms.KeyEventArgs e) >{ > if ((e.KeyCode == Keys.Enter)&&(ModifierKeys & Keys.Control)!=0) > { > GridCurrentCell cc = this.gridControl1.CurrentCell; > GridRangeInfo info = this.gridControl1.Selections.Ranges.ActiveRange; > for(int i = info.Top; i<=info.Bottom ;i++) > for(int j = info.Left; j<= info.Right;j++) > this._extData[i-1,j-1] = int.Parse(cc.Renderer.ControlText); > this.gridControl1.Refresh(); > } >} > >Best regards, >Madhan

Administrator [Syncfusion]
Replied On April 12, 2006 05:31 AM

Hi Adam, Please try using the following code snippet and let us know if this helps. this.gridControl1[i,j].CellValue = int.Parse(cc.Renderer.ControlText) Best regards, Madhan

Adam K.
Replied On April 16, 2006 05:04 PM

Madhan, this is very close. It seems to be firing the SaveCellinfo for each of the rows so all the dat is being updating. The only issue is that the current cell that i am actually typing in doesn''t commit. it shows the value i typed in but i have to hit enter again to commit to that cell. Any ideas? thks, ak >Hi Adam, > >Please try using the following code snippet and let us know if this helps. > >this.gridControl1[i,j].CellValue = int.Parse(cc.Renderer.ControlText) > >Best regards, >Madhan >

Administrator [Syncfusion]
Replied On April 17, 2006 03:44 AM

Hi Adam, Refer to the following sample which, demonstrates the currentcell being saved along with the other cells. Please give us some more details on this issue. Sample : VirtualGrid Thanks for being patience. 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.

;