1.这里我在父网格中有一个网格,嵌套网格中有一个链接按钮。
2.对于链接按钮我需要使用嵌套网格的item命令事件或者我也可以使用父网格的item命令。
3.问题是当我单击嵌套网格中的链接按钮时,不会为嵌套网格触发项目命令事件。但是在父网格的情况下它工作正常。
4.我已经尝试过处理程序和项目创建事件,也可以在代码后面或 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>