Focus AddNewRow after committing row
Greetings,
Dim columnIndex = SfDataGrid1.TableControl.ResolveToScrollColumnIndex(SfDataGrid1.Columns.IndexOf(SfDataGrid1.Columns("MyColumn")))
SfDataGrid1.MoveToCurrentCell(New RowColumnIndex(SfDataGrid1.GetAddNewRowIndex, columnIndex))
SfDataGrid1.BeginEdit()
Is there a way to achieve this?
I'm using VB.Net and a DataTable with WinForms 18.3.0.47.
SIGN IN To post a reply.
7 Replies
1 reply marked as answer
DM
Dhanasekar Mohanraj
Syncfusion Team
December 22, 2020 12:10 PM UTC
Hi Jeremy,
Thank you for using Syncfusion controls.
We are little unclear with your requirement we suspect you need the AddNewRow is in BeginEdit stage even after committing the new record. If yes you can achieve this by SfDataGrid.TableControl.BeginInvoke method like below,
|
sfDataGrid.TableControl.BeginInvoke(New Action(Function() AnonymousMethod1(e)))
Private Function AnonymousMethod1(ByVal e As System.Collections.Specialized.NotifyCollectionChangedEventArgs) As Object
Dim columnIndex = sfDataGrid.TableControl.ResolveToScrollColumnIndex(sfDataGrid.Columns.IndexOf(sfDataGrid.Columns("OrderID")))
Dim rowIndex = sfDataGrid.GetAddNewRowIndex()
sfDataGrid.MoveToCurrentCell(New RowColumnIndex(rowIndex, columnIndex))
sfDataGrid.CurrentCell.BeginEdit()
Return Nothing
End Function |
We have prepared the sample for the same,
Sample link: https://www.syncfusion.com/downloads/support/forum/160848/ze/AddNewRow_Scroll-1068612338
Else can you please explain your scenario. We hope it helps please let us know f you need further assistance.
Regards,
Dhanasekar Mohanraj.
Dhanasekar Mohanraj.
Marked as answer
JE
Jeremy
December 22, 2020 12:55 PM UTC
Hi Dhanasekar,
You were correct in your assumption. The supplied snippet works perfectly.
Thanks for the quick response.
Regards
Jeremy
VS
Vijayarasan Sivanandham
Syncfusion Team
December 23, 2020 06:00 AM UTC
Hi Jeremy,
Thanks for the update.
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.
Regards,
Vijayarasan S
YG
Yvo G.
December 23, 2021 11:04 AM UTC
This looks great, I'd like to see the same in C# ?
VS
Vijayarasan Sivanandham
Syncfusion Team
December 23, 2021 01:31 PM UTC
Hi Yvo G,
Based on provided information we have prepared the sample for achieve your requirement.
Based on provided information we have prepared the sample for achieve your requirement.
Please have a look at this sample and let us know if you have any concerns in this.
Regards,
Regards,
Vijayarasan S
YG
Yvo G.
December 24, 2021 12:17 PM UTC
This indeed helps me out. Remarkably my own OLEDB-based project doesn't trigger any "sfDataGrid1.View.Records.CollectionChanged"
event from AddNewRow activities, so I had to make some changes and variations in order to
make things work for me.
Looking good so far. Thanks a lot !
VS
Vijayarasan Sivanandham
Syncfusion Team
December 27, 2021 03:28 AM UTC
Hi Yvo G,
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.
Regards,
Vijayarasan S
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you😊.
Regards,
Vijayarasan S
SIGN IN To post a reply.
- 7 Replies
- 4 Participants
- Marked answer
-
JE Jeremy
- Dec 21, 2020 06:17 PM UTC
- Dec 27, 2021 03:28 AM UTC