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

[Solved] Load grid with button click based on 2 RadCombo selections

3 Answers 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Napurano
Top achievements
Rank 1
Steve Napurano asked on 06 Oct 2009, 02:24 AM
Hi. I want to be able to load a grid based on the selection of two radCombo boxes but I want to force the user to click an update button which loads the grid on the client based on the selections in the radCombo. I am new to the Telerik suite. I saw the demo on how to load the grid based on the user changing the selection of a radCombo but that does an automatic load. i want the user to click an update button.

Any insight would be beneficial to me...

thanks

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 Oct 2009, 10:39 AM
Hello Steve,

From what i understood, you require client side binding of the grid on button click based on the selected items in the comboboxes. If thats the case, then you can try the following:
js:
function updateGrid(result) 
        { 
           var combo1 = $find("<%= RadComboBox1.ClientID %>"); 
           var combo2 = $find("<%= RadComboBox2.ClientID %>"); 
           if(combo1.get_text() == "Text1" && combo2.get_text() == "ComboText1"
           {            
               var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView(); 
               tableView.set_dataSource(result); 
               tableView.dataBind(); 
           }       
        } 

You could go through the following online demo which illustrates on client-side databinding in the grid:
Programmatic Binding

Thanks
Princy.
0
Steve Napurano
Top achievements
Rank 1
answered on 12 Oct 2009, 06:10 PM
Hi, I am still confused with the order of operations of loading a grid, and setting data and the combo box load from a button on the client side. I looked at the examples.

What is the order of operations?

I realize now that I do not bind the grid on the page load. But my Paging is not working when I change to a different page. Does that need to be set in the Javascript?

I am also still a little lost on loading the grid from the button based on selectedindex of the 2 comboboxes...

I need to query the database based on the selected index of two rad combos.

Can you assist a little further please?

Thanks

0
Tsvetoslav
Telerik team
answered on 15 Oct 2009, 04:15 PM
Hello Steve,

Attached is a small sample that demonstrates your scenario.

I hope it will help you on the right track with your implementation.

Regards,
Tsvetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Steve Napurano
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Steve Napurano
Top achievements
Rank 1
Tsvetoslav
Telerik team
Share this question
or