First you need to configure a few parameters so as not to display the data pattern, first you need an actual data source that returns null or empty, if you just do this to check the target and want to avoid the actual data source, then the code provided by ItsPete is good. You also need to place EnableNoRecordsTemplate = "true" in the MasterTableView tags.
Take a look at this code.
<telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" DataSourceID="SqlDataSource1"> <MasterTableView EnableNoRecordsTemplate="true" ShowHeadersWhenNoRecords="false" AutoGenerateColumns="False" datakeynames="ID" datasourceid="SqlDataSource1"> <NoRecordsTemplate> No Data Found. </NoRecordsTemplate> <Columns> <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" DefaultInsertValue="" HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="NAME" DefaultInsertValue="" HeaderText="NAME" SortExpression="NAME" UniqueName="NAME"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="PASSWORD" DefaultInsertValue="" HeaderText="PASSWORD" SortExpression="PASSWORD" UniqueName="PASSWORD"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DEPARTMENT" DefaultInsertValue="" HeaderText="DEPARTMENT" SortExpression="DEPARTMENT" UniqueName="DEPARTMENT"> </telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Conn %>" SelectCommand="SELECT * from Users WHERE ID = '0'"> </asp:SqlDataSource>
The data columns are irrelevant here (just an example). For more information about RadGrid, visit the RadGrid Tips - Empty Data Post .
Ahmed source share