ClientSide RowSelect stops working after pagesize change in radgrid - telerik

I have many telerik rad grids in my project .
It initialize with ability to have client side row selection with
<clientsettings>
<Selecting AllowRowSelect="True" />
</clientsettings>
it is ok and in first load when my paging selector is on 10 object per grid selecting works fine , but when I change page size to 20 or 50 selecting suddenly stops working and I can not select row as before . Can anyone help me with this ?

RadGrid loses its current selection on postback - e.g. when the data is sorted, a new
group or filter is added, or when the current page changes.
You can try following approaches to implement a way to persist the client-side selection. (sample code snippet is in the attached link)
Using Web Storage
Using JavaScript array
The following logic is used to persist the selected rows:
Handle OnRowSelected and OnRowDeselected events for RadGrid. In the handlers you should update the collection of the selected items.
Handle OnRowCreated event. In this handler you should check if the current item is present in the selected rows collection and select
it if necessary.
For full details, please check this article - Persisting the Selected Rows Client-side on Sorting/Paging/Filtering/Grouping

Related

Kendo ListView and MVVM 'edit template' cancel button resets bound data to initial state

I have a Kendo ListView bound to an Observable object and all is working well.
I'm able to:
Add items to the list
Edit existing items by using the edit template below
Delete items
One oddity though is when I switch an item to edit view and click Cancel it resets all data back to the original data. So if I started with one item with say name and amount fields, I edit the item and change the amount, then add two more items to the list all is well. But then I click edit on any of the items and immediately click cancel, from here it removes all the additional items I added and resets the data for the first item back to what it was at the beginning.
Why would the cancel action do that?
This dojo snippet shows the exact problem I'm having: http://dojo.telerik.com/IKowo
Kendo version 2016.3.1118
EDIT:
One further development, I found a forum post on Telerik stating that you have to have an ID column and a schema:model:id setup otherwise things won't work as expected.
I've updated the dojo snippet as follows: http://dojo.telerik.com/IKowo/2
Since adding the ID to the mix it looks like the amounts aren't being affected by the cancel button but the newly added items still get removed.
Follow the example provided here by telerik
//Binding Listview to local data array & Perform CRUD
http://dojo.telerik.com/eWih/2
The Only Requirement for the cancel event not deleting the new Items is:
The id field should be kept 0 when adding the new item to the datasource
It should be incremented / Updated in the datasource transport.create event (REQUIRED)
happy coding!

Vaadin Grid refresh issue

I'm using Vaadin Framework 8.0.6
I have the following workflow :
Display grid with DataProvider and function DataProvider.fromCallbacks for lazy loading
Update one item of this grid via a form displayed in a window
Save the updated item, close window and call dataProvider.refreshAll()
Grid is now up to date and show the new data in the corresponding row
So far everything is ok but when I select and only when I select the row of the updated item, it will display the old data of the item.
To do some tests, I have created next to the grid a button to call dataProvider.refreshAll()
When I click on it, the data is refreshed and up to date again
but after, if I select the row of the updated item, it displays the old data again
Any idea ? is it a cache problem ?
FYI, after updating to Vaadin 8.1.0, this issue has disappeared.

RadGrid how to disable Row Click in some Cells? asp.net

This question might be a bit specific since it invovles a specific type of grid called RadGrid from Telerik.
I have a RadGrid with 5 columns with the EnablePostBackOnRowClick set to true, but I only want the RowClick event to be executed on 3 grid cells, I don't want this event to be executed on the fisrt and last cell (column), is there anyway to disable the RowClick event from being triggered when you click on these particular cells? Is there a way to limit the RowClick event to just the 3 cells/columns in the middle?
Take a look at this Telerik demo: Grid Cell Selection
If you specify an OnCellSelected client method, you could check which column the cell belongs to, then send an AJAX request back to the server (if if it's one of your 3 columns) and put your remaining logic in the server-side AJAX request handler method. I'm not sure if the server-side ItemCommand method can detect which cell you clicked on, but try that first, and if it doesn't work then the AJAX route would suffice. Also, you need at least the 2012 build of RadControls.
This is the markup for setting the appropriate settings:
<ClientSettings>
<ClientEvents OnCellSelected="cellSelected"></ClientEvents>
<Selecting CellSelectionMode="SingleColumn"></Selecting>
</ClientSettings>

moving data between two list boxes

I have two ListBox controls (or 2 html select controls with
runat=server) on a web page and some buttons to move data from one
listbox to another (using javascript). The problem is that when the
page gets on the server I can't get the items that I've moved from the
1st list to the second on the client, I always see the controls as
they were when the page was generated on the 1st request.
How I can see on the servers the items that I've put on the 2nd list?please provide the code in mvc3
It seems..everytime postback .. two select boxes are refresh. Please try to put
In Page Load event
If(!IsPostBack)
{
// populate data into select boxes here
}

jgGrid Search Dropdown Not Changing

This may be a followup to this question Possible to make jqGrid Search Box Stay on Page? - Or it may be unrelated because clicking the search button manually shows the same behavior.
We have a dynamically generated grid that is created by a) making an ajax request to get the grid columns based on a report id and then b) setting up the grid model and fetching the data. When the page loads initially, we pass in a starting report id, but there is a dropdown box on the page that lets the user change reports.
When the dropdown changes, I unload any existing grid, make the ajax request to get the columns, set up the grid model, and then get the data. The columns change, the data changes, and everything looks correct - except the search columns do not change in the search dropdown.
If I close the search box and reopen it, it still has the old search columns. Likewise, if I click the reset button or reload the entire grid.
I found it after a bit more poking around. I needed to set the recreateFilter option to true
prmSearch = {recreateFilter:true,multipleSearch:true,overlay:false,sopt:['cn','eq','ne','lt','le','gt','ge','in','ni','nc']};

Resources