I have created a grid using the UltraWinGrid Quick start.
For the data schema I select “Bind the control to an existing data source now.
I select the data source – Which in the Band Preview screen displays the columns
Using all the defaults get to finish.
When I run debugging. The grid displays with all the correct columns but no data.
Below is the code created by the Quick Start along with the TableAdapter info
Public Class Form2
Private Property SfworkdataTableAdapter As Object
Private Sub Form2_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'PuhsdDataSet.sfworkdata' table. You can move, or remove it, as needed.
Me.SfworkdataTableAdapter.Fill(Me.PuhsdDataSet.sfworkdata)
End Sub
Private Function PuhsdDataSet() As Object
Throw New NotImplementedException
End Function
Private Sub UltraGrid1_InitializeLayout(sender As System.Object, e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles UltraGrid1.InitializeLayout
End Class
Hello Melody,
What does the sfworkdata consist of? Can you provide an isolated sample that reproduces the behavior you are describing?
If you are seeing columns, but no rows, then my guess is that your data source has no rows and it's nothing to do with the grid.
Check Me.PuhsdDataSet.sfworkdata.Rows.Count and see if there are any rows in your data table.
Thanks Michael and Mike. Checked the table and yes there was data. I was able to resolve it. This is the code that worked.
Me.Validate()
Me.SfworkdataBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.PuhsdDataSet)
Thanks for all the suggestions
Great! Let us know if you have any additional questions.
Of course I do. I now display the data and can edit the cells, however how do I get it to save back to the data base. I tried to just create a button with this code but does not work.
Private Sub UltraButton1_Click(sender As System.Object, e As System.EventArgs) Handles UltraButton1.Click
I get this error message:
Update requires a valid UpdateCommand when passed DataRow collection with modified rows."}
Helo Melody,
Try and use Update(Me.PushDataSet) instead.
You can call UpdateData() method, exposed from the UltraWinGrid, which will update any modified information sending it to your data provider.
For more information please refer to our documentation here:
http://tinyurl.com/otqz78a
I recommend reviewing this forum post where a similar discussion was held:
http://www.infragistics.com/community/forums/t/57161.aspx
Let me know if you have any additional questions.
Sorry to be a bother but could you provide me with an example of how that would look in my code? I'm really new to VB.
Please replace
with
Me.TableAdapterManager.Update(Me.PuhsdDataSet)
Let me know if you have any questions.
For more details, we have a knowledge base article that explains.
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1104
Michael,
Thanks for the suggestion, however I get the following error message:
Error 1 'Update' is not a member of 'SubFinder.puhsdDataSetTableAdapters.TableAdapterManager'
Also the link provided does not work.
Mleody
Our KB article is best viewed in chrome. It mentions that in order to update the changes for the parent and child table, the Update method needs to called on each table in the DataSet. You may want to make sure the table is updated.
ex. (Me.TableAdapterManager.Update(Me.PuhsdDataSet.TABLE) 'sfworkdata
However the message you are receiving can stem from several causes. I recommend reviewing some articles I came across on MSDN,
http://social.msdn.microsoft.com/Forums/vstudio/en-US/8295ea64-f2c0-4e2b-ae7d-48c98e88c44b/update-is-not-a-member-of-tableadapter?forum=vbgeneral
http://social.msdn.microsoft.com/Forums/en-US/ee7a340f-dd22-48a1-b1d4-257d3e8a06c1/update-is-not-a-member-of-datasettableadapterstableadapter?forum=vbgeneral
Let me know if you have any quesitons.