私は 2 つの ASPxGridView コントロールを持っています - gvPatient と - gvOrder gvOrder は gvPatient の詳細行テンプレート内に配置されます。私が直面している問題は、フォーカス行の変更または選択の変更で gvOrder(child) の行の値を取得する必要があることです。これらのイベントのコードがありますが、これらのイベントは行の選択が変更され、子グリッドのフォーカスが変更されても発生しません。奇妙なことに、これらの子グリッド イベントは、gvPatient(親) の行選択とフォーカスの変更時に発生します。
コード:
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Main.master" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content" ContentPlaceHolderID="MainContent" runat="server">
<table width="100%" border="0" cellpadding="2" cellspacing="2">
<tr>
<td>
</td>
</tr>
<tr>
<td style="height:300px;" valign="top">
<dx:ASPxGridView ID="gvPatient" runat="server" AutoGenerateColumns="false" DataSourceID="SqlDataSourceMaster"
Width="100%" Font-Size="11px" KeyFieldName="PAT_NUMBER" >
<Columns>
<dx:GridViewDataTextColumn Caption="PAT_NUMBER" FieldName="PAT_NUMBER" Visible="false">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="" FieldName="PATIENT_ID" Visible="false">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="Patient" FieldName="FULL_NAME" >
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="MRN" FieldName="MRN" >
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="Nursing Unit" FieldName="NURSING_UNIT">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="Room" FieldName="ROOM_BED" >
</dx:GridViewDataTextColumn>
</Columns>
<Templates>
<DetailRow>
<div style="padding:5px;">
<div>
<dx:ASPxGridView ID="gvOrder" runat="server" KeyFieldName="ORDER_KEY" DataSourceID="SqlDataSourceDetail"
Width="100%" AutoGenerateColumns="false"
nbeforeperformdataselect="gvOrder_BeforePerformDataSelect"
OnSelectionChanged="gvOrder_SelectionChanged"
onfocusedrowchanged="gvOrder_FocusedRowChanged"
ondetailrowexpandedchanged="gvOrder_DetailRowExpandedChanged">
<Columns>
<dx:GridViewDataTextColumn Caption="ORDER KEY" FieldName="ORDER_KEY" Visible="false">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="PAT_NUMBER" FieldName="PAT_NUMBER" Visible="false">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="Rx Edit" FieldName="RX" >
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="Reason Code" FieldName="REASON_CODE" >
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn Caption="Note" FieldName="NOTE">
</dx:GridViewDataTextColumn>
</Columns>
<Settings ShowFooter="True" />
<SettingsBehavior AllowFocusedRow="true" AllowSelectByRowClick="true" />
</dx:ASPxGridView>
</div>
<div style="padding-top:5px; padding-left:5px;">
<table cellpadding="2" cellspacing="2" border="0" width="100%">
<tr>
<td rowspan="3">
<dx:ASPxRoundPanel ID="ASPxRoundPanel2" runat="server" Width="500px" BackColor="White"
HeaderText="PLEASE FOLLOW FEDERAL AND STATE GUIDELINES TO ORDER THIS CONTROLLED SUBSTANCE" >
<PanelCollection>
<dx:PanelContent>
<table border="0" cellpadding="2" cellspacing="2" width="100%">
<tr>
<td align="left">
<dx:ASPxLabel ID="ASPxLabel11" runat="server" Text="Start">
</dx:ASPxLabel>
<b><dx:ASPxLabel ID="ASPxLabel12" runat="server" Text="04-04-13" Font-Bold="true" >
</dx:ASPxLabel></b>
</td>
<td align="right">
<dx:ASPxLabel ID="ASPxLabel13" runat="server" Text="Active" Font-Bold="true" >
</dx:ASPxLabel>
</td>
</tr>
<tr>
<td colspan="2">
<dx:ASPxLabel ID="ASPxLabel14" runat="server" Text="Initial">
</dx:ASPxLabel>
<b><dx:ASPxLabel ID="ASPxLabel15" runat="server" Text="04-04-13" Font-Bold="true" >
</dx:ASPxLabel></b>
</td>
</tr>
<tr>
<td colspan="2">
<dx:ASPxLabel ID="ASPxLabel16" runat="server" Text="Time Stamp">
</dx:ASPxLabel>
<b><dx:ASPxLabel ID="ASPxLabel17" runat="server" Text="04-04-13 02:53" Font-Bold="true" >
</dx:ASPxLabel></b>
</td>
</tr>
<tr>
<td colspan="2">
<dx:ASPxLabel ID="ASPxLabel18" runat="server" Text="OXYCODONE HCL IR 5MG TABLET (OXYCODONE HCL IR 5MB TABLET)" ></dx:ASPxLabel>
<br /><dx:ASPxLabel ID="ASPxLabel19" runat="server" Text="ONE TAB(5 mg) by mouth every 4 hours as neded pain tele order by bhardwaj, rakesh" ></dx:ASPxLabel>
<br /><dx:ASPxLabel ID="ASPxLabel20" runat="server" Text="noted on 04-04-13 2:53pm by erma entena, md" ></dx:ASPxLabel>
</td>
</tr>
</table>
</dx:PanelContent>
</PanelCollection>
</dx:ASPxRoundPanel>
</td>
<td>
<dx:ASPxLabel ID="ASPxLabel1" runat="server" Text="Action:"></dx:ASPxLabel>
</td>
<td>
<dx:ASPxComboBox ID="ASPxComboBox1" runat="server" ValueType="System.String" Width="300px" >
<Items>
<dx:ListEditItem Text="" />
<dx:ListEditItem Text="Continue" />
<dx:ListEditItem Text="Discontinue" />
<dx:ListEditItem Text="Substitute" />
<dx:ListEditItem Text="Wean/Taper" />
</Items>
</dx:ASPxComboBox>
</td>
</tr>
<tr>
<td>
<dx:ASPxLabel ID="ASPxLabel3" runat="server" Text="Reason:"></dx:ASPxLabel>
</td>
<td>
<dx:ASPxComboBox ID="cbReason" runat="server" ValueType="System.String" Width="300px" >
<Items>
<dx:ListEditItem Text="" />
<dx:ListEditItem Text="Duplicate Drugs" />
<dx:ListEditItem Text="Ineffective drug therapy" />
<dx:ListEditItem Text="Non-compliance with drug therapy" />
<dx:ListEditItem Text="Significant side effects" />
<dx:ListEditItem Text="Significant drug interactions" />
<dx:ListEditItem Text="Behavioral Changes" />
<dx:ListEditItem Text="POLST/MOLST" />
<dx:ListEditItem Text="Refusing Medication" />
</Items>
</dx:ASPxComboBox>
</td>
</tr>
<tr>
<td>
<dx:ASPxLabel ID="ASPxLabel2" runat="server" Text="Comment:"></dx:ASPxLabel>
</td>
<td>
<dx:ASPxMemo ID="tbNote" runat="server" Height="70px" Width="300px" ></dx:ASPxMemo>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
<dx:ASPxButton ID="btnSave" runat="server" Text="Save" onclick="btnSave_Click"></dx:ASPxButton>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
<dx:ASPxLabel ID="lblMsg" runat="server" Text="" ForeColor="Red"></dx:ASPxLabel>
</td>
</tr>
</table>
</div>
</div>
</DetailRow>
</Templates>
<SettingsDetail ShowDetailRow="true" AllowOnlyOneMasterRowExpanded="true" />
<SettingsBehavior AllowFocusedRow="true" AllowSelectByRowClick="true" ProcessSelectionChangedOnServer="True" />
</dx:ASPxGridView>
</td>
</tr>