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

Rad Grid Scroll and Filtering

1 Answer 109 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marion
Top achievements
Rank 1
Marion asked on 05 Nov 2014, 03:43 PM
Hi everyone,

Let me explain my problem :

I have a rad grid with a lot of column so I have an horizontal scroll bar.
I Scroll to the last column of my grid, and I apply a filter. 
When the result of my filter show something there is no problem.
But if there is not data to show, my grid disappear and I have a blank page...

It always works (with data or no data for result) in the first columns of my grid, but not when I scroll to the right of my grid.

Many thanks for your help

 

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 10 Nov 2014, 08:23 AM
Hi Marion,

The behavior that you are describing could be observed if you have set the MasterTableView ShowHeadersWhenNoRecords property to false.

Following is a simple RadGrid with enabled scrolling, which works correctly even if no records are returned after filtering:
<telerik:RadGrid runat="server" ID="RadGrid1" OnNeedDataSource="RadGrid1_NeedDataSource" Width="400px"
    AllowFilteringByColumn="true">
    <MasterTableView ShowHeadersWhenNoRecords="true"></MasterTableView>
    <ClientSettings>
        <Scrolling AllowScroll="true" />
    </ClientSettings>
</telerik:RadGrid>

And the code-behind:
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    DataTable table = new DataTable();
    int columnsCount = 20;
    int rowsCount = 30;
    for (int i = 0; i < columnsCount; i++)
    {
        table.Columns.Add("Column" + i, typeof(string));
    }
 
    for (int i = 0; i < rowsCount; i++)
    {
        table.Rows.Add();
        for (int z = 0; z < columnsCount; z++)
        {
            table.Rows[i][z] = "SomeValue" + i;
        }
    }
 
    (sender as RadGrid).DataSource = table;
}

If you continue to experience problems on your end, please provide elaborate which version of the controls you are using and what differs in your RadGrid settings from the above example.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Marion
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or