iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I tried this code and it,s not working. I took your C# exampel and converted it to VB
what's wrong? I get this error
Best regards Jarl
Undantagsinformation: System.NullReferenceException: Objektreferensen har inte angetts till en instans av ett objekt.Källfel:
Rad 25: ' if current row is equal to one of the rows in the checked rows Rad 26: ' then break Rad 27: If e.Table.Rows(i).KeyValue.ToString() = keyValue Then Rad 28: IsMatch = True Rad 29: Exit For
Dim totalRows As Integer = WebGrid1.RootTable.Rows.Count
For i As Integer = 0 To totalRows - 1
' get the number of checked rows
Dim checkedRowsCount As Integer = WebGrid1.RootTable.GetCheckedRows().Count
' a flag that shows whether row is match to one of the rows in the checked rows
Dim IsMatch As Boolean = False
For Each keyValue As String In WebGrid1.RootTable.GetCheckedRows()
' if current row is equal to one of the rows in the checked rows
' then break
If e.Table.Rows(i).KeyValue.ToString() = keyValue Then
IsMatch = True
Exit For
End If
Next
' then passes to the next iteration
' else remove current row
If IsMatch Then
Continue For
Else
e.Table.Rows.RemoveAt(i)
i -= 1
totalRows -= 1
' set the "IsRowChecker" to be not visible during export
e.Table.Columns.GetNamedItem("IsRowChecker").Visible = False
End Sub
Hi Jarl,
I think the problem comes from method:
This problem happen because WebGrid1.RootTable.GetCheckedRows() will produce array of WebGridRow instead of String. You should get the keyValue from its WebGridRow and you can compare it with your table keyValue. Hope this helps.
Regards,Bernard
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname