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

Persist Settings & Combo

2 Answers 35 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rod Barrand
Top achievements
Rank 1
Rod Barrand asked on 26 Aug 2010, 10:26 AM
Hi, i'm working with the sample that persists grid setting to an xml file. I have a tree view loaded with form names that loads a dynamic grid. Saves and loads settings ok. I changed

SettingsDDL.DataSource =

GridPersisterUtility.GetSettingIds(name + "GridSettings.xml");

 


where "name" is the name of the form seleted from treeview so i have an xml file for each form
I load all the saved settings into the combo based on the tree sellection, however this only works for the first node selected
clearing the combo and databind to different xml file does nothing even though the xml is loaded correctly

// in node click event
  
string selectedValue = SettingsDDL.SelectedValue;
            SettingsDDL.Items.Clear(); // doesnt clear
            SettingsDDL.Items.Add(new RadComboBoxItem("", ""));
            SettingsDDL.DataSource = GridPersisterUtility.GetSettingIds(Session["nodeText"].ToString() + "GridSettings.xml"); // loads data from selected xml file ok
            SettingsDDL.DataBind(); // still contains original data
            SettingsDDL.Items.FindItemByValue(selectedValue).Selected = true;

2 Answers, 1 is accepted

Sort by
0
Rod Barrand
Top achievements
Rank 1
answered on 26 Aug 2010, 12:16 PM
ok, if i add radajaxmanager and
<input type="button" id="button1" runat="server" value="Ajax-Refresh RadComboBox" onclick="ajaxRefresh()" />
function ajaxRefresh() {
                var ram = $find("<%= RadAjaxManager1.ClientID %>");
  
                ram.ajaxRequest("foo");
            }

it refreshes the combo with new data via serverside

RadAjaxManager1_AjaxRequest

, however calling ajaxRefresh() from the treeview onclientnodeclicked

OnClientNodeClicked="ajaxRequest()"

throws a ajax error

0
Radoslav
Telerik team
answered on 01 Sep 2010, 07:26 AM
Hi Rod,

Could you please elaborate a bit more on your scenario. Do you have any ajax settings added for the  SettingsDDL combo box via RadAjaxManager or RadAjaxPanel? If you make an ajax request to the server when loading new values into the ComboBox you need to ajaxify the combo, so when it gets the new values, to be refreshed on the client.
Also from the posted code snippets I saw that the client side function which makes ajax request is called ajaxRefresh(), however on OnClientNodeClicked event you  call ajaxRequest() function. Could you please verify that the ajaxRequest() function exists.

Looking forward for your reply.

Kind regards,
Radoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Rod Barrand
Top achievements
Rank 1
Answers by
Rod Barrand
Top achievements
Rank 1
Radoslav
Telerik team
Share this question
or