BoldSignA modern eSignature application with affordable pricing. Sign up today for unlimited document usage!
Hi Joshua,
Thanks for contacting Syncfusion.
We have analyzed your query and we can achieve your
requirement by using the below code.
Please refer the following code snippet.
Code Snippet:
void View_CollectionChanged(object
sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs
e) {
if(NotifyCollectionChangedAction.Add==e.Action)
{ var index = e.NewStartingIndex;
var rowIndex = this.GridDataControl1.Model.ResolvePositionToIndex(index);
var record=e.NewItems[0] as Person;
var records = this.GridDataControl1.Model.View.Records;
var result = from
c in records
where (c.Data as
Person).No == record.No
select c;
if (result.Count() >= 2)
{
this.GridDataControl1.Model.Grid.CurrentCell.MoveTo(rowIndex,1);
this.GridDataControl1.Model.Grid.CurrentCell.BeginEdit();
}
else
{
this.GridDataControl1.Model.Grid.CurrentCell.MoveTo(rowIndex,
0);
this.GridDataControl1.Model.Grid.CurrentCell.BeginEdit();
} } } |
We can get the exact record position by listening the
Collection Changed event, even the grid is in sort.
And I have moved the current cell to that new record
position by using MoveTo method. If the newly added record contains a unique No
means the current cell position moved to the first column,
if it’s a duplicate row, then it moves to the second column.
We have prepared a sample based on your requirement. Please
find the sample from the below location.
Sample: GridDataControl
Row Positioning.zip
Please let us know, if you have any queries.
Thanks,
Shakul Hameed
Hi Joshua,
Thanks for your update.
Please let us know if you require further assistance from us.
Shakul Hameed