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
Hello dev_here,
If you have any further questions please let me know.
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.