cancel
Showing results for 
Search instead for 
Did you mean: 

Updating a row in a matrix

Former Member
0 Kudos

Hi All,

I am facing a problem while updating a new in row in a matrix. The problem is i have a row in matrix which contains some data. i want to add another row in the same matrix and i want to update it but when click the add row button the row is getting added but it is displaying the same data that is its displaying the same data in the previous row but the newly added row should be empty. pls suggest some solution.

Regards,

Vijay Kumar.

Accepted Solutions (0)

Answers (1)

Answers (1)

edy_simon
Active Contributor
0 Kudos

Hi,

What type of data source are you binding to your matrix ?

If it is a UDS, then before you do the oMatrix.AddRow method, you should clear out all your UDSs first.

Take alook at this thread.

regards

edy

Edited by: Edy Simon on May 21, 2009 1:39 PM

Former Member
0 Kudos

Hi Edy,

Thanks for the reply. Still its not working this is the code m using,

If pVal.MenuUID = "1288" Or pVal.MenuUID = "1289" Or pVal.MenuUID = "1290" Or pVal.MenuUID = "1291" Then
                Try

                    oForm = SBO_Application.Forms.ActiveForm

                    If oForm.Type = "320" Then
                        oEdit = oForm.Items.Item("74").Specific

                        oForm.DataSources.DataTables.Item("SALES").ExecuteQuery("SELECT T0.[U_code], T0.[U_desc], T0.[U_purchase] FROM [dbo].[@SALES]  T0 WHERE T0.[U_salescode] ='" & oEdit.Value & "'")
                        omatrix = oForm.Items.Item("productmat").Specific

                        omatrix.Columns.Item("item").DataBind.Bind("SALES", "U_code")
                        omatrix.Columns.Item("itemdes").DataBind.Bind("SALES", "U_desc")
                        omatrix.Columns.Item("check").DataBind.Bind("SALES", "U_purchase")

                        omatrix.Clear()
                        omatrix.LoadFromDataSource()
                        omatrix.AutoResizeColumns()


                    End If

                Catch ex As Exception
                    SBO_Application.MessageBox(ex.Message)
                End Try

Two rows are getting added with the same data.

edy_simon
Active Contributor
0 Kudos

Hi Vijay,

How do you add the row in the matrix ? Using oMatrix.AddRow ?

If so, can you try to change the oMatrix.Addrow line to this line :


oForm.DataSources.DataTables.Item("SALES").Rows.Add(1)
omatrix.LoadFromDataSource()

Regards

Edy