Attachment: WebSite.zip (1782 bytes)
I refer to S30339 and example E13
If I change E13's code (see attachment) from
<dxwgv:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="CustomerID">
to
<dxwgv:ASPxGridView ID="grid" ClientInstanceName="grid" runat="server" DataSourceID="AccessDataSource1" KeyFieldName="CustomerID">
<SettingsBehavior AllowFocusedRow="True" />
<SettingsDetail AllowOnlyOneMasterRowExpanded="True" ShowDetailRow="True" />
and change the Page_Load function as follows:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
ClearSelectionOnOtherPages()
If grid.FocusedRowIndex = 0 Then
grid.FocusedRowIndex = -1
End If
End Sub
Despite this, when I display the page, row 0 is focused, even though grid.FocusedRowIndex already has a value of -1, as suggested in S30339
I can click on the "+" button for a row and the detailrow is displayed, even though the focusedrow is a different row. I have tried various ideas to set the focus of the row where the detailedrow is displayed, without success. Please tell me how I can do this.
Please tell me how I can disable the focusedrow until a row is actually selected, if at all possible.
Finally, if I want to select and set the focus of a row that isn't on the first page, how do I do this? For example, in Northwind Traders the opening page of the Sales Order table is usually in the range 10248-10257. I would like to be able to open the AspxGridView and go directly to, say, SalesOrder #11015, which is on page 77 in my data.
How can I go there and set the selected row and the focused row to this value? I can do it by setting a filter and getting just the single row, but when I clear the filter the focus is lost and it reverts back to the first record. It's just too easy to get lost in a gazillion records this way.
Any suggestions will be gratefully accepted. I think ASPxGridView is awesome, and thanks once again for all the help you guys have provided.