Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6470563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:07:32+00:00 2026-05-25T06:07:32+00:00

I am using Telerik Radgrid for my aspx page. I have uploaded the screenshot

  • 0

I am using Telerik Radgrid for my aspx page. I have uploaded the screenshot here. The problem here is that, if there are no items in the radgrid, the message ‘No records to display’ should expand to the end of the grid. If you see the screenshot, the message box within the grid ends before the grid actually ends. I have uploaded the code that I have used. Is there any way out?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManageUsers.aspx.cs" Inherits="Settings_ManageUsers" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/style002.css">

</head>

<body>
   <h2 class="Boldheader" style="color: #4173be; font-size: x-large">Manage Users</h2>
    <form id="form1" runat="server">
    <asp:Button ID="Button1" runat="server" OnClick="btnAdd_Click" CssClass="formEditBtn" Text="Add User" />
    <telerik:RadScriptManager runat="server" ID="ScriptManager1"></telerik:RadScriptManager>

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">   
    <script type="text/javascript">
        function pageLoad(sender, eventArgs) {
            if (!eventArgs.get_isPartialLoad()) {
                $find("<%= radAjax.ClientID %>").ajaxRequest("InitialPageLoad");
            }
        }
        function OnClientClose(oWnd, args) {
            var radMgr = $find("<%=radAjax.ClientID %>");
            radMgr.ajaxRequest("Rebind");
        }
    </script>   
    <script type="text/javascript">
        //<![CDATA[
        /*function openWin(id) {
        if (id != "") {
        var oWnd = radopen("EditUser.aspx?id=" + id, "_self");
        }
        }*/

        function openWin(id) {
            window.open("EditUser.aspx?id=" + id, "_self");
        }

        //]]>
    </script>
    </telerik:RadCodeBlock> 

    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false"  VisibleStatusbar="false"
        ReloadOnShow="true" runat="server" OnClientPageLoad="OnClientClose">
        <Windows>
            <telerik:RadWindow ID="EditWindow" Behaviors="Reload" runat="server"
                NavigateUrl="EditUser.aspx" VisibleTitlebar="false" >
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

    <telerik:RadAjaxManager runat="server" ID="radAjax" OnAjaxRequest="AjaxManager_AjaxRequest" DefaultLoadingPanelID="RadAjaxLoadingPanel1" >
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="radAjax">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grdUsers" UpdatePanelRenderMode="Inline" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadGrid runat="server" ID="grdUsers" AutoGenerateColumns="false" OnItemDataBound="grdUsers_ItemDataBound"
     OnNeedDataSource="grdUsers_NeedDataSource" 
        OnItemCommand="grdUsers_ItemCommand" GridLines="Both" Width="288px" 
        style="margin-right: 13px">
    <HeaderStyle CssClass="SummaryTableHdrRow" Font-Bold="true" />
    <ItemStyle CssClass="SummaryTableDataRow" />
    <AlternatingItemStyle CssClass="SummaryTableDataRow" />
    <MasterTableView DataKeyNames="UserId" Width="100%">
    <Columns>
        <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name" ></telerik:GridBoundColumn>
        <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="delete" ConfirmText="Are you sure you want to delete this user? (If yes, press OK, else cancel)"
         ImageUrl="../images/delx.gif" ItemStyle-Width="25px" HeaderStyle-Width="25px"></telerik:GridButtonColumn>
        <telerik:GridBoundColumn DataField="UserId" Visible="false"></telerik:GridBoundColumn>
    </Columns>
    </MasterTableView>
    <ClientSettings>
    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
    </ClientSettings>
    </telerik:RadGrid>

    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="30" Height="100%" Width="75px" BackgroundPosition="Center">
    <table style="height:100%;width: 100%;" border="0">
    <tr>
        <td width="100%" align="center" valign="middle">
        <img src="../images/loading.gif" s![enter image description here][1]tyle="border:0;"  />
        </td>
    </tr>
    </table>
    </telerik:RadAjaxLoadingPanel>

    <asp:Label runat="server" ID="lblError" ForeColor="Red" Font-Bold="true"></asp:Label>
    </form>
