public MainPage()
{
InitializeComponent();
dataGrid.CellRenderers.Remove("Numeric");
dataGrid.CellRenderers.Add("Numeric", new GridCellNumericRendererExt());
dataGrid.CellRenderers.Remove("TextView");
dataGrid.CellRenderers.Add("TextView", new GridCellTextViewRendererExt());
dataGrid.CellRenderers.Remove("Picker");
dataGrid.CellRenderers.Add("Picker", new GridCellPickerRendererExt());
}
public class GridCellNumericRendererExt : GridCellNumericRenderer
{
public override void OnInitializeEditView(DataColumnBase dataColumn, SfNumericTextBoxExt view)
{
base.OnInitializeEditView(dataColumn, view);
//// Customize the margin for GridNumericColumn based on the requirement.
view.Margin = new Thickness(0, -5, 0, -5);
}
}
public class GridCellTextViewRendererExt : GridCellTextViewRenderer
{
public override void OnInitializeEditView(DataColumnBase dataColumn, SfEntry view)
{
base.OnInitializeEditView(dataColumn, view);
//// Customize the margin for GridTextColumn based on the requirement.
view.Margin = new Thickness(0, -5, 0, -5);
}
}
public class GridCellPickerRendererExt : GridCellPickerRenderer
{
public override void OnInitializeEditView(DataColumnBase dataColumn, GridPicker view)
{
base.OnInitializeEditView(dataColumn, view);
//// Customize the margin for GridPickerColumn based on the requirement.
view.Margin = new Thickness(0, -5, 0, -5);
}
}
|
The issue “DataGrid Columns elements not fully rendered in edit mode, if Grid row height reduced” can be solved at the sample level itself. Your requirement can be achieved by having a cell render class and customizing the margin while editing.
public MainPage(){InitializeComponent();dataGrid.CellRenderers.Remove("Numeric");dataGrid.CellRenderers.Add("Numeric", new GridCellNumericRendererExt());dataGrid.CellRenderers.Remove("TextView");dataGrid.CellRenderers.Add("TextView", new GridCellTextViewRendererExt());dataGrid.CellRenderers.Remove("Picker");dataGrid.CellRenderers.Add("Picker", new GridCellPickerRendererExt());}public class GridCellNumericRendererExt : GridCellNumericRenderer{public override void OnInitializeEditView(DataColumnBase dataColumn, SfNumericTextBoxExt view){base.OnInitializeEditView(dataColumn, view);//// Customize the margin for GridNumericColumn based on the requirement.view.Margin = new Thickness(0, -5, 0, -5);}}public class GridCellTextViewRendererExt : GridCellTextViewRenderer{public override void OnInitializeEditView(DataColumnBase dataColumn, SfEntry view){base.OnInitializeEditView(dataColumn, view);//// Customize the margin for GridTextColumn based on the requirement.view.Margin = new Thickness(0, -5, 0, -5);}}public class GridCellPickerRendererExt : GridCellPickerRenderer{public override void OnInitializeEditView(DataColumnBase dataColumn, GridPicker view){base.OnInitializeEditView(dataColumn, view);//// Customize the margin for GridPickerColumn based on the requirement.view.Margin = new Thickness(0, -5, 0, -5);}}You can download the sample for reference.Sample link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/SfGridSample2044592469Regards,Shivagurunathan.