Hi. I would really appreciate some guidance to show me how to read the state of a control property in a list. I have a simple list that has a user control within the item template.
I want to have a checkbox for each item so that the user can select one or more items. I can easily add the checkbox to the user control and provide code to get/set the checkbox (it is not linked to any datasource data but would be simply to enable the user to select items).
External to the listView I have a button. In the codebehind for the button I want to:
foreach (var i in myList.items) { }
to parse through the displayed items in the listView. My first question is will myList.items return the displayed items (after paging) or all of the items (ie if I have 100 items displayed as 10 pages of 10 items does myList.items return the displayed items or all 100 items - if it returns all is there a way to only get the displayed items in the current page).
within my foreach loop how can I reference the user control. I want to just read a property from the user control; ie. myItem.isChecked
Thanks
I want to have a checkbox for each item so that the user can select one or more items. I can easily add the checkbox to the user control and provide code to get/set the checkbox (it is not linked to any datasource data but would be simply to enable the user to select items).
External to the listView I have a button. In the codebehind for the button I want to:
foreach (var i in myList.items) { }
to parse through the displayed items in the listView. My first question is will myList.items return the displayed items (after paging) or all of the items (ie if I have 100 items displayed as 10 pages of 10 items does myList.items return the displayed items or all 100 items - if it returns all is there a way to only get the displayed items in the current page).
within my foreach loop how can I reference the user control. I want to just read a property from the user control; ie. myItem.isChecked
Thanks
<
telerik:RadListView
ID
=
"myList"
runat
=
"server"
ItemPlaceholderID
=
"PlaceHolder1"
DataKeyNames
=
"ListingId"
ConvertEmptyStringToNull
=
"False"
AllowPaging
=
"True"
PageSize
=
"15"
>
<
LayoutTemplate
>
<
asp:PlaceHolder
ID
=
"PlaceHolder1"
runat
=
"server"
></
asp:PlaceHolder
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
div
class
=
"rlvI"
>
<
uc:uListItem
ID
=
"myItem"
runat
=
"server"
ListingId='<%# Eval("ListingId") %>' Title='<%# Eval("Title") %>'
Description='<%# Eval("Description") %>' Owner='<%# Eval("Owner") %>' image='<%# Eval("ThumbImg") %>'
Rating='<%# Eval("Rating") %>' Reviewers='<%# Eval("NoRate") %>' HasMail='<%# Eval("mail") %>' />
</
div
>
</
ItemTemplate
>
<
EmptyDataTemplate
>
<
div
>
<
div
>
There are no items to be displayed.</
div
>
</
div
>
</
EmptyDataTemplate
>
</
telerik:RadListView
>