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

RadGrid StatusBar only shows when CommandItemDisplay="Bottom"

7 Answers 259 Views
Grid
This is a migrated thread and some comments may be shown as answers.
jlehew
Top achievements
Rank 1
jlehew asked on 23 Jan 2009, 07:57 AM

The code below does not display the StatusBar even 
though ShowStatusBar is set to "True".  
But if CommandItemDisplay is changed 
from "Top" to "Bottom", it displays.  
Is there an issue with the markup?  
I'm running version 1314 from January 2009.  
 
To run it, just enter a valid connect string.  
The Data Source does not access a real table 
so all it needs is a database connection.
 
Thanks,
John 

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Test.aspx.cs" Inherits="Test" %>       
       
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>       
<!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 runat="server">        
    <title></title>        
</head>       
<body>       
    <form id="form1" runat="server">        
    <div>       
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">        
        </telerik:RadScriptManager>      
      
        <asp:SqlDataSource ID="DS" runat="server" ConnectionString="Data Source=xxx;Initial Catalog=xxx;User ID=xxx;Password=xxx"       
            ProviderName="System.Data.SqlClient" DataSourceMode="DataReader" SelectCommandType="Text"       
            SelectCommand="SELECT '1' AS SEDID "></asp:SqlDataSource>      
      
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="False" AllowSorting="True"       
            EnableLinqExpressions="False" Skin="Office2007" AutoGenerateColumns="False" ShowStatusBar="True"       
            HeaderStyle-Wrap="false" ItemStyle-Wrap="false" DataSourceID="DS" DataMember="DefaultView"       
            AllowMultiRowEdit="True">        
            <StatusBarSettings ReadyText="Ready" LoadingText="Loading..." />       
            <HeaderContextMenu EnableTheming="true">        
                <CollapseAnimation Type="OutQuint" Duration="50" />       
            </HeaderContextMenu>       
            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true">        
                <Resizing AllowRowResize="True" AllowColumnResize="True" EnableRealTimeResize="True"       
                    ResizeGridOnColumnResize="True" />       
                <Selecting AllowRowSelect="True" />       
                <Scrolling AllowScroll="true" UseStaticHeaders="True" ScrollHeight="300px" />       
            </ClientSettings>       
            <%--<PagerStyle Mode="NextPrevNumericAndAdvanced" />--%>       
            <MasterTableView DataSourceID="DS" AllowAutomaticDeletes="false" RowIndicatorColumn-Visible="false"       
                CommandItemDisplay="Top" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"       
                DataMember="DefaultView" DataKeyNames="SedID" EditMode="PopUp">        
                <Columns>       
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" runat="server">        
                        <HeaderStyle Width="16px" />       
                        <ItemStyle Width="16px" />       
                    </telerik:GridEditCommandColumn>       
                    <telerik:GridBoundColumn DataField="SedID" HeaderText="SED" runat="server" UniqueName="colSedID">        
                        <HeaderStyle Width="800px" />       
                        <ItemStyle Width="800px" />       
                    </telerik:GridBoundColumn>       
                </Columns>       
            </MasterTableView>       
            <FilterMenu>       
                <CollapseAnimation Type="OutQuint" Duration="50" />       
            </FilterMenu>       
        </telerik:RadGrid>       
    </div>       
    </form>       
</body>       
</html>       
 

7 Answers, 1 is accepted

Sort by
0
jlehew
Top achievements
Rank 1
answered on 24 Jan 2009, 07:57 PM
Before I start let me say thanks for including the source code when purchasing these controls!!  Because of this I was able to find the problem in the latest v1314 RadGrid source code.

