Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > General Discussions > rad filter problems adding comboBox
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered rad filter problems adding comboBox

Feed from this thread
  • rik butcher avatar

    Posted on Jun 13, 2011 (permalink)

    i've been able to populate the radFilter on page load very effectively up to this point. i'm using a .xml file to set the FieldEditor with both
    TextFieldEditors & DateFieldEditors. i ran into trouble however when i had the need to do this for RadFilterComboxEditors. the problem, i think is populating the comboBox Control itself.
    the "dd_workordertypes_nonstorage" reference below is basically the query. that will come back as:
    Value   ||  Display
    1             Plant
    2             Mobile
    3             Coating

    i know i'm missing something somewhere and i've read most of the examples in the forums -  but can't really find anything that is specifically like this, so any direct tips for the code below would help me out greatly.
    thx
    rik

     

     

    protected void readXMLSearch(string xmlFile)

     

     

    {

     

     

     

    string myPath = Server.MapPath("DynReportXml\\" + xmlFile + ".xml");

     

     

     

     

    DataSet ds = new DataSet();

     

     

     

     

    DataTable dt = new DataTable();

     

     

     

     

     

     

    try

     

    {

    ds.ReadXml(myPath);

    dt = ds.Tables[0];

     

     

    foreach (DataRow aRow in dt.Rows)

     

     

    {

     

     

     

    RadFilterTextFieldEditor editor = new RadFilterTextFieldEditor();

     

     

     

     

    RadFilterDateFieldEditor dateEditor = new RadFilterDateFieldEditor();

     

     

     

     

    RadFilterComboBoxEditor comboEditor = new RadFilterComboBoxEditor();

     

     

     

     

     

     

    string myType = (string)aRow["dataType"];

     

     

     

     

    string myComboSearch = "";

     

     

    myComboSearch = (

     

    string)aRow["custom"];//Reads xml file for combobox search query

     

     

     

    if (myType == "datetime")

     

     

    {

     

    RepLauncherRadFilter.FieldEditors.Add(dateEditor);

     

    //calendar

     

    dateEditor.FieldName = (

     

    string)aRow["dbColumn"];

     

     

    dateEditor.DisplayName = (

     

    string)aRow["display"];

     

     

    }

     

     

     

    else if (myType != "datetime" & myComboSearch == "NA")

     

     

    {

     

    RepLauncherRadFilter.FieldEditors.Add(editor);

     

    //TextBox

     

    editor.FieldName = (

     

    string)aRow["dbColumn"];

     

     

    editor.DisplayName = (

     

    string)aRow["display"];

     

     

    }

     

     

     

    else if (myType != "datetime" & myComboSearch == "dd_workordertypes_nonstorage")

     

     

    {
    RepLauncherRadFilter.FieldEditors.Add(comboEditor);

     

    //comboBox

     

    comboEditor.FieldName = (

     

    string)aRow["dbColumn"];

     

     

    comboEditor.DisplayName = (

     

    string)aRow["display"];

     

     

     

     

    using (UtilitiesBC ubc = new UtilitiesBC())

     

     

    {

     

     

     

    DataTable comboDt = ubc.ddForDynamic(DivisionID.ToString(), myComboSearch);

     

     

     

     

    RadComboBox _comboBox = new RadComboBox();

     

     

    _comboBox.DataSourceID = comboEditor.DataSourceID;

     

    comboEditor.DataValueField = _comboBox.DataValueField;

     

    comboEditor.DataTextField = _comboBox.DataTextField;

     

    _comboBox.DataSource = comboDt.DefaultView;

     

    _comboBox.DataValueField =

     

    "VALUE";

     

     

    _comboBox.DataTextField =

     

    "DISPLAY";

     

     

    _comboBox.DataBind();

     

    }

     

    }

     

    }

     

    }

     

     

     

    catch (Exception ex)

     

     

    {

     

     

     

    string myEx = ex.ToString();

     

     

    }

     

    }

  • Mira Mira admin's avatar

    Posted on Jun 16, 2011 (permalink)

    Hello Rik,

    Please examine the following help topics to see how the desired functionality can be implemented:
    Adding field editors dynamically
    Creating custom field editors

    I hope this helps.

    Kind regards,
    Mira
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  • rik butcher avatar

    Posted on Jun 16, 2011 (permalink)

    just to clarify. this RadFilter control will NOT have one or the other in it. depending on which field editor you pick, you might get a textbox, then the next field editor you pick will have a Date Control & then another will have a Combobox or two or 8 or 10. we've successfully done this with textboxes mixed in w/ date controls. see attached .jpg - 1st editor is a date. 2nd is a textBox & the 3rd should be a RadComboBox.
    and on this page there will be way more than one ComboBox - typically about 8+. i'm trying to use the RadFilter to do this to keep consitency throughout the program.
    i've spent 2-weeks on this one control & just for the comboBox.
    it's hard for me to understand why text field & date field editors plug in to the radFilter so easily, but the comboBox won't work inside of this filter.
    so, if i understand correctly., in the list below, whereas the first two are pretty easy to do dynamically, the RadFilterComboBoxEditor is a completely different animal.
    bottom line: can these be mixed together in one RadFilter?
    thx
    rik

     

     

    RadFilterTextFieldEditor editor = new RadFilterTextFieldEditor();

     

     

     

    RadFilterDateFieldEditor dateEditor = new RadFilterDateFieldEditor();

     

     

     

    RadFilterComboBoxEditor comboEditor = new RadFilterComboBoxEditor();

     

    Attached files

  • Mira Mira admin's avatar

    Posted on Jun 17, 2011 (permalink)

    Hello Rik,

    I have followed your scenario and prepared a sample project for you demonstrating how the desired functionality can be implemented. You can find it attached to this message.

    I hope it helps.

    All the best,
    Mira
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > General Discussions > rad filter problems adding comboBox