Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

Filtering DropDownList Sorting

Last post 09-10-2008 7:05 by mamun1net. 6 replies.
Page 1 of 1 (7 items)
Sort Posts: Previous Next
  • 09-05-2008 6:10

    Filtering DropDownList Sorting

     Hi,

     I have enabled column filtering options. when i click on the header of that column, a dropdownlist is come out containing all the data of that column with default sorting(Ascending). But I need to show data without sorting, data should be just like the order as the column shows.

     Is there any property to do this? Or Any other way?

    /Mamun 

    • Post Points: 20
  • 09-05-2008 8:42 In reply to

    Re: Filtering DropDownList Sorting

     Hi Mamun,

    Yes you can use the OnFilterPopulating / OnFilterPopulated server-side events of the UltraWebGrid, and popupate the filter dropdown in the way you want.

    You can get the active filtered row from the filter event arguments, and you should be modifying this collection, to fill in the new list: 

    UltraWebGrid1.DisplayLayout.Bands[0].Columns[<the filtered column index>].FilterCollectionValues 

     

    I hope this helps,

    Angel  

    • Post Points: 20
  • 09-05-2008 11:10 In reply to

    Re: Filtering DropDownList Sorting

     Thanks for your reply. Can you please send me some code or example so that I can try with that.

    Please help me out.

     

    Thanks

    /Mamun

    • Post Points: 5
  • 09-07-2008 2:43 In reply to

    Re: Filtering DropDownList Sorting

    Hi,

    Below is my code which is not working. I am using Infragistics version 6.2. 

    protected void UltraWebGrid1_FilterPopulated(object sender, EventArgs e)
        {
            DataTable dt = getSelectionData();
            DataView dw = dt.DefaultView;
            DataTable dt1;
            string[ strColumns = new string[2];
           Infragistics.WebUI.UltraWebGrid.ValueListItemsCollection lst = new Infragistics.WebUI.UltraWebGrid.ValueListItemsCollection();
            dw.Sort = "RoomDisplayOrder";
            strColumns[0] = "RoomDisplayOrder";
            strColumns[0] = "RoomDescription";
            dt1 = dw.ToTable(true, strColumns);

            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                lst.Add(dt1.Rows[i]["RoomDescription"].ToString());
            }

            UltraWebGrid1.DisplayLayout.Bands[0].Columns[2].FilterCollection = lst;
        }

     Same code i use for  onFilterPopulating.but no response. Whats wrong in my code?

     

    Thanks
    • Post Points: 20
  • 09-08-2008 1:37 In reply to

    Re: Filtering DropDownList Sorting

    Hello,

    Please, take a look at the following forum thread for details on howto populate the filter list programmatically:

    http://forums.infragistics.com/forums/p/11901/44762.aspx

                Dim valueList1 As New ValueList
                Dim valueListItem As ListItem
                Dim list As Dictionary(Of Integer, String)
                list = KlasseData.GetKlasseComboList()

                For Each key As Integer In list.Keys
                    valueListItem = New ListItem(list(key), key)
                    valueList1.ValueListItems.Add(valueListItem)
                Next

                valueList1.DisplayStyle = ValueListDisplayStyle.DisplayText
               
                Grid1.Columns.FromKey("WagKlasse").Type = ColumnType.DropDownList
                Grid1.Columns.FromKey("WagKlasse").FilterCollectionValues.ValueList = valueList1

    Best Regards,
    Rumen Stankov (MCSD.NET)
    The Infragistics ASP.NET Team
    • Post Points: 20
  • 09-08-2008 6:05 In reply to

    Re: Filtering DropDownList Sorting

     Hi,

    Thanks. I tried to sort according to your hints. 

    I am using Infragistics ver 6.2. and some feature isnt available. here is my code , which doesnt show any data? but data is in ValueList. I write this code InitializzeLayout:

    DataTable dt = GetData();
            DataView dw = dt.DefaultView;
            DataTable dt1;
            string[ strColumns = new string[2];
            Infragistics.WebUI.UltraWebGrid.ValueList lst = new Infragistics.WebUI.UltraWebGrid.ValueList();
            Infragistics.WebUI.UltraWebGrid.ValueListItem lstItm;

            dw.Sort = "ID";
            strColumns[0] = "ID";
            strColumns[1] = "Name";
            dt1 = dw.ToTable(true, strColumns);
      
            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                lstItm = new Infragistics.WebUI.UltraWebGrid.ValueListItem(dt1.Rows[i]["Name"].ToString(),i);
                lst.ValueListItems.Add(lstItm);
            }


            lst.DisplayStyle = Infragistics.WebUI.UltraWebGrid.ValueListDisplayStyle.DisplayText;
            UltraWebGrid1.Columns.FromKey("Name").Type = Infragistics.WebUI.UltraWebGrid.ColumnType.DropDownList;
            UltraWebGrid1.Columns.FromKey("Name").ValueList = lst;

     

    Another prob is OnFilterPopulated doesnt fired when filter drop down is populated.

    • Post Points: 5
  • 09-10-2008 7:05 In reply to

    Re: Filtering DropDownList Sorting

     Is there no solution for this kind of problem?

    • Post Points: 5
Page 1 of 1 (7 items)
Powered by Community Server (Commercial Edition), by Telligent Systems