DataGridView question


Author
Message
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
I have a DataGridView that is loaded with data from a readonly SQL view (actually via a SF BO). However, I do need to allow edits. I'd like to just react to the edit event, do my own thing (update data myself), cancel the editing that the datagridview attempts (which will fail), then update the gridview so it shows the new data. I'm sure this is easy, but I can't seem to get a handle on it. Ideas?
Replies
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
If I set the datasource of the grid to a datatable retrieved from a GetDataTable function in the BO, is the table still linked back to the source data?



If it isn't, then I could change the bound column, but the change wouldn't attempt to propagate back to the db.
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
No, if you bind the return value of the GetDataTable to the grid, the grid will not be bound to the business object.
Greg McGuffey
Greg McGuffey
Strategic Support Team Member (4.8K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
OK, I got it to work! w00t



I used a DataGridViewButtonColomn. The rules involved were too complicated to just allow the user to select a value anyway. In the CellContentClick event handler, I can call the stored procedure (via a BO of course), and then update the BO no problems.



If I had to allow the user to select a value, I'd probably try configuring the readonly BO to allow updates via a stored procedure.



That was a tough one! Thanks!
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Not sure that I helped much, but I might have made you look in a few new directions... glad you got it working Smile
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Greg McGuffey - 19 Years Ago
StrataFrame Team - 19 Years Ago
Greg McGuffey - 19 Years Ago
StrataFrame Team - 19 Years Ago
Greg McGuffey - 19 Years Ago
                         OK, I've figured out how get the stored procedure to...
Greg McGuffey - 19 Years Ago
                             I also tried setting the DataSource to a datatable and I get an error,...
Greg McGuffey - 19 Years Ago
                                 You might have to do something like change the bound column in the...
StrataFrame Team - 19 Years Ago
                                     If I set the datasource of the grid to a datatable retrieved from a...
Greg McGuffey - 19 Years Ago
                                         No, if you bind the return value of the GetDataTable to the grid, the...
StrataFrame Team - 19 Years Ago
                                             OK, I got it to work! :w00t:

I used a...
Greg McGuffey - 19 Years Ago
                                                 Not sure that I helped much, but I might have made you look in a few...
StrataFrame Team - 19 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search