C1GridView - Filtering Glitch On Postback

Posted by: ifdadmin on 14 August 2024, 4:26 pm EST

  • Posted 14 August 2024, 4:26 pm EST - Updated 14 August 2024, 4:32 pm EST

    Alright, so my previous issue being solved, I finally had a working C1GridView, and it filtered SLICK!

    Awesome.

    Because I’m a huge fan of “DRY” code and don’t like to re-write code bits over and over again, I had written a special static method years ago that’s served me well to “scrape” an entire GridView of data and shove it all in a DataTable. After I worked out the initial kinks in the method, it’s served me very well for years - until it came across the C1GridView.

    I modified the method to just take in a C1GridView instead of a Microsoft GridView, and it doesn’t error, but it does provide some strange results.

    Image 1 shows the onscreen results after I’ve filtered the results down to only those records that contain “1” within the description. This is the data that I want to “scrape” after the postback.

    Image 2 shows the results in the Microsoft Data Visualizer for the DataTable that my code “scraped”. At first, I thought that there was something wrong with my method, so I dug in and investigated. If you run it yourself, and set a break-point at line 35 of ASP.cs, you’ll see that while the GridView DOES contain 11 rows after the post-back, it does indeed contain the FIRST eleven rows of the original dataset, NOT the filtered down dataset, just like it shows in the picture!

    If you investigate each object and each control during runtime using the debugger and navigate through all of them, you’ll see that this is indeed true.

    So, is there something that I’m missing here? How do I get the filtered down results from the GridView after postback?

    I’ve uploaded a full “bare minimum reproducable” code based on the original code that Mescius sent me, with just “my” stuff added to their code to reproduce the error.

    You can find the full code here on my GitHub: https://github.com/WestBennett/C1GridViewOddity

    I’ll take it down when the issue is resolved.

  • Posted 18 August 2024, 11:51 pm EST

    Hey,

    Apologies for the delay caused by the long public holiday, we tried running your sample but faced some trouble running it.

    Our team is on it and will get back to you soon!

    Thanks for your patience.

    Regards,

    Anand

  • Posted 19 August 2024, 3:45 pm EST

    Let me know if you need anything from me.

  • Posted 20 August 2024, 3:04 am EST - Updated 20 August 2024, 3:26 am EST

    Hi,

    Thanks for the sample application. I was able to reproduce this behavior at my end. I have reported this to the development team[C1WEB-29759] and will get back to you once I have any information on the same.

  • Posted 28 August 2024, 3:13 am EST

    Hi,

    I just got an update from the development team. This seems to be a bug. The filter’s setting is kept at the column after callback however, it doesn’t take any effect into the display rows. The development team has shared the attached workaround.

    P.S. I have deleted the DLLs from the sample to reduce the size of the application. Please check the Page_Load event in Default.aspx.cs script file.

    C1GridView_Filter.zip

Need extra support?

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

Learn More

Forum Channels