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

Radgird Scrolling not working when i keep Radgrid inside Fieldset.

5 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
shahid Aleem
Top achievements
Rank 1
shahid Aleem asked on 09 Feb 2011, 02:24 PM
Hello I am trying to keep radgrid inside fieldset but when i keep radgrid inside fieldset, i am getting the grid's scroll bar but the horizontal width i am getting is what exactly with out scrollbars. i want the grid to be fit on the Browser with scroll bars. But it is long grid.

please reply.
Thanks.

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 10 Feb 2011, 02:07 PM
Hello Shahid,

I am not completely sure that I understand what is the exact problem. It will be best if you open a formal support ticket, and provide more details on the issue, a sample code, or screenshots of the problem. I will review them and get back to you with more details.

Best wishes,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Bilal Ali
Top achievements
Rank 1
answered on 07 Nov 2019, 06:46 AM

I know its an old post, but still if you put Rad Grid inside <fieldset> tag using Batch Edit mode, scroll doesn't show.

<fieldset>
        <legend i>RadGrid</legend>
 
  <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GridLines="None"
                AllowSorting="True" AllowPaging="True" PageSize="50" Width="800px" OnColumnCreated="RadGrid1_ColumnCreated">
                <ClientSettings>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" ></Scrolling>
                </ClientSettings>
                <HeaderStyle Width="225px"></HeaderStyle>
                 
            </telerik:RadGrid>
        </fieldset>

 

0
Attila Antal
Telerik team
answered on 11 Nov 2019, 07:03 PM

Hi Bilal Ali,

Could you elaborate on the issue? What is happening exactly when trying to scroll? Perhaps there is a JavaScript error on the page that breaks the scrolling functionality.

I would advise turning AJAX off temporarily if enabled: Get more descriptive errors by disabling AJAX.

Once done, open the developer tools of the browser and monitor the console tab for JavaScript errors. Check out the Pro Tips section in the Debug JavaScript blog post. All JavaScript errors must be before trying the application.

I have tested the RadGrid with Scrolling inside a fieldset and it works as expected. See the following short video demo: http://somup.com/cqXXFRfIa8

Here are the code snippets for the sample I have tested:

Grid Markup:

<fieldset>
    <legend>RadGrid</legend>
    <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" GridLines="None"
        AllowSorting="True" AllowPaging="True" PageSize="50" Width="800px" OnColumnCreated="RadGrid1_ColumnCreated" OnNeedDataSource="RadGrid1_NeedDataSource">
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true"></Scrolling>
        </ClientSettings>
        <HeaderStyle Width="225px"></HeaderStyle>
    </telerik:RadGrid>
</fieldset>

 

C# - Code behind for binding data

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    RadGrid1.DataSource = OrdersTable(); 
}

private DataTable OrdersTable()
{
    DataTable dt = new DataTable();

    dt.Columns.Add(new DataColumn("OrderID", typeof(int)));
    dt.Columns.Add(new DataColumn("OrderDate", typeof(DateTime)));
    dt.Columns.Add(new DataColumn("Freight", typeof(decimal)));
    dt.Columns.Add(new DataColumn("ShipName", typeof(string)));
    dt.Columns.Add(new DataColumn("ShipCountry", typeof(string)));

    dt.PrimaryKey = new DataColumn[] { dt.Columns["OrderID"] };

    for (int i = 0; i < 70; i++)
    {
        int index = i + 1;

        DataRow row = dt.NewRow();

        row["OrderID"] = index;
        row["OrderDate"] = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0).AddHours(index);
        row["Freight"] = index * 0.1 + index * 0.01;
        row["ShipName"] = "Name " + index;
        row["ShipCountry"] = "Country " + index;

        dt.Rows.Add(row);
    }

    return dt;
}


protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
{

}

I hope this will prove helpful.

Kind regards,
Attila Antal
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Bilal Ali
Top achievements
Rank 1
answered on 12 Nov 2019, 05:33 AM

Dear Attila Antal,

Thanks for the quick response,  RadGrid scroll working as expected in other modes placed in fieldset tag. But i am using Batch Edit Mode with related RadComboBox using this :

Batch Editing Extensions - Related RadComboBoxes and Batch Validation

when I put my RadGrid with Batch Edit inside fieldset, scroll bars don't show in RadGrid.

0
Attila Antal
Telerik team
answered on 14 Nov 2019, 08:18 PM

Hi Bilal Ali,

I have made a quick test using Batch Edit mode, and this is also working well. See the following short video I have created while testing the app: http://somup.com/cqX2YIfDXd

Here is the complete page code I have used.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="RadGrid_Scrolling_Inside_Fieldset.aspx.cs" Inherits="RadGrid_Scrolling_Inside_Fieldset" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <fieldset>
            <legend>RadGrid</legend>
            <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" GridLines="None"
                AllowSorting="True" AllowPaging="True" PageSize="50" Width="800px"
                OnNeedDataSource="RadGrid1_NeedDataSource">
                <ClientSettings>
                    <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true"></Scrolling>
                </ClientSettings>
                <HeaderStyle Width="225px"></HeaderStyle>
                <MasterTableView EditMode="Batch" CommandItemDisplay="Top">
                </MasterTableView>
            </telerik:RadGrid>
        </fieldset>
    </form>
</body>
</html>

 

C# - Code behind

using System;
using System.Data;
using Telerik.Web.UI;

public partial class RadGrid_Scrolling_Inside_Fieldset : System.Web.UI.Page
{
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = OrdersTable();
    }
    private DataTable OrdersTable()
    {
        DataTable dt = new DataTable();

        dt.Columns.Add(new DataColumn("OrderID", typeof(int)));
        dt.Columns.Add(new DataColumn("OrderDate", typeof(DateTime)));
        dt.Columns.Add(new DataColumn("Freight", typeof(decimal)));
        dt.Columns.Add(new DataColumn("ShipName", typeof(string)));
        dt.Columns.Add(new DataColumn("ShipCountry", typeof(string)));

        dt.PrimaryKey = new DataColumn[] { dt.Columns["OrderID"] };

        for (int i = 0; i < 70; i++)
        {
            int index = i + 1;

            DataRow row = dt.NewRow();

            row["OrderID"] = index;
            row["OrderDate"] = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, 0, 0, 0).AddHours(index);
            row["Freight"] = index * 0.1 + index * 0.01;
            row["ShipName"] = "Name " + index;
            row["ShipCountry"] = "Country " + index;

            dt.Rows.Add(row);
        }

        return dt;
    }
}

 

I would like to help you out in this, but I will need more information that can help me replicate the problem or at least the current code you are using so that I can double check the settings. Unfortunately, without knowing what causes the issue, I am unable to tell you the solution.

Kind regards,
Attila Antal
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
shahid Aleem
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Bilal Ali
Top achievements
Rank 1
Attila Antal
Telerik team
Share this question
or