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

FrozenColumn leaving empty space at right end of the grid.

7 Answers 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Muhammad Irfan
Top achievements
Rank 1
Muhammad Irfan asked on 02 Feb 2010, 02:42 PM
 I am facing one problem in RadGrid. After setting the FrozenColumnCount property, when I (horizontally) scrolled to the right end of the grid, it is leaving empty space (see the attach image). Here is the code which I am using.

<form id="form1" runat="server">
    <div>
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
   
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="true" Width="100%">
        <MasterTableView HeaderStyle-Width="80px"></MasterTableView>
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" FrozenColumnsCount="2"></Scrolling>
            <Selecting AllowRowSelect="true" />   
        </ClientSettings>
    </telerik:RadGrid>
    </div>
    </form>

Code Behind is:

protected void Page_Load(object sender, EventArgs e)
    {
        RadGrid1.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
        RadGrid1.PreRender += new EventHandler(RadGrid1_PreRender);
        RadGrid1.ItemDataBound += new GridItemEventHandler(RadGrid1_ItemDataBound);
    }

    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        //RadGrid1.MasterTableView.AutoGeneratedColumns[7].HeaderStyle.Width = Unit.Pixel(40);
        //RadGrid1.MasterTableView.AutoGeneratedColumns[10].HeaderStyle.Width = Unit.Pixel(40);
    }

    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {

    }

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

    public DataTable GetResultsTable()
    {
        DataTable dt = new DataTable();

        for (int i = 0; i < 70; i++)
        {
            dt.Columns.Add("Column " + i);
            List<object> objectNumbers = new List<object>();

            for (int j = 0; j < 10; j++)
            {
                objectNumbers.Add(i.ToString() + "," + j.ToString());
            }

            while (dt.Rows.Count < objectNumbers.Count)
            {
                dt.Rows.Add();
            }

            for (int k = 0; k < 10; k++)
            {
                dt.Rows[k][i] = objectNumbers[k];
            }
        }
        return dt;
    }



I will really appreciate for quick response. Thanks

Best Regards,
M. Irfan

7 Answers, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 02 Feb 2010, 03:05 PM
This comes from the fact that the width of the MasterTableView is smaller than the width of the overall Grid. Have you tried setting the property TableLayout of the MasterTableView to "fixed"? I think this should take care of it :)
0
Muhammad Irfan
Top achievements
Rank 1
answered on 03 Feb 2010, 07:56 AM
I have also tried after giving the same width to MasterTableView and Layout=Fixed but no change. Kindly help.
0
Schlurk
Top achievements
Rank 2
answered on 03 Feb 2010, 12:57 PM
When you set the TableLayout to fixed did you still define headerstyle-widths? Have you tried setting either the headerstyle-width to a larger amount of pixels or perhaps a percentage to see if that helps? Also you can try setting the width of the MasterTableView as well and then not define any headerstyle-widths to see if this resolves the issue.
0
Muhammad Irfan
Top achievements
Rank 1
answered on 03 Feb 2010, 01:26 PM
Yes I tried in both ways.....set Width and TableLayout with headerstyle-width AND without headerstyle-width. But still problem persist.

I have a sample application so that problem can be reproduced but here I can only attach images. :(

0
Schlurk
Top achievements
Rank 2
answered on 03 Feb 2010, 02:11 PM
The easiest way to resolve this is to remove the UseStaticHeaders property, or set it to false. Are you looking into having the functionality of this property? If so I would recommend that either you define the width of the RadGrid in pixels and define the width of the headerstyle-width of the columns to add up to this width.
0
TonyG
Top achievements
Rank 1
answered on 04 Feb 2010, 01:54 PM
Turning off UseStaticHeaders means we give up valuable functionality in order to hide a bug. That's not a solution.

I've also been struggling with this issue which is cross-browser and doesn't seem to be affected by the settings discussed so far. My bet is that this is a bug. I've been told by Support that there are a couple bugs related to frozen columns which have been fixed and should be available in the next release.  I'm really hoping this one is addressed as well.
0
Dimo
Telerik team
answered on 05 Feb 2010, 07:01 AM
Hello all,

The problem with the empty space appearing after the last column has been fixed. Changes will take effect in Q1 2010 Beta (due in mid February) and Q1 2010 official (due in early March).

You can also download some of the next internal builds.

All the best,
Dimo
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
Tags
Grid
Asked by
Muhammad Irfan
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Muhammad Irfan
Top achievements
Rank 1
TonyG
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or