Stuck on how to update EpiUltraGrid

Well........
What I have is a bunch of textboxes in a group control that is the same size as the ultra grid, when user clicks new button, the group becomes visible and then they can enter the data in the fields and click a save button.

The save code: I use key 2 as line number as key 1 is the part number and there can be multiple UD10's per part so some of the code gets an incremented number for the key2 value

Private Sub btnNewSave_Click(ByVal Sender As Object, ByVal Args As System.EventArgs) Handles btnNewSave.Click
'// ** Place Event Handling Code Here **
dim intNewRow As Integer
dim intRowCount As Integer = ugdEpiCustom1.Rows.Count
If(intRowCount>0) Then
ugdEpiCustom1.Rows(intRowCount-1).Selected = True
intNewRow = Integer.Parse(ugdEpiCustom1.Selected.Rows(0).Cells("Key2").Value.ToString()) + 1
Else
intNewRow = 1
End If
Try
dim udAdapter As UD10Adapter = New UD10Adapter(PartForm)
dim udConnected As Boolean = udAdapter.BOConnect()
dim newUD10 as Boolean = udAdapter.GetaNewUD10()
udAdapter.UD10Data.Tables("UD10").Rows(0)("Key1") = edvPart.dataView(0)("PartNum").ToString()
udAdapter.UD10Data.Tables("UD10").Rows(0)("Key2") = intNewRow.ToString()
udAdapter.UD10Data.Tables("UD10").Rows(0)("Key3") = String.Empty
udAdapter.UD10Data.Tables("UD10").Rows(0)("Key4") = String.Empty
udAdapter.UD10Data.Tables("UD10").Rows(0)("Key5") = String.Empty
udAdapter.UD10Data.Tables("UD10").Rows(0)("ShortChar01") = txtNewManufacturer.Text
udAdapter.UD10Data.Tables("UD10").Rows(0)("ShortChar02") = txtNewMfrItem.Text
udAdapter.UD10Data.Tables("UD10").Rows(0)("ShortChar03") = txtNewSpec.Text
udAdapter.UD10Data.Tables("UD10").Rows(0)("CheckBox01") = chkEpiCustom2.Checked
udAdapter.UD10Data.Tables("UD10").Rows(0)("CheckBox02") = chkEpiCustom3.Checked
udAdapter.Update()
udAdapter.Dispose()
GetUD10Record(edvPart.dataView(0)("PartNum").ToString(),"","","","")
btnNewMItem.Enabled = True
oTrans.Refresh()
Catch ex As Exception
MessageBox.Show(intNewRow.ToString() + " " + ex.ToString())
End Try
End Sub

