Home All Groups Group Topic Archive Search About
Author
23 Oct 2006 3:40 PM
Agnes
my datagrid is bind to the table, I need to check clear when the user didn't
input the figure.
my code list as follow. when the datagrid got less then 100 tables, the code
works, However, when it over 100 rows. it can't work.
Does anything wrong with my code ?
Please help
P.S - I can't use delete since the user remove the unused record before
save.

        Dim cm As CurrencyManager = Me.BindingContext(dsRvPvHeader,
"myInvTable")
        cm.EndCurrentEdit()
            For i = 1 To cm.Count
                If cm.Current.item("debit") = 0 And
cm.Current.item("credit") = 0 And cm.Current.item("voucherno") =
Me.txtVoucherNo.Text Then
                    cm.RemoveAt(cm.Position)
                Else
                    cm.Position += 1
                End If
            Next
        End If
        cm.Refresh()
        cm.EndCurrentEdit()

Author
23 Oct 2006 6:02 PM
geno1
Why do you have cm.EndCurrentEdit() twice?  Maybe you meant start?


Show quoteHide quote
On Oct 23, 11:40 am, "Agnes" <a***@dynamictech.com.hk> wrote:
> my datagrid is bind to the table, I need to check clear when the user didn't
> input the figure.
> my code list as follow. when the datagrid got less then 100 tables, the code
> works, However, when it over 100 rows. it can't work.
> Does anything wrong with my code ?
> Please help
> P.S - I can't use delete since the user remove the unused record before
> save.
>
>         Dim cm As CurrencyManager = Me.BindingContext(dsRvPvHeader,
> "myInvTable")
>         cm.EndCurrentEdit()
>             For i = 1 To cm.Count
>                 If cm.Current.item("debit") = 0 And
> cm.Current.item("credit") = 0 And cm.Current.item("voucherno") =
> Me.txtVoucherNo.Text Then
>                     cm.RemoveAt(cm.Position)
>                 Else
>                     cm.Position += 1
>                 End If
>             Next
>         End If
>         cm.Refresh()
>         cm.EndCurrentEdit()