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 have a grid that has the filter bar, multiple-row selection, and RestoreRowSelection="All" turned on. The grid is not using a row checker column. Basically here's the RootTable settings...
<RootTable Caption="Employees" CellClickAction="RowSelect" DataMember="Table" AutomaticSort="false" AllowMultipleSelection="Yes" DataKeyField="Employee_Number" AllowGrouping="No" HideColumnsWhenGrouped="Yes" GroupMode="Expanded" GroupTotalVisible="false" AllowFilter="Yes">
... and here are the layout settings ...
<LayoutSettings PagingMode="None" AllowAddNew="No" AllowContextMenu="False" AllowDelete="No" AllowEdit="No" AlwaysShowHelpButton="False" EditOnClick="False" AllowFilter="Yes" ApplyFiltersKey="Enter" FilterBarVisible="True" NewRowLostFocusAction="AlwaysUpdate" PromptBeforeDelete="True" ResetNewRowValuesOnError="False" AllowSorting="Yes" cellclickaction="RowSelect" HeaderWrapDefault="true" RowHighlightType="BackgroundOnly" RestoreRowSelection="All" PersistRowChecker="true" StatusBarVisible="false" RowHeightDefault="18px"><SelectedRowStyle BackColor="#FF9900" BackColor2="#FF9900" /><LostFocusRowStyle BackColor="#FF9900" BackColor2="#FF9900" /><CheckedRowStyle BackColor="#FF9900" BackColor2="#FF9900" /> </LayoutSettings>
My issue is with the RestoreRowSelection="All". This grid is listing employees for a given location; when the user changes the location via a web combo the grid is refreshed with a new list of employees for the new location. However, the grid.RootTable.GetCheckedRows() always returns the list of selected employees from the old location no matter what I do. I've tried grid.RootTable.GetSelectedRows().Clear, I've tried forcing the list clear with grid.ClearCachedDataSource and grid.RebindDataSource, and just about everything else I can think of. No matter what I do the grid will restore the previously selected list after the postback to the form. Even if I get the list cleared on a temporary basis it seems to come back when the post back is fully completed.
How do I programatically clear the selected rows when the "RestoreRowSelection="All" option is enabled? In my case the previously selected items no longer exist as valid items to choose from but the internal collection of checked items still lists them. I want that list emptied out but I can't figure out how.
Hi Bob Elvin,
The most simple way would be by clearing the SelectedRows before you send PostBack using the following JavaScript code:
ISGetObject("WebGrid1").RootTable.SelectedRows = [];
Best Regards,Leo
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