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

[Solved] Batch Editing - Cascading Dropdowns

1 Answer 172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
licensing
Top achievements
Rank 1
licensing asked on 02 Aug 2013, 09:59 AM

Below queries relates to Batch Editing feature of the RadGrid (ASP.NET AJAX’s)

 

Scenario 1: In Image 1, 2 and 3, we are using ASP.NET AJAX’s dropdown list box within a ASP.NET AJAX’s Grid, this is the sample application provided by Telerik. The second one is cascading dropdown list box, when we select country in the first dropdown list box, it should fill all the states in the second dropdown list box of depending upon the country selected in the first dropdown list box. If you look at Image 1, you can see that we have “Asiaand “Asia – Japan. In Image 2, a user changes the value from “Asia” to “Europe” but the values do not get filled in the second dropdown list box as you can see it is still showing “Asia-Japan”. When we click on the second drop down list box then only it fills the states of the country selected in the first dropdown list box and still showing the “Asia-Japan”.

 

Queries Set 1:

  • We don’t want the above feature; we want that if the user selects any value in the first dropdown list box and that list box causes post back and automatically clears the existing values of second dropdown list box and fill with new values.
  • Can we use ASP.Net dropdown list box inside the grid rather than Telerik ASP.NET AJAX’s dropdown list box?

 

Scenario 2: In Image 4, we are using ASP.NET AJAX’s dropdown list box within a ASP.NET AJAX’s Grid. When we select Cargo Type dropdown list box, it first displays “Loading…” and then fill the list box with the actual values from the database/ object.

Query Set 2:  We don’t want this “Loading…”, please provide us code to remove this feature.

 

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 07 Aug 2013, 08:24 AM
Hello,

The problem with the related dropdowns scenario is that if a postback occurs all the current changes made by the user will be lost. This means that using an ASP DropDownList for such scenarios may prove impossible as it does not provide a load on demand functionality and it will postback. The preferable solution in this case would be to manually set as selected the first of the newly loaded items using client-side logic.

As for the second problem it can be resolved by subscibing to the OnClientDropDownOpened and hiding the element.

ASPX:
<telerik:RadComboBox ID="RadComboBox2" runat="server" Width="250" Height="150"
                                   EmptyMessage="Select a Company" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                   EnableVirtualScrolling="true" OnClientDropDownOpened="OnClientDropDownOpened"
  OnItemsRequested="RadComboBox2_ItemsRequested"
                                   label="Server-Side:">
                              </telerik:RadComboBox>

JavaScript:
function OnClientDropDownOpened(sender, eventArgs) {
            $telerik.$("#RadComboBox2_LoadingDiv").hide();
        }

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
licensing
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or