 |
|
ต้องการสร้าง Grid Detail แต่ไม่สามารถคลิ๊กเข้าไปดู Grid detail ภายในได้ รบกวนผู้รู้หน่อยค่ะ |
|
 |
|
|
 |
 |
|
ขอบคุณค่ะแต่ยังไม่ใช่ที่ต้องการค่ะ
ต้องการ Grid ซ้อน Grid อ่ะค่ะ   
|
 |
 |
 |
 |
Date :
2016-04-08 11:49:03 |
By :
WonderMoo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ค่ะเป็น Grid Detail ของ Grid อีกที
|
 |
 |
 |
 |
Date :
2016-04-08 12:57:19 |
By :
WonderMoo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|




Code (ASP)
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="frmMasterGrid_Detail.aspx.vb" Inherits="CacheHelperProject.frmMasterGrid_Detail" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.11.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v12.2, Version=12.2.11.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<dx:ASPxGridView ID="dgvMaster" runat="server">
<Templates>
<DetailRow>
<dx:ASPxGridView ID="dgvDetail" runat="server"
onbeforeperformdataselect="dgvDetail_BeforePerformDataSelect" Theme="DevEx">
</dx:ASPxGridView>
</DetailRow>
</Templates>
<SettingsDetail ShowDetailRow="True" />
</dx:ASPxGridView>
</div>
</form>
</body>
</html>
Code (VB.NET)
Public Partial Class frmMasterGrid_Detail
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub dgvDetail_BeforePerformDataSelect(ByVal sender As Object, ByVal e As EventArgs)
Dim dgv As DevExpress.Web.ASPxGridView.ASPxGridView = TryCast(sender, DevExpress.Web.ASPxGridView.ASPxGridView)
Dim KeyMaster As String = dgv.GetMasterRowKeyValue 'เป็นคีย์หลักของ GridView สามารถกำหนดได้ที่ Property => KeyFieldName
Dim KeyETC As String = dgv.GetMasterRowFieldValues("COLUMN_NAME") 'อ่านค่าจาก DataRow ตาม Column ที่ต้องการ
Dim dtSomeData As New DataTable
dgv.DataSource = dtSomeData
End Sub
End Class
|
 |
 |
 |
 |
Date :
2016-04-08 16:46:52 |
By :
deksoke |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าหมายถึงแค่กดเครื่องหมาย + แล้ว Detail Row แสดงออกมาก็ตามแค่ภาพที่ 2 ครับ
|
 |
 |
 |
 |
Date :
2016-04-08 16:50:26 |
By :
deksoke |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำการเอา gridview ไปใส่ใน itemtemplate ของ gridview อีกทีครับ จากนั้นก็ลุยเลยครับ ตาม Comment 6 เลยครับ
|
 |
 |
 |
 |
Date :
2016-04-08 16:52:22 |
By :
taotechnocom |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากค่ะ ทำได้แล้วดีใจจุงเบย
|
 |
 |
 |
 |
Date :
2016-04-09 08:57:50 |
By :
WonderMoo |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|