Add Detailrow in Dev-aspxgridview

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.