DataGridView behavior?


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I am working with a DataGridView which is giving me a lot of headache BigGrin.



The end use needs to modify data in 2 consecutives columns of this DataGridView, and I am having the following issues:

1- When press Enter key, I want the cursor to move to the 2nd column (like when pressing the Tab key), but instead it is going to the next row.

2 - Still I am having problem with the BBS not synchronizing with the BBS BO, for now I had to add code to the DataGridView.RowEnter to handle this, but when I edit a cell, the value is not reflected in the BO.Field assigned to that cell, so in my validation code I have to assign the value of the cell to the BO.Field. Is this the way the DataGridView suppose to work?



I really appreciate some inside on this one since I am waisting a lot of time trying to make this DataGridView work. Unfortunately in this case I can not use a ListView because it would be very difficult to the end user to handle the data for the 2 columns that needs to be editable.w00t

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
1- When press Enter key, I want the cursor to move to the 2nd column (like when pressing the Tab key), but instead it is going to the next row.




You will have to code this yourself. You will have to capture this keystroke and then programatically manage the behavior you want.



2 - Still I am having problem with the BBS not synchronizing with the BBS BO, for now I had to add code to the DataGridView.RowEnter to handle this, but when I edit a cell, the value is not reflected in the BO.Field assigned to that cell, so in my validation code I have to assign the value of the cell to the BO.Field. Is this the way the DataGridView suppose to work?




No. If this were the case, then it would really make binding pretty pointless. If you can figure out your indexing issue that we were not able to reproduce with the same sample you sent, then you can most likely get this resolved as well.



Also, you will want to be sure to update the bound contents on PropertyChanged versus on validation.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Trent L. Taylor (06/01/2009)
Also, you will want to be sure to update the bound contents on PropertyChanged versus on validation.




Humm, I can not find where to do this change, could you provide some hint?Wink

Edhy Rijo

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
I tried this code in the form's New() but did not make any difference:



Public Sub New()

' This call is required by the Windows Form Designer.

InitializeComponent()





'-- Ensure that the home page is initially shown.

pmMain.SetActivePage(PageHome)



Me.DataGridView1.DataBindings.DefaultDataSourceUpdateMode = DataSourceUpdateMode.OnPropertyChanged

End Sub





Am I in the right path here?

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Yeah...that looks good.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search