This is a migrated thread and some comments may be shown as answers.

Telerik rad list view hide items using jquery

1 Answer 236 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Rasangika
Top achievements
Rank 1
Rasangika asked on 29 Aug 2016, 11:16 AM

I need to hide list view items depend on the values in item.

 

  <telerik:RadListView ID="lvCustomers" Width="97%" runat="server" ItemPlaceholderID="ProductsHolder"
                allowsorting="true" DataKeyNames="Guid">
                <LayoutTemplate>
                    <fieldset style="max-width: 1100px" id="FieldSet1">
                        <asp:Panel ID="ProductsHolder" runat="server">
                        </asp:Panel>
                        <telerik:RadDataPager RenderMode="Lightweight" ID="dpCustomers" runat="server">
                            <Fields>
                                <telerik:RadDataPagerTemplatePageField>
                                    <PagerTemplate>
                                        <asp:Label ID="lblTotalRecordCount" runat="server" Text="<%# TotalCustomerText %>"></asp:Label>
                                        <asp:Label ID="labTotalCustomerCountValue" runat="server" Text="<%# TotalCustomerValue %>"></asp:Label>
                                    </PagerTemplate>
                                </telerik:RadDataPagerTemplatePageField>
                            </Fields>
                        </telerik:RadDataPager>
                    </fieldset>
                </LayoutTemplate>
                <ItemTemplate>
                    <div class="hubCustomer" id="divCustomer" runat="server">
                        <asp:HiddenField Id="hfIsMyCustomer" runat="server" />
                        <div class="row">
                            <div class="col-md-5 nopadding hubCustomerCode">
<asp:Label ID="lblCustomerCode" runat="server"></asp:Label>  
                            </div>
                            <div class="col-md-4 nopadding text-right">Budget</div>

                            <div class="col-md-3 nopadding text-left">
                                <div class="circleSuccess" id="divBudgetPerformance" runat="server"></div>
                            </div>
                        </div>

                        <div class="row">
                            <div class="col-md-12 nopadding">
                                <asp:Label ID="lblCustomerName" runat="server"></asp:Label>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-md-12 CustomerListProgress">
                                <uc1:ProgressBar ID="pbCustomerProgress" runat="server" Editable="false" />
                            </div>
                        </div>
</div>
                </ItemTemplate>
            </telerik:RadListView>


        function HideCustomers() {
            debugger;
            var list = $find('<%= lvCustomers.ClientID %>'); // the List view customer data hold
            var items = list.get_items(); // this method not working

            for (var i = 0; i < items.get_count() ; i++) {  //loop through item

                //need to do
Get value of hfIsMyCustomer
If value is false , hide entire item

            }
        };

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 01 Sep 2016, 07:10 AM
Hello Rasangika,

I suggest that you examine the web site provided in the following resource since RadDataForm is very similar to RadListView:
http://www.telerik.com/support/code-library/accessing-controls-in-dataform

I hope this will prove helpful.

Regards,
Eyup
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
ListView
Asked by
Rasangika
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or