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
Hi,
I am using the SaveLayout functionality to allow user to save the current grid's layout. In most cases it works fine. I do have one problem.
The grid uses a RowChecker column that allows the user to select multiple rows and then do something to all checked rows. It creates an ArrayList of the CheckedRows using:
Dim checkedRows As ArrayList = WebGrid1.RootTable.GetCheckedRows()
If the layout is not saved, the array list (checkedRows) contains a list of all the DataKeyField values for each row (The DataKeyField is set in the RootTable tag). If I save the layout and select a few rows, using the RowChecker column, the array list will contain a list of empty strings. For example if I select 2 rows, the array list will have a count of 2, but the values are empty.
So using the code below, keyValue is an empty string, so gettting the value of a column in the select row returns an error, since keyValue is empty. Again this only fails if I have save/restore the layout.
For Each keyValue As String In checkedRows xname = WebGrid1.RootTable.GetUngrouppedRows().GetRowByKeyValue(keyValue).Cells.GetNamedItem("xName").TextNext
I've attached the SaveLayout XML files that are created if they help.
Any ideas?
Support?
I can reproduce this is with the 2014 R2 samples. Replace the attached files to the WebGrid samples and run. First off using the Column Select Action, Select Columns and hide one or 2 columns from Grid, then click on Save Layout button. Next you need to refresh page or better still close browser and rerun. Then select a few rows and click on Get Checked Row in Server button and you will see the error. If you look at the CheckRows array list you will notice that the values for each row is empty.
Please look as I need to get this fixed.
thanks
Hi John,
I have look at your sample. Changing your sample WebGrid1_PrepareDataBinding to the following should solved your issue:
Protected Sub WebGrid1_PrepareDataBinding(ByVal sender As Object, ByVal e As ISNet.WebUI.WebGrid.DataSourceEventArgs) Handles WebGrid1.PrepareDataBinding ' This function will restore to the Filter Row the saved filter If Not IsPostBack Then Dim _file As String = Server.MapPath("~/App_Data/UserLayout/UserStructure.xml") If IO.File.Exists(_file) Then With Me.WebGrid1 .LoadTablesStructureFromXml(_file) .RootTable.FilteredColumns.Clear() .RootTable.GroupedColumns.Clear() End With End If // Add Following Line WebGrid1.RootTable.DataKeyField = "CustomerID" End If End Sub
Hope this help could help you.
Best Regards,Leo
You're welcome. Glad that it worked for you.
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