I have WebDataGrid version 10.3 and I need custom filtering and sorting applied to the grid. Here are a couple examples of what I need done:
1. I have a column of integers, and many of them have a value of 0. I need 0 to be considered the highest number for sorting purposes. How do I accomplish this? My current solution was to create a hidden column based on this column, and set any 0's to Int32.MaxValue. This works for initial load, but I need the sort of this column to actually sort using the hidden column, rather than the column they actually clicked.
2. I need to be able to filter that column to show either zero or non-zero values. I also need the filter options to have custom names. Basically I need to duplicate this UWG functionality:
uwgPurchPriceVar.Columns.FromKey("COMMODITY").FilterCollectionValues.Clear() For Each item As String In CommodityFilterList uwgPurchPriceVar.Columns.FromKey("COMMODITY").FilterCollectionValues.Add(item, item) Next
uwgPurchPriceVar.Columns.FromKey("UOM_CODE_DESCR").FilterCollectionValues.Clear() For Each item As String In UOMFilterList uwgPurchPriceVar.Columns.FromKey("UOM_CODE_DESCR").FilterCollectionValues.Add(item, item) Next
uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_CUMM_PERCENT").FilterCollectionValues.Clear() uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_CUMM_PERCENT").FilterCollectionValues.Add(0.75, "Less Than 75%") uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_CUMM_PERCENT").FilterCollectionValues.Add(0.5, "Less Than 50%") uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_CUMM_PERCENT").FilterCollectionValues.Add(0.25, "Less Than 25%") uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_CUMM_PERCENT").FilterCollectionValues.Add(0.1, "Less Than 10%") uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_CUMM_PERCENT").FilterCollectionValues.Add(0.0, "Greater Than 0%") uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_RANK").FilterCollectionValues.Clear() uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_RANK").FilterCollectionValues.Add(1, "Ranked") uwgPurchPriceVar.Columns.FromKey("CURRENT_QTR_RANK").FilterCollectionValues.Add(0, "Unranked") uwgPurchPriceVar.Columns.FromKey("UNDER_CONTRACT").FilterCollectionValues.Clear() uwgPurchPriceVar.Columns.FromKey("UNDER_CONTRACT").FilterCollectionValues.Add(True, "Under Contract") uwgPurchPriceVar.Columns.FromKey("UNDER_CONTRACT").FilterCollectionValues.Add(False, "Not Under Contract")
Hello,
Thank you for contacting us.
The classic controls are retired and no longer supported. They are also not included in NetAdvantage versions 11.2 and above. I would suggest you to migrate to the new controls based on our Aikido framework. Here you can find more information on the matter:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2013.1/CLR4.0/html/Classic_Control_Migration_Guide.html
http://www.infragistics.com/community/blogs/taz_abdeali/archive/2010/03/04/asp-net-product-changes.aspx
Product lifecycle:
http://www.infragistics.com/support/product-lifecycle
What the hell are you talking about? The WebDataGrid isn't being retired!
Hello Jesse,
Apologies for not being clear with my reply.
Using of WebDataGrid from version 10.3 would be different from version 14.2. As I can see you are migrating from 10.3 to 14.2 and you want to migrate some UltraWebGrid functionalities into the new aikido WebDataGrid.
About point 1:
You can use the same approach for sorting, although on click of the desired column you will add different column to be sorted.
Sorting behavior = this.WebDataGridView.Behaviors.Sorting;behavior.SortedColumns.Add(this.WebDataGridView.Columns["CompanyName"], Infragistics.Web.UI.SortDirection.Ascending);
Another possible solution would be to exclude the rows with value 0 from the data source (into a new instance of it), then sort the data source base on that column, and after that to add the excluded rows into the data source again and rebind.
This is because our Sorting, Paging etc. are operating with the Data Source, and the Grid is initialized based on it. So you will need to sort the data source and render the Grid again based on the modified data source.
About point 2:
Currently the new Grid do not have such equivalent that will help you by design to change the Filter options, Although you can handle FIlterDropdownDisplayed client event and in there to iterate through all ul elements (Equal, Before, After etc.) and change them as you want. I would recommend you also to log it at http://ideas.infragistics.com , the Product Ideas site allows you to suggest new product features, new functionalities in existing products and controls, and even request new controls and products altogether. Members of the Infragistics Community then vote for the features and suggestions they want to see added to the products, resulting in the most popular features bubbling up to the top. When planning new releases, our Product Management team will look at the most popular features and use your feedback to prioritize upcoming work.
Zdravko Kolev"] About point 2: Currently the new Grid do not have such equivalent that will help you by design to change the Filter options, Although you can handle FIlterDropdownDisplayed client event and in there to iterate through all ul elements (Equal, Before, After etc.) and change them as you want. I would recommend you also to log it at http://ideas.infragistics.com , the Product Ideas site allows you to suggest new product features, new functionalities in existing products and controls, and even request new controls and products altogether. Members of the Infragistics Community then vote for the features and suggestions they want to see added to the products, resulting in the most popular features bubbling up to the top. When planning new releases, our Product Management team will look at the most popular features and use your feedback to prioritize upcoming work.
This is one of the biggest issues that I have with Infragistics: This is NOT a new feature request. This is a feature that was on older controls, and you guys decided to remove it for some unknown reason. Now as a programmer I'm left scrambling trying to resolve an issue that you guys intentionally created. Then you have the nerve to charge a large sum for support, when you all but guarantee your clients will need it!
As I understand you don't want to implement my suggestion, although I have recommended you this approach because it would be easy to implement. The other way is to change the WebDataGrid resources files (WebDataGridStrings_runtime.resx) from where these static values are retrieved. Below you can find a step-by-step guide how to do this:
http://dl.infragistics.com/community/aspnet/articles/wdg-localization/WebDataGridLocalization.doc
In order to help you further with this I have created a sample that is showing how to implement this workaround. Let me know if this is what you are trying to achieve.
Looking forward to hearing from you.
Code snippet:
Image: