Is it possible to add filter in Flex Grid In Alphabetical order and search row

Posted by: amit.jain3 on 21 June 2023, 1:38 am EST

  • Posted 21 June 2023, 1:38 am EST - Updated 21 June 2023, 1:43 am EST

    Hello, I am using the Flex Grid to populate some data is it possible to sort it alphabetically and can I add a search row in the Grid. I am using C# as programming Language. I am attaching the current Grid view. Please let me know if there is anything w.r.t the requirement.

    Currently I am using - c1FlexGrid1.AllowFiltering = true;

    so for this I have to click on Header to filter it. without clicking is it possible?

  • Posted 21 June 2023, 8:10 am EST

    Hi Amit,

    To use the search functionality of the C1FlexGrid, you can use our C1FlexGridSearchPanel control, which internally uses the C1FlexGrid.ApplySearch method to search and filter the rows.

    (https://www.grapecity.com/componentone/docs/win/online-flexgrid/search.html)

    To allow sorting in the C1FlexGrid, you can set the C1FlexGrid.AllowSorting property. Setting this property will allow the users to sort the column by clicking the column headers. Please note that in the case of bound mode (grid bound to a DataSource), the sorting will work only if the underlying DataSource supports sorting (for example, a DataTable).

    (https://www.grapecity.com/componentone/docs/win/online-flexgrid/sort.html)

    Please see the attached sample project for reference - FlexGrid.SearchAndSort.zip

    Best Regards,

    Kartik

  • Posted 22 June 2023, 5:40 am EST

    Hi Kartik, Thank you for your response it is what I was looking for.

    On the Same Feature Flex Grid I have another question.

    If I have 2 more columns in the grid i.e. Table Name , Unit , Value and Unit is a dropdown and based on the value selected from the dropdown I want to update Value column. How it can be done will there be any callback functions in which we can update the Grid?

  • Posted 22 June 2023, 6:31 am EST

    Hi Amit,

    To set the dropdown in the cells of a column, you can use the Column.ComboList property. To update the value of another cell whenever a cell is edited, you can use the C1FlexGrid.AfterEdit event. Please see the updated sample project for reference - FlexGrid.SearchAndSort_AfterEdit.zip

    For more information related to C1FlexGrid, you can refer to the documentation below

    (https://www.grapecity.com/componentone/docs/win/online-flexgrid/overview.html)

    The documentation topics related to your query are given below.

    (https://www.grapecity.com/componentone/docs/win/online-flexgrid/combo-box.html)

    (https://www.grapecity.com/componentone/docs/win/online-flexgrid/edit-mode.html)

    Best Regards,

    Kartik

  • Posted 22 June 2023, 7:21 am EST

    Hi Kartik,

    Thank you for the Response.

    Based on the 1st example shared by you we can select the data from the grid and get the name. But If I want to get the NEXT OR PREVIOUS NAME from the SELECTED location is it possible to get the location and do that?

  • Posted 22 June 2023, 7:53 am EST

    Hi Amit,

    The Row and Col properties of the C1FlexGrid stores the index of the cell that is currently selected. You can use the below code to get the value of the selected cell -

    var currentCellValue = c1FlexGrid1[c1FlexGrid1.Row, c1FlexGrid1.Col]

    To get the values of cells before and after the currently selected cell, you can use the below code -

    var prevCellValue = c1FlexGrid1[c1FlexGrid1.Row - 1, c1FlexGrid1.Col]
    var nextCellValue = c1FlexGrid1[c1FlexGrid1.Row + 1, c1FlexGrid1.Col]

    Regards,

    Kartik

  • Posted 27 June 2023, 2:27 am EST - Updated 27 June 2023, 2:32 am EST

    Hello Kartik,

    Thank you for the Response. I have 2 more question.

    1. While plotting the X and Y axis starts from 4 if I want the Axis to be start from 0 and the upper point should be 10. How it can be done. I tried setting Min and Max of the Axis but it’ll not work. Please refer the 1st Image.

    1. Is it possible in Flex Chart to show the Data with X and Y points. Like Below chart.

      So with X and Y co-ord a 3rd value is there which we can show for each Plotted Point.

  • Posted 28 June 2023, 5:54 am EST

    Hi Amit,

    Apologies for the delay in response. Since your latest query is for a different topic/control from the original query in this thread, we have created a separate ticket for it on our support portal.

    We have replied to your latest queries there and we request you to continue the thread there only to avoid confusion. You can find this support ticket by going to the My Support section in your GrapeCity account. You will see an open ticket there with Case ID CAS-41563-L7P7V2

    You can also access the ticket by using the following link:

    (https://www.grapecity.com/my-account/my-support/case/35926a43-8b15-ee11-8f6e-00224827e905)

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels