I have a ListView defined like this ...
Simple.
When an item in the ListView is clicked, the following code runs...
Where index is the item index of the item clicked.
My problem is that clientDataValues is always empty. I know that the value of index is correct 'cos the items selected state toggles correctly. Even if I hard-code an index it's empty.
Am I supposed to cast a different spell if I'm client-side binding?
--
Stuart
<
telerik:RadListView
runat
=
"server"
ID
=
"RadListView1"
AllowMultiItemSelection
=
"false"
ItemPlaceholderID
=
"items"
ClientDataKeyNames
=
"ContactId, Surname, Forename, Organisation, Email"
>
<
LayoutTemplate
>
<
div
id
=
"listview"
class
=
"RadListView RadListView_#= owner.Skin #"
>
<
asp:Panel
runat
=
"server"
ID
=
"items"
ScrollBars
=
"Vertical"
/>
</
div
>
</
LayoutTemplate
>
<
ClientSettings
>
<
ClientEvents
OnCommand
=
"radListView1_OnCommand"
/>
<
DataBinding
>
<
ItemTemplate
>
<
div
class
=
"item"
>
<
div
>
<
strong
>#= String.format("{0}, {1}", Surname, Forename) #</
strong
>
</
div
>
<
div
>#= Organisation #</
div
>
<
div
>#= Email #</
div
>
</
div
>
</
ItemTemplate
>
<
SelectedItemTemplate
>
<
div
class
=
"item selected"
>
<
div
>
<
strong
>#= String.format("{0}, {1}", Surname, Forename) #</
strong
>
</
div
>
<
div
>Home: #= HomePhone #</
div
>
<
div
>Mobile: #= Mobile #</
div
>
</
div
>
</
SelectedItemTemplate
>
</
DataBinding
>
</
ClientSettings
>
</
telerik:RadListView
>
Simple.
When an item in the ListView is clicked, the following code runs...
listView.toggleSelection(index);
var
clientDataValues = listView.get_clientDataKeyValue()[index];
Where index is the item index of the item clicked.
My problem is that clientDataValues is always empty. I know that the value of index is correct 'cos the items selected state toggles correctly. Even if I hard-code an index it's empty.
Am I supposed to cast a different spell if I'm client-side binding?
--
Stuart