Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

Change the filter combobox list values based on the value of another filter combobox

$
0
0

This example demonstrates how to changed the 'city' filter combobox values based on the 'country' filter combobox.

Question Comments

Added By: Sinan EGE 1 at: 6/19/2015 5:56:41 PM    

An exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll but was not handled in user code

protected void dgListe_CellEditorInitialize(object sender, ASPxGridViewEditorEventArgs e)
       {
           if (e.Column.FieldName == "ilceid")
           {
               ASPxComboBox cmb = e.Editor as ASPxComboBox;
               cmb.ClientInstanceName = "cmb2";
               cmb.Callback += new DevExpress.Web.CallbackEventHandlerBase(cmb_Callback);

               cmb.DataSourceID = "dsIlce";

           }
           else if (e.Column.FieldName == "sehirid")
           {
               ASPxComboBox cmb = e.Editor as ASPxComboBox;
               cmb.ClientInstanceName = "cmb1";
               cmb.ClientSideEvents.SelectedIndexChanged = "function (s, e) { cmb2.PerformCallback(s.GetValue()); }";
               cmb.ClientSideEvents.Init = "function (s, e) { cmb2.PerformCallback(s.GetValue()); }";
           }
       }

       void cmb_Callback(object sender, DevExpress.Web.CallbackEventArgsBase e)
       {
           ASPxComboBox cmb = sender as ASPxComboBox;

           if (String.IsNullOrEmpty(e.Parameter))
               cmb.Items.Clear();
           else
           {
               dsIlce.SelectParameters[0].DefaultValue = e.Parameter;
               cmb.DataBindItems();
           }
       }


Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>