1 Solution
Hello,
Please handle the BeforeGetCallbackResult event instead.
-
This works for the filtering but doesn't for when the datasource is first set so i've left it in both events. This does mean it fires after clearing the filter (as the databound event still thinks VisibleRowCount is 1) but that row will already be expanded so isn't a big deal.
-
Hi,
>>This works for the filtering but doesn't for when the datasource is first set
This behavior is caused by the fact that the ASPxGridView.BeforeGetCallbackResult event fires only on the grid's callbacks and doesn't fire either when the page is loaded for the first time or on postbacks. So, to avoid the double call of the ExpandRow method, use the ASPxWebControl.IsCallback property to check if the grid's callback was sent:
protected void Grid_DataBound(object sender, EventArgs e) { if (!Grid.IsCallback && Grid.VisibleRowCount == 1) Grid.DetailRows.ExpandRow(0); }
Is your intention to post an answer to your own question?
- If so, then proceed.
- If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
- If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.
Facebook
Twitter
Google+