--- In vantage@yahoogroups.com, Steven Gotschall <sgotschall@...> wrote:
>
> Thanks. That worked great.ÂÂ
>
> My next step is to create a button which will add a new record to my ultragrid, fill out some of the fields with data, and save the results back to the table. You wouldn't happen to have a code sample of this?ÂÂ
>
>
>
>
> ________________________________
> From: bw2868bond <bwalker@...>
> To: vantage@yahoogroups.com
> Sent: Mon, May 17, 2010 3:24:11 PM
> Subject: [Vantage] Re: Stuck on how to update EpiUltraGrid
>
> ÂÂ
> Here is some code I have that updates UD10 if data changes - modify to your Table/Form......
>
> Private Sub ugdEpiCustom1_AfterCellUpdate(ByVal Sender As Object, ByVal Args As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles ugdEpiCustom1.AfterCellUpdate
>
> dim key1 As String = args.cell.row.cells("Key1").value
> dim key2 As String = args.cell.row.cells("Key2").value
> dim key3 As String = args.cell.row.cells("Key3").value
> dim key4 As String = args.cell.row.cells("Key4").value
> dim key5 As String = args.cell.row.cells("Key5").value
> dim field As String = args.cell.column.key
> Dim udAdapter As UD10Adapter = New UD10Adapter(PartForm)
> Dim udConnected As Boolean = udAdapter.BOConnect()
>
> dim Success As Boolean = udAdapter.GetById(key1,key2,key3,key4,key5)
>
> If(Success) Then
> udAdapter.UD10Data.Tables("UD10").Rows(0)(field) = args.cell.row.cells(field).value
> udAdapter.Update()
> End If
> udAdapter.Dispose()
> End Sub
>
> --- In vantage@yahoogroups.com, "Steven" <sgotschall@> wrote:
> >
> > I have an EpiUltraGrid on the UD105 form which I have bound to UD15 when the EpiViewNotification is triggered. It works great to view the related data in the UD15 table. I am now stuck on how I can write back any changes made to data on the EpiUltraGrid back to the table UD15. Here is my code so far:
> >
> > Dim adaUD15Adapter As UD15Adapter = New UD15Adapter(UD105Form)
> > adaUD15Adapter.BOConnect()
> > Dim optsUD15 As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> > If (args.Row > -1) Then
> > optsUD15.NamedSearch.WhereClauses.Add("UD15", "Company = '" & view.dataView(args.Row)("Company") & "' AND Key1 = '" & view.dataView(args.Row)("ChildKey1") & "'")
> > Dim MorePagesUD15 As Boolean
> > Dim dsUD15Adapter As Data.DataSet = adaUD15Adapter.GetRows(optsUD15, MorePagesUD15)
> > adaUD15Adapter.Dispose()
> > ugdUD15.DataSource = dsUD15Adapter.Tables("UD15")
> > ugdUD15.DataMember = "UD15"
> > Else
> > optsUD15.NamedSearch.WhereClauses.Add("UD15", "Company = ''")
> > Dim MorePagesUD15 As Boolean
> > Dim dsUD15Adapter As Data.DataSet = adaUD15Adapter.GetRows(optsUD15, MorePagesUD15)
> > adaUD15Adapter.Dispose()
> > ugdUD15.DataSource = dsUD15Adapter.Tables("UD15")
> > End If
> > ugdUD15.DisplayLayout.Bands(0).Columns("Company").Hidden = True
> > ugdUD15.DisplayLayout.Bands(0).Columns("Key1").Header.Caption = "Quote Number"
> > ugdUD15.Update()
> > ugdUD15.Refresh()
> >
>
>
>
>
>
>
>
> [Non-text portions of this message have been removed]
>
I have an EpiUltraGrid on the UD105 form which I have bound to UD15 when the EpiViewNotification is triggered. It works great to view the related data in the UD15 table. I am now stuck on how I can write back any changes made to data on the EpiUltraGrid back to the table UD15. Here is my code so far:

Dim adaUD15Adapter As UD15Adapter = New UD15Adapter(UD105Form)
adaUD15Adapter.BOConnect()
Dim optsUD15 As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
If (args.Row > -1) Then
optsUD15.NamedSearch.WhereClauses.Add("UD15", "Company = '" & view.dataView(args.Row)("Company") & "' AND Key1 = '" & view.dataView(args.Row)("ChildKey1") & "'")
Dim MorePagesUD15 As Boolean
Dim dsUD15Adapter As Data.DataSet = adaUD15Adapter.GetRows(optsUD15, MorePagesUD15)
adaUD15Adapter.Dispose()
ugdUD15.DataSource = dsUD15Adapter.Tables("UD15")
ugdUD15.DataMember = "UD15"
Else
optsUD15.NamedSearch.WhereClauses.Add("UD15", "Company = ''")
Dim MorePagesUD15 As Boolean
Dim dsUD15Adapter As Data.DataSet = adaUD15Adapter.GetRows(optsUD15, MorePagesUD15)
adaUD15Adapter.Dispose()
ugdUD15.DataSource = dsUD15Adapter.Tables("UD15")
End If
ugdUD15.DisplayLayout.Bands(0).Columns("Company").Hidden = True
ugdUD15.DisplayLayout.Bands(0).Columns("Key1").Header.Caption = "Quote Number"
ugdUD15.Update()
ugdUD15.Refresh()
Here is some code I have that updates UD10 if data changes - modify to your Table/Form......

Private Sub ugdEpiCustom1_AfterCellUpdate(ByVal Sender As Object, ByVal Args As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles ugdEpiCustom1.AfterCellUpdate

dim key1 As String = args.cell.row.cells("Key1").value
dim key2 As String = args.cell.row.cells("Key2").value
dim key3 As String = args.cell.row.cells("Key3").value
dim key4 As String = args.cell.row.cells("Key4").value
dim key5 As String = args.cell.row.cells("Key5").value
dim field As String = args.cell.column.key
Dim udAdapter As UD10Adapter = New UD10Adapter(PartForm)
Dim udConnected As Boolean = udAdapter.BOConnect()

dim Success As Boolean = udAdapter.GetById(key1,key2,key3,key4,key5)

If(Success) Then
udAdapter.UD10Data.Tables("UD10").Rows(0)(field) = args.cell.row.cells(field).value
udAdapter.Update()
End If
udAdapter.Dispose()
End Sub

--- In vantage@yahoogroups.com, "Steven" <sgotschall@...> wrote:
>
> I have an EpiUltraGrid on the UD105 form which I have bound to UD15 when the EpiViewNotification is triggered. It works great to view the related data in the UD15 table. I am now stuck on how I can write back any changes made to data on the EpiUltraGrid back to the table UD15. Here is my code so far:
>
> Dim adaUD15Adapter As UD15Adapter = New UD15Adapter(UD105Form)
> adaUD15Adapter.BOConnect()
> Dim optsUD15 As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> If (args.Row > -1) Then
> optsUD15.NamedSearch.WhereClauses.Add("UD15", "Company = '" & view.dataView(args.Row)("Company") & "' AND Key1 = '" & view.dataView(args.Row)("ChildKey1") & "'")
> Dim MorePagesUD15 As Boolean
> Dim dsUD15Adapter As Data.DataSet = adaUD15Adapter.GetRows(optsUD15, MorePagesUD15)
> adaUD15Adapter.Dispose()
> ugdUD15.DataSource = dsUD15Adapter.Tables("UD15")
> ugdUD15.DataMember = "UD15"
> Else
> optsUD15.NamedSearch.WhereClauses.Add("UD15", "Company = ''")
> Dim MorePagesUD15 As Boolean
> Dim dsUD15Adapter As Data.DataSet = adaUD15Adapter.GetRows(optsUD15, MorePagesUD15)
> adaUD15Adapter.Dispose()
> ugdUD15.DataSource = dsUD15Adapter.Tables("UD15")
> End If
> ugdUD15.DisplayLayout.Bands(0).Columns("Company").Hidden = True
> ugdUD15.DisplayLayout.Bands(0).Columns("Key1").Header.Caption = "Quote Number"
> ugdUD15.Update()
> ugdUD15.Refresh()
>
Thanks. That worked great.Â

My next step is to create a button which will add a new record to my ultragrid, fill out some of the fields with data, and save the results back to the table. You wouldn't happen to have a code sample of this?Â




________________________________
From: bw2868bond <bwalker@...>
To: vantage@yahoogroups.com
Sent: Mon, May 17, 2010 3:24:11 PM
Subject: [Vantage] Re: Stuck on how to update EpiUltraGrid

Â
Here is some code I have that updates UD10 if data changes - modify to your Table/Form......

Private Sub ugdEpiCustom1_AfterCellUpdate(ByVal Sender As Object, ByVal Args As Infragistics.Win.UltraWinGrid.CellEventArgs) Handles ugdEpiCustom1.AfterCellUpdate

dim key1 As String = args.cell.row.cells("Key1").value
dim key2 As String = args.cell.row.cells("Key2").value
dim key3 As String = args.cell.row.cells("Key3").value
dim key4 As String = args.cell.row.cells("Key4").value
dim key5 As String = args.cell.row.cells("Key5").value
dim field As String = args.cell.column.key
Dim udAdapter As UD10Adapter = New UD10Adapter(PartForm)
Dim udConnected As Boolean = udAdapter.BOConnect()

dim Success As Boolean = udAdapter.GetById(key1,key2,key3,key4,key5)

If(Success) Then
udAdapter.UD10Data.Tables("UD10").Rows(0)(field) = args.cell.row.cells(field).value
udAdapter.Update()
End If
udAdapter.Dispose()
End Sub

--- In vantage@yahoogroups.com, "Steven" <sgotschall@...> wrote:
>
> I have an EpiUltraGrid on the UD105 form which I have bound to UD15 when the EpiViewNotification is triggered. It works great to view the related data in the UD15 table. I am now stuck on how I can write back any changes made to data on the EpiUltraGrid back to the table UD15. Here is my code so far:
>
> Dim adaUD15Adapter As UD15Adapter = New UD15Adapter(UD105Form)
> adaUD15Adapter.BOConnect()
> Dim optsUD15 As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> If (args.Row > -1) Then
> optsUD15.NamedSearch.WhereClauses.Add("UD15", "Company = '" & view.dataView(args.Row)("Company") & "' AND Key1 = '" & view.dataView(args.Row)("ChildKey1") & "'")
> Dim MorePagesUD15 As Boolean
> Dim dsUD15Adapter As Data.DataSet = adaUD15Adapter.GetRows(optsUD15, MorePagesUD15)
> adaUD15Adapter.Dispose()
> ugdUD15.DataSource = dsUD15Adapter.Tables("UD15")
> ugdUD15.DataMember = "UD15"
> Else
> optsUD15.NamedSearch.WhereClauses.Add("UD15", "Company = ''")
> Dim MorePagesUD15 As Boolean
> Dim dsUD15Adapter As Data.DataSet = adaUD15Adapter.GetRows(optsUD15, MorePagesUD15)
> adaUD15Adapter.Dispose()
> ugdUD15.DataSource = dsUD15Adapter.Tables("UD15")
> End If
> ugdUD15.DisplayLayout.Bands(0).Columns("Company").Hidden = True
> ugdUD15.DisplayLayout.Bands(0).Columns("Key1").Header.Caption = "Quote Number"
> ugdUD15.Update()
> ugdUD15.Refresh()
>







[Non-text portions of this message have been removed]