moving data between two list boxes - asp.net-mvc-3

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
}

Related

How to make the next page from continuation of data when using repeater on wix?

I have a website on wix with data connected to repeaters on the page. however my data is too big to show on the same page. How do I break the continuation and start it from the next page.
You can set the number of items to show at once in the dataset settings. Then you can add buttons (and set the click action) or a pagination bar (and connect to the dataset) to page through the items or show more items.

ClientSide RowSelect stops working after pagesize change in radgrid

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

kendo dropdown list taking long time to load the options

I am developing a kendo grid in my HTML page (not MVC app) and it gets about 500+ records from the backend service. I have 4 Kendo dropdown lists in each row and 2 are getting values from local variables and other 2 are getting data from ajax calls.
When I try to edit any dropdown list, it goes to the editor function of the column, but takes long time to show the values in dropdown list and sometimes the IE page crashes. I am using IE11.
Do you have any best practices to work with Kendo dropdown list type if the grid has more records say > 200 records.
When I need to show that many results in a dropdown list I usually create an autocomplete combobox instead. You can show, for example, 10 results and have the server return more results as the user types.

get and display data in MVC 3 using Ajax

I have one view page in MVC named as ‘Index’. There are 3 main controls in that view page. For better understanding, take below example as reference.
1. One Dropdown ‘Customer’
2. One Dropdown ‘Project’ (that depends on ‘Customer’)
3. List of Task (that depends on ‘Project’).
Currently first user needs to select ‘Customer’. So based on customer ‘Project’ dropdown data will be fetched from post method of Index and bind that ‘Project’ dropdown. After selecting ‘Project’, List of task will be fetch from post method of Index and bind those tasks. So every time page is loaded again.I want to do it by Ajax form submit.
My problem – those 3 controls are in one view page so I want to return page view using Ajax without using Partial View. Is this possible? If yes then how? Or any other solution so that I am able to display data without reload whole page again.
If u can give me example of such scenario then it will be good.

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