This is a migrated thread and some comments may be shown as answers.

client side combobox + grid

1 Answer 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 21 Feb 2011, 12:27 PM
I have a several simple grids of words and comboboxes which lets the user add a word to the respective grid.  Similarly, in the grid, I have an x column to allow the user to delete the word from the grid (and it goes back into the combobox dropdown).

I have this working in the code behind, but it's rather slow.  Each time the user does something, it involves a round-trip to the server.

When the user hits the save button, I get the contents of the grid and save it off, so it seems rather pointless to have all these round-trips to the server just to manipulate the grid!

I'd like to do the add/delete in the client side in javascript.  I'm looking for some easy to understand examples of this.  The reason I'm using a combobox and not 2 lists/grids is that the user can type a new word to add to the list.

I already have the combo box's dropdown list and the grid loaded.  I'm just looking for some javascript that would "move" items back and forth between the dropdown list and the grid.  Ideally some sort of control I could use over and over again!  If anyone has an example of something like this they could share, that would be great.

Michael Grant

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 24 Feb 2011, 01:45 PM
Hi Michael,

To achieve your goal you need to enable client-side row selection. Then you can handle the OnRowSelected  client event of the grid and use the grid client-side API to extract the value of the selected row.

Having the desired value, use the RadComboBox client-side API to set it to them:
http://www.telerik.com/help/aspnet-ajax/combobox-client-side-basics.html

All the best,
Pavlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or