I have a case where i use a radbutton inside the nestedviewtemplate that uses 'OnClientCheckedChanged' event that i need to set the mastertable row´s expanded state and i cant seem to find out how to access the row dataitem from the button, does anyone have an idea?
My nestedviewtemplate,
<
NestedViewTemplate
>
<
asp:Panel
ID
=
"NestedViewPanel"
runat
=
"server"
CssClass
=
"divArtDetailsView"
>
<
div
class
=
"contactWrap"
>
<
table
width
=
"100%"
cellpadding
=
"0"
cellspacing
=
"0"
>
<
tr
>
<
td
width
=
"140px"
>
<
asp:Image
runat
=
"server"
ID
=
"imgArt"
/>
</
td
>
<
td
>
Diverse information ska in här, alla artikel extra kopplingar, fritext och lagerstatus
</
td
>
<
td
style
=
"vertical-align:top; text-align:right; padding-right:5px;"
>
<
telerik:RadButton
runat
=
"server"
ID
=
"btnPinRow"
AutoPostBack
=
"false"
ButtonType
=
"ToggleButton"
ToggleType
=
"CheckBox"
Checked
=
"false"
OnClientCheckedChanged
=
"pinChanged"
>
<
ToggleStates
>
<
telerik:RadButtonToggleState
Width
=
"16px"
IsBackgroundImage
=
"true"
ImageUrl
=
"images/pinned.png"
/>
<
telerik:RadButtonToggleState
Width
=
"16px"
IsBackgroundImage
=
"true"
ImageUrl
=
"images/unpinned.png"
HoveredImageUrl
=
"images/pinned.png"
Selected
=
"false"
/>
</
ToggleStates
>
</
telerik:RadButton
>
<
br
/><
br
/>
<
telerik:RadNumericTextBox
runat
=
"server"
ID
=
"txtAnt"
Width
=
"45px"
NumberFormat-DecimalDigits
=
"0"
Value
=
"1"
></
telerik:RadNumericTextBox
>
<
telerik:RadButton
runat
=
"server"
ID
=
"btnAddToCart"
Text
=
"Add"
></
telerik:RadButton
>
</
td
>
</
tr
>
</
table
>
</
div
>
</
asp:Panel
>
</
NestedViewTemplate
>
}
function
pinChanged(sender, eventArgs) {
var
button = sender;
//how to find parent mastertable row dataitem??
}
_setExpanded:
function
(k,i,n){
if
(!
this
._getAnimationContainer()||!
this
.get_isEnabled()){
return
;
}
var
o=
this
.get_panelBar();
var
j=
this
._getAnimatedElement();
var
f=
this
.get_parent();
if
(o._transitionAnimationIsInProgress){
return
;
}
if
(k){
if
(
this
.get_expanded()){
return
;
}
if
(
this
.get_level()==0&&o.get_fullExpandedItem()){
if
(window.netscape&&!window.opera){j.style.overflow=
"hidden"
;
this
._changedOverflow=
true
;
}j.style.height=o._getGroupHeight()+
"px"
;
if
(window.netscape&&!window.opera){j.style.overflow=
"auto"
;
this
._changedOverflow=
false
;
}}j.style.display=
"none"
;
j.style.width=
"100%"
;
if
(
this
.get_level()>0&&!o.get_fullExpandedItem()){f._setChildrenHeight(
""
);
_childTypeName = "Telerik.Web.UI.RadPanelItem"
_childControlsCreated = true
_childListElement = {object} -> i see all my list element when i look at the innerHTML, so they are there.
_clientState.exapandedItems = 0
_enabled = true
_expendedItem = null
_id = null
_initialized = true
_windowLoadHandler:
function
(f){
if
(
this
.get_element()==
null
){
return
;
}
if
(
this
.get_expanded()&&
this
.get_childListElement()){
this
.get_childListElement().style.display=
"none"
;
this
.get_childListElement().style.width=
"100%"
;
if
(
this
.get_level()>0&&!
this
.get_panelBar().get_fullExpandedItem()){
this
.get_parent()._setChildrenHeight(
""
);
<
script
src
=
"/WebResource.axd?d=pynGkmcFUV13He1Qd6_TZHaIQEo1TJyMkhHHAzOMocNupHiRRsYVZc7_y2Lehv7URuNG2uVz2l9dOjIpDD9lCQ2&t=635117001316159565"
type
=
"text/javascript"
></
script
>
<
script
src
=
"/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=s_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3ad618f02c-bda7-40f1-bb64-308e08f719c3%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2013.3.1015.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a7a1d9c2d-6cf2-464f-9ad3-e479c730ac61%3a16e4e7cd%3ab7778d6c%3ae085fe68%3af7645509%3a24ee1bba%3a7165f74"
type
=
"text/javascript"
></
script
>
<
script
type
=
"text/javascript"
>
GridTemplateColumn
not score loads the Skin.<
telerik:RadGrid
ID
=
"RadGridClienteInd"
runat
=
"server"
AllowMultiRowSelection
=
"True"
AllowPaging
=
"True"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
Skin
=
"Vista"
ShowGroupPanel
=
"False"
Width
=
"100%"
>
<
SortingSettings
SortedAscToolTip
=
"Ordenação crescente"
SortedDescToolTip
=
"Ordenação decrescente"
SortToolTip
=
"Clique aqui para ordenar"
/>
<
ClientSettings
AllowDragToGroup
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
></
Selecting
>
<
Scrolling
AllowScroll
=
"True"
UseStaticHeaders
=
"True"
></
Scrolling
>
<
ClientMessages
DragToGroupOrReorder
=
"Drag to group"
/>
<
Selecting
AllowRowSelect
=
"True"
/>
<
ClientMessages
DragToGroupOrReorder
=
"Drag to group"
></
ClientMessages
>
<
ClientEvents
OnRowDblClick
=
"RowDblClick"
/>
</
ClientSettings
>
<
GroupingSettings
CollapseTooltip
=
""
ExpandTooltip
=
"Expandir grupo"
GroupContinuedFormatString
=
"... continuando o grupo da página anterior. "
GroupContinuesFormatString
=
" Grupo continua na próxima página."
GroupSplitDisplayFormat
=
"Mostrando {0} de {1} items."
UnGroupButtonTooltip
=
"Clique aqui para desagrupar"
UnGroupTooltip
=
""
/>
<
GroupPanel
Text
=
" Arraste o cabeçalho de uma coluna e solte aqui para agrupar"
>
</
GroupPanel
>
<
MasterTableView
ClientDataKeyNames
=
"cod_cliente_ligacao"
PagerStyle-PageSizeLabelText
=
"Itens por página"
NoDetailRecordsText
=
""
NoMasterRecordsText
=
""
HierarchyLoadMode
=
"ServerOnDemand"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridTemplateColumn
FilterControlAltText
=
"Filter TemplateColumn1 column"
HeaderText
=
"Mail"
UniqueName
=
"ind_visualizar"
HeaderStyle-Width
=
"40px"
ItemStyle-Width
=
"40px"
ItemStyle-VerticalAlign
=
"Middle"
ItemStyle-HorizontalAlign
=
"Center"
SortExpression
=
"ind_visualizar"
>
<
ItemTemplate
>
<
asp:Image
ID
=
"Mail"
runat
=
"server"
ImageUrl='<%#"http://www.lanel.net.br/Geral.ashx?
GeralId
=
" + IIf(Eval("
ind_visualizar") = 1, "mailIcon.gif", "Em_aberto.png")%>' style="margin-bottom: 10px; margin-left: 2px" Width="18px" />
</
ItemTemplate
>
<
HeaderStyle
Width
=
"40px"
HorizontalAlign
=
"Center"
></
HeaderStyle
>
<
ItemStyle
HorizontalAlign
=
"Center"
VerticalAlign
=
"Middle"
Width
=
"40px"
></
ItemStyle
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter column3 column"
HeaderText
=
"Dt. Ligação"
UniqueName
=
"dat_ligacao"
DataField
=
"dat_ligacao"
SortExpression
=
"dat_ligacao"
DataFormatString
=
"{0:d}"
ItemStyle-Width
=
"80px"
HeaderStyle-Width
=
"80px"
>
<
HeaderStyle
Width
=
"80px"
HorizontalAlign
=
"Center"
></
HeaderStyle
>
<
ItemStyle
Width
=
"80px"
></
ItemStyle
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter column column"
HeaderText
=
"Nome Cliente"
UniqueName
=
"nome"
DataField
=
"nome"
SortExpression
=
"nome"
>
<
HeaderStyle
Width
=
"400px"
HorizontalAlign
=
"Center"
></
HeaderStyle
>
<
ItemStyle
Width
=
"400px"
></
ItemStyle
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter column2 column"
HeaderText
=
"Municipio"
UniqueName
=
"municipio"
DataField
=
"municipio"
SortExpression
=
"municipio"
>
<
HeaderStyle
HorizontalAlign
=
"Center"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
FilterControlAltText
=
"Filter column1 column"
HeaderText
=
"Situação"
UniqueName
=
"situacao_contato"
DataField
=
"situacao_contato"
SortExpression
=
"situacao_contato"
>
<
HeaderStyle
HorizontalAlign
=
"Center"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"cod_cliente_ligacao"
FilterControlAltText
=
"Filter cod_cliente_ligacao column"
HeaderText
=
"cod_cliente_ligacao"
UniqueName
=
"cod_cliente_ligacao"
Visible
=
"false"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
></
EditColumn
>
</
EditFormSettings
>
<
PagerStyle
PageSizeLabelText
=
"Itens por página"
FirstPageToolTip
=
"Primeira Página"
LastPageToolTip
=
"Ultima Página"
NextPagesToolTip
=
"Próxima Página"
NextPageToolTip
=
"Próxima Página"
PagerTextFormat
=
""
PrevPagesToolTip
=
""
PrevPageToolTip
=
""
></
PagerStyle
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
<
HeaderContextMenu
CssClass
=
"GridContextMenu GridContextMenu_Default"
></
HeaderContextMenu
>
</
telerik:RadGrid
>
Imports
Telerik.Web.UI
Partial
Class
xtopia_ContentMS_testlistview
Inherits
System.Web.UI.Page
Protected
Sub
rap_AjaxRequest(sender
As
Object
, e
As
AjaxRequestEventArgs)
Handles
rap.AjaxRequest
ltl_show_text.Text = e.Argument
End
Sub
End
Class
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="test_onkeyupEvent.aspx.vb" Inherits="xtopia_ContentMS_testlistview" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html>
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
>
<
title
></
title
>
<
script
src
=
"http://code.jquery.com/jquery-1.10.1.min.js"
></
script
>
<
script
src
=
"http://code.jquery.com/jquery-migrate-1.2.1.min.js"
></
script
>
<
script
>
function requestStart(sender, eventArgs) {
console.log("ss");
}
function onkeyupEvent() {
var text = $find("<%= txt_art_search_box.ClientID %>").get_textBoxValue();
console.log(text);
$find('<%=rap.ClientID %>').ajaxRequest($('#txt_art_search_box').val());
}
</
script
>
</
head
>
<
body
>
<
form
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadAjaxPanel
runat
=
"server"
ID
=
"rap"
>
<
telerik:RadTextBox
AutoPostBack
=
"false"
AutoCompleteType
=
"Disabled"
onkeyup
=
"onkeyupEvent();"
ID
=
"txt_art_search_box"
runat
=
"server"
EmptyMessage
=
"Type here to search"
Width
=
"80%"
>
</
telerik:RadTextBox
>
<
br
/>
You type: <
asp:Literal
ID
=
"ltl_show_text"
runat
=
"server"
/>
</
telerik:RadAjaxPanel
>
</
form
>
</
body
>
</
html
>
if (cell.CellType == PivotGridDataCellType.ColumnGrandTotalDataCell || cell.CellType == PivotGridDataCellType.RowGrandTotalDataCell)
{
if ((cell.Field as PivotGridAggregateField).DataField == "Amount")
{
string maxvaluerow = cell.ParentRowIndexes[1].ToString();
if (maxvaluerow == "11")
{
cell.Text = "";
// here i want to set the grandtotal result as Max value of row
}
}
}