Different versions of Dev may operate differently:
Similar official articles: https://www.devexpress.com/Support/Center/Example/Details/E529/
Related actions: http://codecentral.devexpress.com/E529/
This article is good use of the details of the use of methods, can be used for reference.
I use this method when I do not use the DataSource space. Here's how:
Front Code:
<dx:aspxgridview id="ASPxGridView1"runat="Server"Width="100%"AutoGenerateColumns="False"Clientidmode="autoid"Keyfieldname="Pk_notice"Clientinstancename="Grid"onrowdeleting="grid_rowdeleting"> <settingsdetail showdetailrow="True"/><settingsbehavior allowdragdrop="False"allowsort="False"allowfocusedrow="True"Allowselectbyrowclick="True"allowselectsinglerowonly="True"Confirmdelete="True"></settingsbehavior><settingstext emptydatarow="no Related records! "Confirmdelete="are you sure you want to delete? "></settingstext><settingsdetail showdetailrow="True"></SettingsDetail> <Templates> <DetailRow> <table style="width:100%"> <tr ><td style="text-align:center; Background-color: #FFF9EE; font-weight:bold ;">Notice</td> </tr> <tr ><td> <dx:aspxlabel id="ASPxLabel1"runat="Server"OnInit ="Aspxlabel1_init"> </dx:ASPxLabel> </td> </tr> </table> </DetailRow> </Templates> <Columns> <dx:gridviewcommandcolumn visibleindex="0"> <deletebutton text="Delete"visible="True"> </DeleteButton> <clearfilterbutton visible="True"> </ClearFilterButton> </dx:GridViewCommandColumn> <dx:gridviewdatatextcolumn caption="Pk_notice"Fieldname="Pk_notice"Visible="False"visibleindex="1"></dx:GridViewDataTextColumn> <dx:gridviewdatatextcolumn caption="title"Fieldname="Ctitle"visibleindex="2"> </dx:GridViewDataTextColumn> <Dx:gridviewdatatextcolumn Caption="Release Person"Fieldname="Cwriter"visibleindex="3"> </dx:GridViewDataTextColumn> <Dx:gridviewdatatextcolumn Caption="Release Time"Fieldname="dnewdate"visibleindex="4"> </dx:GridViewDataTextColumn> </Columns> &L T Settingsbehavior allowdragdrop="False"allowfocusedrow="True"Allowsort="False"Confirmdelete="True"allowselectsinglerowonly="True"allowselectbyrowclick="True"/> <settingstext emptydatarow="no Related records! "Confirmdelete="are you sure you want to delete? "/> </dx:ASPxGridView>
Background code:
protected voidAspxlabel1_init (Objectsender, EventArgs e) {Aspxlabel FV=(Aspxlabel) sender; Gridviewdetailrowtemplatecontainer Row=(Gridviewdetailrowtemplatecontainer) FV. Parent; stringTXT ="Select Cdetails from ei_notice where pk_notice = '"+ row. Keyvalue.tostring () +"'"; DataTable DT=CreateData1 (TXT); Fv. Text=dt. Rows [0][0]. ToString (); }
If you have similar questions, you can leave a message.
You can insert other available controls in Detailrow, including tables, of course. Similar examples can be found in the official web.
Add Detailrow in Dev-aspxgridview