I found the problem in the file GridTable.cs under the Render(HtmlTextWriter writer) method.  Adding this line to the IF statement below fixed the problem:

 this._ownerTableView.CommandItemDisplay == GridCommandItemDisplay.Top ||  

 
                        if ((this._ownerTableView.AllowPaging && this._ownerTableView.PagerStyle.IsPagerOnBottom) ||  
                            (this._ownerTableView.CommandItemDisplay == GridCommandItemDisplay.Top ||  
                             this._ownerTableView.CommandItemDisplay == GridCommandItemDisplay.Bottom ||   
                             this._ownerTableView.CommandItemDisplay == GridCommandItemDisplay.TopAndBottom)  
                            )  
                        {  
                            if (this._ownerTableView.PagerStyle.Visible)  
                            {  
                                if (this._ownerTableView.OwnerGrid.PagerStyle.Visible)  
                                {  
                                    this.IDSuffix = "_Pager";  
                                    this.Width = Unit.Percentage(100);  
                                    this.RenderMode = 4;  
                                    base.Render(writer);  
                                }  
                            }  
                        }  
 
                    }  
                }  
                else  
                {  
                    writer.WriteLine("  </div>");  
                }  
            }  
        }  
 
        private string GetHeaderDivWidth()  
        {  
            string width = ""

Please review the change above.  I realize there may be a better way to fix this issue once your experts review, but I confirmed that this small change did the trick.  (i.e. use "None" instead of ORing the other three options... this._ownerTableView.CommandItemDisplay != GridCommandItemDisplay.None  )

If you'd like me to zip everything up and send let me know.

Regards,
John Lehew
0
Rosen
Telerik team
answered on 26 Jan 2009, 01:53 PM
Hi,

Indeed I was able to observed the described behavior. However I'm happy to inform you that our developers as managed to address it, thus the fix will available with the next version of the control, or you may check the next nightly build from your user account.

We highly appreciate that you have devote a time to research this issue and for suggesting a possible solution. However in case  your are curious the condition which should be added to the if statement is a check if StatusBar should be shown.

I have update you telerik point as a token of gratitude.

Kind regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
jlehew
Top achievements
Rank 1
answered on 26 Jan 2009, 08:21 PM
That's great news!!

One more thing...

I had a situation as recent as this morning where CommandItemDisplay was set to None and this situation reoccurred.  The system I'm creating automatically adds rows based on other factors so I do not want the users to add rows from the Command Bar.  I could create a Command bar with just refresh on it but didn't like how empty the CommandBar looked in that situation.  

What if the logic was changed so the status bar always displays if it is set to true regardless of where the CommandItemDisplay is set?

Thanks,
John
0
Accepted
Rosen
Telerik team
answered on 27 Jan 2009, 03:59 PM
Hello,

As I stated in my previous post, CommandItemDisplay value is not sufficient in this concrete case.  Thus the condition should look similar to the following:

if (  
   (_ownerTableView.AllowPaging && _ownerTableView.PagerStyle.IsPagerOnBottom) ||  
    (  
      _ownerTableView.CommandItemDisplay == GridCommandItemDisplay.Bottom ||  
      _ownerTableView.CommandItemDisplay == GridCommandItemDisplay.TopAndBottom  
     ) ||  
     _ownerTableView.OwnerGrid.ShowStatusBar  
    )  
{  
    if (this._ownerTableView.PagerStyle.Visible)  
    {  
         //the rest of the code 

Let me know if this helps.

Regards,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
jlehew
Top achievements
Rank 1
answered on 27 Jan 2009, 05:13 PM
Perfect! 

Thanks,
John
0
Ranjan Ojha
Top achievements
Rank 1
answered on 12 Jun 2010, 01:41 PM
I understood the issue and fix, But I am confused how to added these lines of code in GridTable.cs class. I have created a partial class and tried to add these lines of code. It seems, I am trying to add these lines of code at wrong place.

Kindly help me to get rid of status bar issue.
0
Rosen
Telerik team
answered on 14 Jun 2010, 12:30 PM
Hello Ranjan,

I'm afraid that as of AJAX Q1 2009 RadGrid's GridStatusBarItem has been marked as obsolete and is not longer used by RadGrid. More information can be found here RadGrid's Changes and backward compatibility.

Greetings,
Rosen
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
jlehew
Top achievements
Rank 1
Answers by
jlehew
Top achievements
Rank 1
Rosen
Telerik team
Ranjan Ojha
Top achievements
Rank 1
Share this question
or