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

put the row where you add in the botton of the grid

I would like to put the line where you insert a new record at the end of the grid. It's possible ?

1 Reply

AA Arulraj A Syncfusion Team December 4, 2018 06:26 AM UTC

Hi Ricardo, 

Thanks for using Syncfusion product. 

To add the line when insert the record in GridGroupingControl, you could use the SourceListRecordChanged event to get the newly added record and use the QueryCellStyleInfo event to set the border for that record. Please refer the following code example and the sample, 

Code example 
this.gridGroupingControl1.SourceListRecordChanged += GridGroupingControl1_SourceListRecordChanged; 
this.gridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo; 
 
List<Record> newRecords = new List<Record>(); 
private void GridGroupingControl1_SourceListRecordChanged(object sender, Syncfusion.Grouping.RecordChangedEventArgs e) 
{ 
    if(e.Action == Syncfusion.Grouping.RecordChangedType.Added) 
    { 
        newRecords.Add(e.Record); 
    } 
} 
 
private void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) 
{ 
    if (e.TableCellIdentity == null || e.TableCellIdentity.Column == null) 
        return; 
 
    if (e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record) 
    { 
        var record = e.TableCellIdentity.DisplayElement.GetRecord(); 
        if (record != null && newRecords.Contains(record)) 
        { 
            e.Style.Borders.Top = new GridBorder(GridBorderStyle.Solid, Color.Blue); 
        } 
    } 
} 
 
 

Let us know whether this helps also if you need any further assistance on this. 

Arulraj A 


Loader.
Live Chat Icon For mobile
Up arrow icon