Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1965
remove behaviors in code
posted

If I have paging and filtering enabled for a grid with two levels and based on the amount of data resturned from dataset (say if only 1 row is returned) then in that case how can i disable the behaviors?

 

So if more than 1 row of data is returned then I want to enable the behaviors . if not, disable it

Parents
  • 37874
    posted

    Hi dev_here,

    To achieve this, you could use code similar to the following:

    protected void WebHierarchicalDataGrid1_DataBound(object sender, EventArgs e)

    {

        if (WebHierarchicalDataGrid1.GridView.Rows.Count == 1)

        {

            WebHierarchicalDataGrid1.GridView.Behaviors.Filtering.Enabled = false;

            WebHierarchicalDataGrid1.GridView.Behaviors.Paging.Enabled = false;

        }

    }

    Let me know if this helps.

Reply Children
No Data