[英]child grid SelectionChanged event does not fire in DevExpress
I have 2 ASPxGridView controls - gvPatient and - gvOrder gvOrder is placed inside detail row template of gvPatient. 我有2个ASPxGridView控件-gvPatient和-gvOrder gvOrder放在gvPatient的详细信息行模板内。 the issue i am faciing is i have to get the values of rows of gvOrder(child) on focus row changed or selection changed.
我关注的问题是我必须更改焦点行或选择项时获取gvOrder(child)的行值。 I have code for these events but these events do not fire on selection changed of rows and focus changed of child grid .
我有这些事件的代码,但是这些事件不会在行的选择更改和子网格的焦点更改时触发。 Strange this- here these child grid events fire on gvPatient(parent) row selection and focus changed.
奇怪的是-这些子网格事件会在gvPatient(父级)行选择上触发并更改焦点。
code: 码:
<%@ 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>
You need to set properties SettingsBehavior.ProcessSelectionChangedOnServer and SettingsBehavior.ProcessFocusedRowChangedOnServer to true. 您需要将属性SettingsBehavior.ProcessSelectionChangedOnServer和SettingsBehavior.ProcessFocusedRowChangedOnServer设置为true。
From docs: "If the ProcessSelectionChangedOnServer property is set to false, the ASPxClientGridView.SelectionChanged event is handled on the client side without a postback to the server". 来自文档: “如果ProcessSelectionChangedOnServer属性设置为false,则在客户端上处理ASPxClientGridView.SelectionChanged事件,而无需回发到服务器”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.