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

Ajax in edit form -RadGrid-

3 Answers 128 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 1
Jacob asked on 23 Jan 2009, 11:33 PM

Hi,

I have a radgrid and within this radgrid, I have two comboboxes in the edit/insert form. I want to ajaxify the comboboxes, such that one combobox "onselectedindexchanged" event should refresh the second one. Additionally, I want to ajaxify the insert/update/delete operations of the radgrid too. So I wrote the following code:

       <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  > 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadComboBox1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadComboBox2" LoadingPanelID="LoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1" > 
                      
                    <UpdatedControls> 
                      
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="LoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
                           
                  
            </AjaxSettings> 
        </telerik:RadAjaxManager> 

The problem is; when radcombobox1 is changed, the whole radgrid refreshes, not just radcombobox2. How do I prevent this? I want only radcombobox2 refreshed when radcombobox1's index is changed.

Thanks in advance.

Note: Radcombobox1 and radcombobox2 is in edit form of the radgrid1.

3 Answers, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 27 Jan 2009, 08:01 AM
Hello Jacob,

The proper way for achieving your goal is to ajaxify the whole grid as you already did. It is now preferable to ajaxify controls from the grid edit form separately. This is because the controls that take part in an ajax pair should be always visible/available on the page and the grid edit form is available only through edition.

However, you could try integrating this Multiple ComboBoxes demo into your edit form optionally. 

Find more information i the below online resources:
http://www.telerik.com/help/aspnet-ajax/ajxajaxifyparticulartemplatedgridviewbuttons.html


Sincerely yours,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jacob
Top achievements
Rank 1
answered on 27 Jan 2009, 02:34 PM
Thanks Iana for reply. I was thinking a possible solution would be ajaxify insert/update/delete commands seperately. Is there a way to do that? or Can I ajaxify only delete command on the radgrid?

Thank you.
0
Iana Tsolova
Telerik team
answered on 29 Jan 2009, 01:41 PM
Hi Jacob,

You could ajaxify only the Delete command buttons. However as a final result you may not gain more benefits than ajaxifying the whole grid.
To ajaxify the Delete buttons, handle the ItemCreated event of RadGrid and find there each Delete button. Then add the desired ajax setting dynamically.

Find further information on how to achieve it in the below articles:
http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html
http://www.telerik.com/help/aspnet-ajax/ajxaddajaxsettingsprogrammatically.html
http://demos.telerik.com/aspnet-ajax/Ajax/Examples/Manager/PartialAjaxification/DefaultCS.aspx
http://demos.telerik.com/aspnet-ajax/Ajax/Examples/Manager/PartialPostBacks/DefaultCS.aspx

I hope this helps. 

All the best,
Iana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Ajax
Asked by
Jacob
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Jacob
Top achievements
Rank 1
Share this question
or