</body>
</html>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data.SqlServerCe;
using System.Data;

public partial class Settings_ManageUsers : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (Security.EnforceSecurity())
        //    Response.Redirect("Login.aspx");

        AppDomain.CurrentDomain.SetData("SQLServerCompactEditionUnderWebHosting", true);



    }
    protected void grdUsers_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)

    {
        BindData();
    }
    private void BindData()
    {
        try
        {
            string connectString = "Data Source=" + Server.MapPath(".") + "\\Security.sdf";
            using (SqlCeConnection conn = new SqlCeConnection(connectString))
            {
                using (SqlCeCommand cmd = conn.CreateCommand())
                {
                    cmd.CommandText = "select * ";
                    cmd.CommandText += "from Users order by UserName";
                    DataTable dt = new DataTable();
                    SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
                    da.Fill(dt);
                    grdUsers.DataSource = dt;
                }
            }
        }
        catch (Exception ex)
        {
            lblError.Text = ex.Message.ToString();
        }

    }
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Response.Redirect("EditUser.aspx?id=0");
    }
    protected void grdUsers_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == "delete")
        {
            try
            {
                GridDataItem item = (GridDataItem)e.Item;
                string userId = item["UserId"].Text;
                string connectString = "Data Source=" + Server.MapPath(".") + "\\Security.sdf";
                using (SqlCeConnection conn = new SqlCeConnection(connectString))
                {
                    using (SqlCeCommand cmd = conn.CreateCommand())
                    {
                        cmd.CommandText = "delete ";
                        cmd.CommandText += "from Users ";
                        cmd.CommandText += "where UserId = @UserId";
                        cmd.Parameters.Add(new SqlCeParameter("@UserId", SqlDbType.Int)).Value = userId;
                        conn.Open();
                        cmd.ExecuteNonQuery();
                        conn.Close();
                    }
                }
                grdUsers.Rebind();
            }
            catch (Exception ex)
            {
                lblError.Text = ex.Message.ToString();
            }
        }
    }
    protected void grdUsers_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
        {
            string value = e.Item.Cells[2].Text;
            HyperLink eLink = new HyperLink();
            eLink.NavigateUrl = "javascript: void 0";
            eLink.Attributes.Add("onclick", "openWin('" + e.Item.Cells[4].Text + "');");
            eLink.Text = value;
            e.Item.Cells[2].Controls.Clear();
            e.Item.Cells[2].Controls.Add(eLink);

        }
    }
    protected void AjaxManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
    {
        grdUsers.Rebind();
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:07:33+00:00Added an answer on May 25, 2026 at 6:07 am

    That’s what the NoRecordsTemplate is for:

    <telerik:RadGrid ID="RadGrid1" runat="server">
        <MasterTableView ...>
             <Columns>
                 ...
             </Columns>
             <NoRecordsTemplate>
                  <!-- TEMPLATE FOR WHEN THERE ARE NO RECORDS -->
             </NoRecordsTemplate>
        </MasterTableView>
    </telerik:RadGrid>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a telerik radgrid that is doing an insert using an objectdatasource. The
I have an aspx page with a Telerik RadGrid right on the page. Then
I'm using Telerik's RadAjaxManager to update panels independently. On my page, I have 3
Using VS2008, and Telerik radGrid version 2010.1.519.35 I have a about 50 DNN modules
I am using Telerik asp.net mvc extensions. I have an issue that happens only
There are so many columns on my Telerik RadGrid that I want to make
I have a page with a Telerik RadGrid and a Telerik drop-down list. The
In my RAdGrid that I am using there's this edit button to edit a
I have a Telerik RadGdir that loads data dynamically using OnNeedDataSource. Once all the
I have just come across a Casting Exception while using the Telerik RadGrid. It

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.