update row on SaveCellinfo . .
If i want to refresh an entire row due to a user changing a cell where do i put the refresh range. do i put it in the SaveCellInfo Event. For example should my code look like this: (if the user changes any cell in row 3 i want the whole row to refresh . .
private void gridControl1_SaveCellInfo(object sender,Syncfusion.Windows.Forms.Grid.GridSaveCellInfoEventArgs e)
{
if(e.RowIndex > 0 && e.ColIndex > 0)
{
this.dt.Rows[e.RowIndex -1][e.ColIndex -1] = e.Style.CellValue;
e.Handled = true;
if (e.RowIndex == 3)
gridControl.RefreshRange(etc . . )
}
}
SIGN IN To post a reply.
7 Replies
ST
stanleyj
Syncfusion Team
February 8, 2006 08:51 AM UTC
Hi Adam,
private void gridControl1_SaveCellInfo(object sender,Syncfusion.Windows.Forms.Grid.GridSaveCellInfoEventArgs e)
{
if(e.RowIndex > 0 && e.ColIndex > 0)
{
this.dt.Rows[e.RowIndex -1][e.ColIndex -1] = e.Style.CellValue;
e.Handled = true;
//if (e.RowIndex == 3)
//gridControl.RefreshRange(etc . . )
}
}
Such codes are not necessary there. Please let us know what you would like to do to the values of row 3 after editing. In other words what problem are you facing without those codes in the SaveCellInfo.
Best regards,
Stanley
AD
Administrator
Syncfusion Team
February 9, 2006 04:32 AM UTC
i want to find out the recommended way of having an entire row refresh when a user changes a cell within that row. .
thks,
ak
>Hi Adam,
>
>private void gridControl1_SaveCellInfo(object sender,Syncfusion.Windows.Forms.Grid.GridSaveCellInfoEventArgs e)
>{
>if(e.RowIndex > 0 && e.ColIndex > 0)
>{
>this.dt.Rows[e.RowIndex -1][e.ColIndex -1] = e.Style.CellValue;
>e.Handled = true;
>//if (e.RowIndex == 3)
>//gridControl.RefreshRange(etc . . )
>}
>}
>
>
>Such codes are not necessary there. Please let us know what you would like to do to the values of row 3 after editing. In other words what problem are you facing without those codes in the SaveCellInfo.
>
>Best regards,
>Stanley
AD
Administrator
Syncfusion Team
February 9, 2006 12:16 PM UTC
Hi Adam,
If you want to call the refresh range when the user changes the data then use the following code snippet
bool flag;
private void gridControl1_CurrentCellEditingComplete(object sender, EventArgs e)
{
if(flag)
{
this.gridControl1.RefreshRange(GridRangeInfo.Row(this.gridControl1.CurrentCell.RowIndex));
flag = false;
}
}
private void gridControl1_CurrentCellChanging(object sender, System.ComponentModel.CancelEventArgs e)
{
flag = true;
}
Refer to this sample for details
Regards,
Madhan
AD
Administrator
Syncfusion Team
February 10, 2006 12:15 AM UTC
why is this better than calling the refresh range in the SaveCellInfo event . .??
thks,
ak
>Hi Adam,
>
> If you want to call the refresh range when the user changes the data then use the following code snippet
>
> bool flag;
> private void gridControl1_CurrentCellEditingComplete(object sender, EventArgs e)
> {
> if(flag)
> {
> this.gridControl1.RefreshRange(GridRangeInfo.Row(this.gridControl1.CurrentCell.RowIndex));
> flag = false;
> }
> }
> private void gridControl1_CurrentCellChanging(object sender, System.ComponentModel.CancelEventArgs e)
> {
> flag = true;
> }
>
>Refer to this sample for details
>
>Regards,
>Madhan
AD
Administrator
Syncfusion Team
February 10, 2006 11:34 AM UTC
Hi,
The savecellinfo event is fired everytime you change the Style of the Object (like Changing the Color,etc ). But , the currentCellCompleteChanges Fires only changes in the Cell text, and this event matches this scenario. I hope you have a clear idea of this.
Regards,
Madhan.
HZ
Hui Zhong
February 22, 2006 09:52 PM UTC
I tried CurrentCellEditingComplete event, however, if it''s a checkbox cell, you have to move the cursor after you click to check/uncheck to have the CurrentCellEditingComplete event to be raised. Click the cell will not raise the CurrentCellEditingComplete event.
>Hi,
>
> The savecellinfo event is fired everytime you change the Style of the Object (like Changing the Color,etc ). But , the currentCellCompleteChanges Fires only changes in the Cell text, and this event matches this scenario. I hope you have a clear idea of this.
>
>Regards,
>Madhan.
AD
Administrator
Syncfusion Team
February 23, 2006 05:03 AM UTC
Hi Hui,
The CurrentCellEditingComplete event will be triggered only when the control focus leaves the cell / grid and this is by design. If you want to check the changes in the checkbox ( check / uncheck ) there is a CheckBoxClick event. The CurrentCellChanged event can also be used but, it will be raised for the changes in all types of cells.
Best Regards,
Madhan.
SIGN IN To post a reply.
- 7 Replies
- 4 Participants
-
AK Adam K.
- Feb 8, 2006 03:57 AM UTC
- Feb 23, 2006 05:03 AM UTC