1.我在父網格中有一個網格,嵌套網格中有一個鏈接按鈕。telerik嵌套網格問題
2.對於鏈接按鈕,我需要使用嵌套網格的item命令事件,或者我也可以使用父網格的item命令。
3.問題是,當我點擊嵌套網格內的鏈接按鈕,然後項目命令事件不會被觸發的嵌套網格。但在母網格的情況下它的工作正常。
4.我已經嘗試過處理程序和item創建的事件,以便在代碼後面或aspx中使用處理程序。但沒有任何幫助讓我爲嵌套網格命令事件命中。
5.以前在中繼器的情況下,有一個項目命令處理所有的網格。我已經爲孩子和家長嘗試了不同的項目命令事件,但它也沒有工作。
編輯:這裏是一個代碼示例
Public Sub grd_ItemCommand(ByVal source As Object, _
ByVal e As nsTelerik.GridCommandEventArgs) _
Handles grdCollClaimLevel.ItemCommand, grdCollLineLevel.ItemCommand, _
grdCollLineValues.ItemCommand, grdCollPartLevel.ItemCommand, _
grdPTNClaimLevel.ItemCommand, _
grdPTNLineLevel.ItemCommand, grdPTNLineValues.ItemCommand
Dim uicCharMain As nsPTNWebContext.CharMainUIC
Dim uicCollDetl As nsPTNWebContext.CollDetlUIC
Dim uicPTNItem As nsPTNWebContext.PatternItemUIC
Try
Select Case e.CommandName
Case c_sBtnChar
uicCharMain = New nsPTNWebContext.CharMainUIC()
With uicCharMain
.CharID = CStr(e.CommandArgument)
.Busns_Event_Cd = m_uicRsltMatc.BusEvent
.PTN_LOB_Cd = m_uicRsltMatc.LOB
.UserID = m_uicRsltMatc.UserID
.ModePTN = m_uicRsltMatc.ModePattern
.ModeChar = m_uicRsltMatc.ModeChar
.ModeColl = m_uicRsltMatc.ModeColl
.ModeRept = m_uicRsltMatc.ModeRept
.PageMode = nsPTNWebContext.CharMainUIC.enPageMode.View
.TabMode = m_uicRsltMatc.TabMode
End With
Me.PageState.Save()
Me.Navigation.AddMe(c_sCharMain)
Me.Navigation.Transfer(uicCharMain)
Case c_sBtnColl
uicCollDetl = New nsPTNWebContext.CollDetlUIC(_
CStr(e.CommandArgument), _
m_uicRsltMatc.BusEvent, _
m_uicRsltMatc.LOB)
With uicCollDetl
.UserID = m_uicRsltMatc.UserID
.ModeColl = m_uicRsltMatc.ModeColl
.PageMode = nsPTNWebContext.CollDetlUIC.enPageMode.View
.ModePTN = m_uicRsltMatc.ModePattern
.ModeChar = m_uicRsltMatc.ModeChar
.ModeRept = m_uicRsltMatc.ModeRept
.BusEvent = m_uicRsltMatc.BusEvent
.LOB = m_uicRsltMatc.LOB
.TabMode = m_uicRsltMatc.TabMode
End With
Me.PageState.Save()
Me.Navigation.AddMe(c_sCollDetails)
Me.Navigation.Transfer(uicCollDetl)
Case c_sBtnPattern
uicPTNItem = New nsPTNWebContext.PatternItemUIC(CStr(e.CommandArgument))
With uicPTNItem
.BusEvent = m_uicRsltMatc.BusEvent
.LOB = m_uicRsltMatc.LOB
.UserID = m_uicRsltMatc.UserID
.ModeChar = m_uicRsltMatc.ModeChar
.ModeColl = m_uicRsltMatc.ModeColl
.ModePattern = m_uicRsltMatc.ModePattern
.ModeRept = m_uicRsltMatc.ModeRept
.CharID = m_uicRsltMatc.CharID
.CollID = m_uicRsltMatc.CollID
.PageMode = nsPTNWebContext.PatternItemUIC.enPageMode.View
.TabMode = m_uicRsltMatc.TabMode
End With
Me.PageState.Save()
Me.Navigation.AddMe(c_sPatternItem)
Me.Navigation.Transfer(uicPTNItem)
End Select
Finally
Cleanup(uicCharMain)
uicCharMain = Nothing
Cleanup(uicCollDetl)
uicCollDetl = Nothing
Cleanup(uicPTNItem)
uicPTNItem = Nothing
End Try
End Sub
而這裏的標記
<tel:radgrid runat="server" id="grdPTNPartLevel" width="100%" autogeneratecolumns="false"
horizontalalign="Justify">
<mastertableview width="100%">
<NestedViewTemplate>
<tel:RadGrid runat="server" ID="grdPTNPartValues" Width="100%" AutoGenerateColumns="false"
HorizontalAlign="Justify" OnItemDataBound="grdPTNPartValues_ItemDataBound">
</tel:RadGrid>
<tel:RadGrid runat="server" ID="grdPTNLineLevel" Width="100%" AutoGenerateColumns="false"
HorizontalAlign="Justify" OnItemDataBound="grdPTNLineLevel_ItemDataBound" OnItemCommand="grd_ItemCommand">
<MasterTableView Width="100%">
<NestedViewTemplate>
<tel:RadGrid runat="server" ID="grdPTNLineValues" Width="100%" AutoGenerateColumns="false"
HorizontalAlign="Justify" OnItemDataBound="grdPTNLineValues_ItemDataBound" OnItemCommand="grd_ItemCommand">
</tel:RadGrid>
</NestedViewTemplate>
</MasterTableView>
</tel:RadGrid>
</NestedViewTemplate>
</mastertableview>
</tel:radgrid>
有些代碼可以幫助說明問題。你能發佈整個網格的標記嗎? – Aaron 2010-03-17 15:01:42
謝謝,我剛剛發佈的標記 – Jeff 2010-03-17 16:13:56
也此示例http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx可以幫助 – dankyy1 2010-09-16 08:09:24