locked
showing of no records found RRS feed

  • Question

  • User-80362235 posted

    Hi

     List<VendorDto> SearchVendorList = new List<VendorDto>();
               string searchtext = SearchTextBox.Text.ToLower();
               SearchVendorList = VendorList.FindAll(v => v.CompanyName.ToLower().StartsWith(searchtext)).ToList();
               if (SearchVendorList.Count > 0)
               {
                   NewList = SearchVendorList;
                   VendorRadGrid.DataSource = SearchVendorList;
                   VendorRadGrid.DataBind();
               }

    In above i have done for searching the records by entering the values in textbox its working fine and if i search for a record not found in that grid its not showing No records found. i am using telerik grid.what may be issue

    Wednesday, May 8, 2013 2:59 AM

Answers

  • User-1716253493 posted

    try this

    RadGrid1.MasterTableView.NoDetailRecordsText = "test";
    RadGrid1.MasterTableView.NoMasterRecordsText = "test";

    or use label outside rg

    Label1.text="No Records";



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 8, 2013 4:58 AM

All replies

  • User-1716253493 posted

    In design mode, edit template -> norecords template

    <telerik:RadGrid ID="VendorRadGrid" runat="server">
    
    <MasterTableView>
        <NoRecordsTemplate>
            NO RECORDS FOUND!
        </NoRecordsTemplate>
    </MasterTableView>
    
    </telerik:RadGrid>



    Wednesday, May 8, 2013 3:17 AM
  • Wednesday, May 8, 2013 3:19 AM
  • User-80362235 posted

    Hi

     <telerik:RadGrid ID="VendorRadGrid" runat="server" AllowPaging="True" AllowSorting="True"
                    OnNeedDataSource="VendorRadGrid_NeedDataSource" CssClass="textarea" AllowFilteringByColumn="false">
                    <MasterTableView AutoGenerateColumns="false">
                        <HeaderStyle CssClass="grid-header" ForeColor="White" />
                        <Columns>
                            <telerik:GridTemplateColumn DataField="ComapanyName" HeaderText="Vendor Name" AllowFiltering="false"
                                HeaderStyle-Width="100px" SortExpression="CompanyName">
                                <ItemTemplate>
                                    <asp:LinkButton ID="VendorLinkButton" runat="server" Text='<%# Eval("CompanyName") %>'
                                        OnClick="VendorLinkButton_Click" CommandArgument='<%# Eval("ID") %>' ForeColor="Blue" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridDateTimeColumn DefaultInsertValue="" DataField="RegDate" HeaderText="Created On"
                                EmptyDataText="N/A" DataFormatString="{0:MM/dd/yyyy hh:mm tt}" SortExpression="RegDate"
                                UniqueName="CreatedOn" DataType="System.DateTime" HeaderStyle-Width="120px" />
                            <telerik:GridBoundColumn DataField="Status" HeaderText="Status" UniqueName="Status"
                                SortExpression="Status" ReadOnly="true" HeaderStyle-Width="100px" />
                        </Columns>
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <NoRecordsTemplate>
                            NO RECORDS FOUND!
                        </NoRecordsTemplate>
                    </MasterTableView>

    </telerik:RadGrid>
    What will be the codebehind ?
    Wednesday, May 8, 2013 4:35 AM
  • User-1716253493 posted

    try this

    RadGrid1.MasterTableView.NoDetailRecordsText = "test";
    RadGrid1.MasterTableView.NoMasterRecordsText = "test";

    or use label outside rg

    Label1.text="No Records";



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 8, 2013 4:58 AM