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. Image for the cookie policy date
close icon

Grid Data Control Row

Hello

Is there any way where I am able to change the height of the row when the user is editing a cell?

Thank you


3 Replies

EJ Elisha John October 5, 2010 12:27 PM UTC

Hi

Are there any other ways where I can expand the cell size of what the user wants to edit, and shrink it back to normal when the user is done editing?

Thank you



JJ Jeraldes J Syncfusion Team October 13, 2010 05:18 AM UTC

Hi Elisha,

Thanks for using Syncfusion Products.

We have developed a sample for changing the size of the row when it is double clicked for editing and then changing back to the original size when the edit is completed.

Please refer the code snippet and the sample from the following.

[code snippet]

this.dataGrid.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(dataGrid_PreviewMouseLeftButtonDown);
this.dataGrid.CurrentCellEditingComplete += new Syncfusion.Windows.ComponentModel.GridRoutedEventHandler(dataGrid_CurrentCellEditingComplete);
}

void dataGrid_CurrentCellEditingComplete(object sender, Syncfusion.Windows.ComponentModel.SyncfusionRoutedEventArgs args)
{
GridDataControl grid = sender as GridDataControl;

if (grid != null)
{
GridCurrentCell cc = grid.Model.Grid.CurrentCell;
this.dataGrid.Model.RowHeights[cc.RowIndex] = 20d;
this.dataGrid.Model.InvalidateCell(GridRangeInfo.Table());
this.dataGrid.Model.InvalidateVisual(true);
}
}

void dataGrid_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
var index=this.dataGrid.Model.Grid.PointToCellRowColumnIndex(e);
if (e.ClickCount==2 && this.dataGrid.Model[index.RowIndex,index.ColumnIndex].CellType!="HeaderCell")
{
this.dataGrid.Model.RowHeights[index.RowIndex] = 200d;
this.dataGrid.Model.CurrencyManager.BeginEdit(index.RowIndex);
this.dataGrid.Model.InvalidateCell(GridRangeInfo.Table());
this.dataGrid.Model.InvalidateVisual(true);
}

}

[Sample Link]




Let us know if you need any other details.

Regards,
Jeraldes J




JJ Jeraldes J Syncfusion Team October 13, 2010 05:19 AM UTC

Hi Elisha,

Sorry for not attaching the sample.

Please find the attached sample from the following link.

http://www.syncfusion.com/uploads/redirect.aspx?file=GDC-RowEdit-HeightChange-96774_8dfde9bc.zip&team=development

Let us know if you need any other details.

Regards,
Jeraldes J



Loader.
Live Chat Icon For mobile
Up arrow icon