none
Sort and Filter in AdvancedDaraGridView RRS feed

  • Question

  • Please, this part does not work sort.

    I'm working with Nhibernate

    private void GridPlanCuentas_SortStringChanged(object sender, EventArgs e)

            {
                try
                {
                    using (CONTABILIDAD.DATA.CONTABILIDADDataContext PlanCuentas = new CONTABILIDAD.DATA.CONTABILIDADDataContext())
                    {

                        this.cNTBPlanCuentaBindingSource.Sort = this.GridPlanCuentas.SortString;
                        GridPlanCuentas.DataSource = PlanCuentas.CNTBPlanCuenta.ToList();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

    Friday, April 21, 2017 3:09 PM

All replies

  • Hi asalazarlopez,

    Based on your description and related code, I am not sure what is the issue, could you please provide a bit more information about issue, such as what line of code cause the issue, the detailed error message. if possible, please share a simple demo which could reproduce the issue on my side via OneDrive.

    Best regards,

    Cole Wu


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Monday, April 24, 2017 5:12 AM
    Moderator
  • Dear Cole Wu

    About the issue that i asked you before, i wrote this code for FILTER, SORT and COUNT ROWS.

           

            private void GridPlanCuentas_SortStringChanged(object sender, EventArgs e)
            {   
                this.cNTBPlanCuentaBindingSource.Sort = this.GridPlanCuentas.SortString;
            }

            private void GridPlanCuentas_FilterStringChanged(object sender, EventArgs e)
            {
                this.cNTBPlanCuentaBindingSource.Filter = this.GridPlanCuentas.FilterString;
            }
           

            private void cNTBPlanCuentaBindingSource_ListChanged(object sender, ListChangedEventArgs e)
            {
                lbltotal.Text = string.Format("Total rows: {0}", this.cNTBPlanCuentaBindingSource.List.Count);
            }

    Whit this code COMPILAR appear doesn't exist any problem but when i use the advanced DataGridView any function of SORT, FILTER and COUNT ROWS works.

    Also I'm working with NHIBERNATE - LINQ TO SQL. 

    I attach you the link where you can see the video and the demo .

    Best Regards

    Alejandro Salazar

    (https: //www.dropbox.com/sh/tapl247sfk6o72d/AABUOXosXUZUdWe4Ykv-kf86a?dl=0)


    Monday, April 24, 2017 9:23 PM
  • Hi asalazarlopez,

    Based the video, I could not see any exception, and cs source file is broken.

    Please try to add order by statement on your sort event and check if it works for you.

    If the issue still exist, could you please create a simple demo which could reproduce the issue and share to us. I'll try to find a solution to resolve it.

    Best regards,

    Cole Wu


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Tuesday, April 25, 2017 2:40 AM
    Moderator
  • Dear Cole Wu

    I attach the link with the demo, my tools that i use are CODESMITH (PLINQO-NH) and NHIBERNATE.
    The name for the file whit the demo is Test AdavancedDataGridView.rar · 28.45 MB

    https://www.dropbox.com/sh/tapl247sfk6o72d/AABUOXosXUZUdWe4Ykv-kf86a?dl=0

    The next link is an example that i found in youtube thats what im trying to do.

    https://www.youtube.com/watch?v=RaZeeHRRCGA

    Best regards

    Alejandro Salazar

    Tuesday, April 25, 2017 8:22 PM
  • Hi asalazarlopez,

    I have download the solution you providing, but I could not open the project named LISTA.DATA. And I could see anything in Form1.cs

    Based on the project, it seems that you use AdavancedDataGridView and NHIBERNATE, which is 3rd-party control and API, I would suggest that you could post your issue on related forum for suitable support.

    #NHIBERNATE

    https://twitter.com/NHibernate

    #AdavancedDataGridView

    https://adgv.codeplex.com/discussions

    Best regards,

    Cole Wu


    MSDN Community Support<br/> Please remember to click &quot;Mark as Answer&quot; the responses that resolved your issue, and to click &quot;Unmark as Answer&quot; if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact <a href="mailto:MSDNFSF@microsoft.com">MSDNFSF@microsoft.com</a>.

    Wednesday, April 26, 2017 2:11 AM
    Moderator