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

Getting crazy with a column refusing to display

23 Answers 230 Views
Grid
This is a migrated thread and some comments may be shown as answers.
CSurieux
Top achievements
Rank 2
CSurieux asked on 22 Sep 2009, 10:20 AM
Hello,

I have a radgrid inside a RadTabStrip/Multipage/Pageview, this grid uses OnNeedDataSource to bing to a small table with 3 columns: a Guid, a string, another Guid.
I display normally 2 columns+ an edit column, the first Guid column is marked as display=false, the 3rd uses a lookup table to set its value.
My problem is that any column I set after the non displayed column is also hidden.

I have dozen other radgrid in my site working quite ok, but I can't solve the problem with this one:
Here is my code
<div style='float:left;width:100%;'>  
                            <telerik:RadGrid ID="RadGrid1" GridLines="None" AutoGenerateColumns="False" AllowPaging="True" PageSize="50" runat="server">  
                                <PagerStyle Mode="NextPrevAndNumeric" /> 
                                <ClientSettings AllowColumnsReorder="false"  Resizing-AllowColumnResize="false"/>  
                                <MasterTableView CommandItemDisplay='None'  TableLayout="Fixed" DataKeyNames="SourceUserId" > 
                                    <Columns> 
                                        <telerik:GridBoundColumn DataField="SourceUserId" UniqueName="SourceUserId" DataType='System.Guid' Display="false" ReadOnly="true" HeaderStyle-Width='5px' /> 
                                        <telerik:GridBoundColumn DataField="LastName" HeaderText="Name" UniqueName="LastName" ReadOnly="true" HeaderStyle-Width='80px'/>  
                                        <telerik:GridBoundColumn DataField="SourceDomainName" HeaderText="Source Domain" UniqueName="SourceDomainName" ReadOnly="true" HeaderStyle-Width='200px'/>  
                                        <telerik:GridDropDownColumn DataField="TargetDomainName" HeaderText="Target Domain" ListTextField="TargetDomainName" ListValueField="DestId"   
                                            DropDownControlType="RadComboBox" UniqueName="TargetDomainName"  EditFormColumnIndex='0' HeaderStyle-Width='200px' /> 
                                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"   > 
                                            <HeaderStyle Width="50px" /> 
                                        </telerik:GridEditCommandColumn> 
                                    </Columns> 
                                    <EditFormSettings ColumnNumber='1'>  
                                        <FormTableItemStyle Wrap="False" /> 
                                        <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%" /> 
                                        <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" Height="110px" Width="100%" /> 
                                        <FormTableAlternatingItemStyle Wrap="False" /> 
                                        <FormStyle Width="100%" /> 
                                        <EditColumn  ButtonType="ImageButton"  > 
                                        </EditColumn> 
                                        <FormTableButtonRowStyle HorizontalAlign="Left" /> 
                                    </EditFormSettings> 
                                </MasterTableView> 
                            </telerik:RadGrid> 
                            </div> 

The LastName column is not displayed, I added it to have the SourceDomainName column displayed.

I have used a small test project and I ma unable to reproduce the problem....

When I look in IE8 to the generated code, everything seems to be ok, especially the init for columns, and don't understand what is the side effect driving to have the column not displayed when it should be.

Here is the source code from IE8
Sys.Application.add_init(function() {  
$create(Telerik.Web.UI.RadGrid,  
    { "ClientID": "WebHeaderButton_TPans_M_Migra_651_RadGrid1",   
    "ClientSettings": { "AllowAutoScrollOnDragDrop": true, "ShouldCreateRows": true, "DataBinding": {}, "Selecting": {}, "Scrolling": {}, "Resizing": {}, "ClientMessages": {}, "KeyboardNavigationSettings": { "AllowActiveRowCycle": false, "EnableKeyboardShortcuts": true, "FocusKey": 89, "InitInsertKey": 73, "RebindKey": 82, "ExitEditInsertModeKey": 27, "UpdateInsertItemKey": 13, "DeleteActiveRow": 127} }, "Skin": "Web20", "UniqueID": "WebHeaderButton$TPans$M_Migra_651$RadGrid1", "_activeRowIndex": "", "_controlToFocus": "", "_currentPageIndex": 0, "_editIndexes": "[]", "_embeddedSkin": true, "_gridTableViewsData": "[{\"ClientID\":null,\"UniqueID\":null,\"PageSize\":50,\"PageCount\":1,\"EditMode\":\"EditForms\",\"CurrentPageIndex\":0,\"VirtualItemCount\":0,\"AllowMultiColumnSorting\":false,\"IsItemInserted\":false,\"clientDataKeyNames\":[],\"_dataBindTemplates\":false,\"_selectedItemStyle\":\"\",\"_selectedItemStyleClass\":\"rgSelectedRow\",\"_columnsData\":[{\"UniqueName\":\"SourceUserId\",\"Resizable\":true,\"Reorderable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"Display\":false},{\"UniqueName\":\"LastName\",\"Resizable\":true,\"Reorderable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"Display\":true},{\"UniqueName\":\"SourceDomainName\",\"Resizable\":true,\"Reorderable\":true,\"Groupable\":true,\"ColumnType\":\"GridBoundColumn\",\"Display\":true},{\"UniqueName\":\"TargetDomainName\",\"Resizable\":true,\"Reorderable\":true,\"Groupable\":true,\"ColumnType\":\"GridDropDownColumn\",\"Display\":true},{\"UniqueName\":\"EditCommandColumn\",\"Resizable\":true,\"Reorderable\":true,\"Groupable\":false,\"ColumnType\":\"GridEditCommandColumn\",\"Display\":true}]}]", "_masterClientID": null, "allowMultiRowSelection": false, "clientStateFieldID": "WebHeaderButton_TPans_M_Migra_651_RadGrid1_ClientState" }, null, null, $get("WebHeaderButton_TPans_M_Migra_651_RadGrid1"));  
});  
 

My turn around is Ok, but it is certainly hiding something ...suspect.

Any idea welcome, especially if successful.

CS

23 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 24 Sep 2009, 02:30 PM
Hello Christian,

I tried your code on IE8 with CompatibilityView switched on and off and although the behavior was slightly different all the columns except the first were visible. Firefox 3.5.3 performed as IE8 with compatibility view switched off. In editmode only the RadComboBox of the GridDropDownColumn was displayed since all other columns have their ReadOnly="true".
I would suggest you to send us a small project that mimics your application (having the RadTabStrip/Multipage/Pageview controls included) that we could debug locally and find where the columns get lost. (Actually I don't see OnNeedDataSource event declaration in your markup but maybe you have skip this detail for simplicity).

Looking forward to your reply
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 24 Sep 2009, 04:02 PM
Hi Martin,

Thanks for your time and support.
My project is difficult to resume in a small test workbench, I have tried but, as you did, I have still not reproduced the problem.
I do a large part of work in code behind and need datasource is there.

I suspect a more general problem because I already have an unsolved problem with display= false columns avoiding the other columns resizing normally clientside, I changed to visible=false and apply it earlier in the page pipeline to solve drastically...

I am suspecting a general parameter(?) (somewhere ? ) having side effect, and when I will get more time I will go back on these pbs.
May be openning a ticket, but I am short in time now.

I was just giving a glanced here in case my error or pb was evident.

Anyway Thanks

CS
0
Martin
Telerik team
answered on 26 Sep 2009, 01:30 PM
Hello Christian,

I understand that you are working over a large and sophisticated project. Maybe you can try to build a small simplified project just to verify that the issue is not caused by the controls but from the logic or some other settings you use. However if you manage to replicate the issue in a simplified scenario then feel free to contact us again and send us the erroneous code.It will be our pleasure to guide you to the needed solution.

Good luck on your project.

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 26 Sep 2009, 07:44 PM
Martin,

I appreciate, thanks.
What I just noticed to day is that under FireFox I don't get the problem ???
Any idea ?

More later.
CS
0
Martin
Telerik team
answered on 28 Sep 2009, 03:15 PM
Hi Christian,

 As I noticed in my first post - "I tried your code on IE8 with CompatibilityView switched on and off and although the behavior was slightly different all the columns except the first were visible. Firefox 3.5.3 performed as IE8 with compatibility view switched off. In editmode only the RadComboBox of the GridDropDownColumn was displayed since all other columns have their ReadOnly="true""

I really want to help you with this issue but since I am not able to reproduce it I am afraid I can not give you any other helpful information.

Regards,
Martin
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Yuvika
Top achievements
Rank 1
answered on 22 Dec 2009, 06:05 AM
Hi,

I am having the same problem in IE8. The columns I set display="false" after that no columns are visible. It works fine in firefox and IE7. What is the workaround for it.
Please reply.

Thanks
Yuvika
0
Dimo
Telerik team
answered on 22 Dec 2009, 06:52 AM
Hi Yuvika,

This problem should not occur with the latest RadControls version, please test your scenario with it and let us know if the problem persists.

All the best,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Yuvika
Top achievements
Rank 1
answered on 22 Dec 2009, 10:30 AM
Hi,

I am using the latest version.
The problem has not been solved in latest version also. I have Q3 2009 version.
Please reply as this issue is bugging my client.

Thanks,
Yuvika
0
Dimo
Telerik team
answered on 22 Dec 2009, 10:44 AM
Hi Yuvika,

Here is a page that works correctly with the latest version. Please modify it so that the problem is exhibited and send it back.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
<script runat="server">
 
protected void RadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    DataTable dt = new DataTable();
    DataRow dr;
    int colsNum = 6;
    int rowsNum = 5;
    string colName = "Column";
 
    for (int j = 1; j <= colsNum; j++)
    {
        dt.Columns.Add(String.Format("{0}{1}", colName, j));
    }
 
    for (int i = 1; i <= rowsNum; i++)
    {
        dr = dt.NewRow();
 
        for (int k = 1; k <= colsNum; k++)
        {
            dr[String.Format("{0}{1}", colName, k)] = String.Format("{0}{1} Row{2}", colName, k, i);
        }
        dt.Rows.Add(dr);
    }
 
    (sender as RadGrid).DataSource = dt;
}
 
</script>
 
<head runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>RadControls for ASP.NET AJAX</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
 
Columns 2 and 3 are hidden with Display="false"
 
<telerik:RadGrid
    ID="RadGrid1"
    runat="server"
    AutoGenerateColumns="false"
    Skin="Office2007"
    OnNeedDataSource="RadGrid_NeedDataSource">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn DataField="Column1" HeaderText="Col 1" />
            <telerik:GridBoundColumn DataField="Column2" HeaderText="Col 2" Display="false" />
            <telerik:GridBoundColumn DataField="Column3" HeaderText="Col 3" Display="false" />
            <telerik:GridBoundColumn DataField="Column4" HeaderText="Col 4" />
            <telerik:GridBoundColumn DataField="Column5" HeaderText="Col 5" />
            <telerik:GridBoundColumn DataField="Column6" HeaderText="Col 6" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
 
</form>
</body>
</html>


Greetings,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Yuvika
Top achievements
Rank 1
answered on 22 Dec 2009, 11:57 AM
Hi Dimo,

I just copied and pasted the code given, I realised that still there is some problem in IE8. I just noticed that the columns before the display="false" is not visible. For eg: In the example given above, the column4 is not visible in IE8. Please see the attached images, the image ie8 does not show column4 where as it is visible in ie8.
The version is latest too. What could be the problem.?

Please look into it, and let me know if there is any solution as this issue is viisble at first glance.

Thanks,
Yuvika
0
Dimo
Telerik team
answered on 22 Dec 2009, 12:29 PM
Hi Yuvika,

Now I see - you are using a IE8 with an IE7 document mode. In this case, please use the following Javascript workaround, which will be included in next versions as well. I have updated your Telerik points for bringing the issue to our attention.

Note that the Javascript code must be parsed by the browser after the embedded RadGrid scripts, which generally means that you should include it in the <body> (no matter whether the script is pasted directly in the page HTML or is registered with an external JS file).

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  
<script runat="server">
  
protected void RadGrid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    DataTable dt = new DataTable();
    DataRow dr;
    int colsNum = 6;
    int rowsNum = 5;
    string colName = "Column";
  
    for (int j = 1; j <= colsNum; j++)
    {
        dt.Columns.Add(String.Format("{0}{1}", colName, j));
    }
  
    for (int i = 1; i <= rowsNum; i++)
    {
        dr = dt.NewRow();
  
        for (int k = 1; k <= colsNum; k++)
        {
            dr[String.Format("{0}{1}", colName, k)] = String.Format("{0}{1} Row{2}", colName, k, i);
        }
        dt.Rows.Add(dr);
    }
  
    (sender as RadGrid).DataSource = dt;
}
  
</script>
  
<head id="Head1" runat="server">
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>RadControls for ASP.NET AJAX</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
  
Columns 2 and 3 are hidden with Display="false"
  
<telerik:RadGrid
    ID="RadGrid1"
    runat="server"
    AutoGenerateColumns="false"
    Skin="Office2007"
    OnNeedDataSource="RadGrid_NeedDataSource">
    <MasterTableView>
        <Columns>
            <telerik:GridBoundColumn DataField="Column1" HeaderText="Col 1" />
            <telerik:GridBoundColumn DataField="Column2" HeaderText="Col 2" Display="false" />
            <telerik:GridBoundColumn DataField="Column3" HeaderText="Col 3" Display="false" />
            <telerik:GridBoundColumn DataField="Column4" HeaderText="Col 4" />
            <telerik:GridBoundColumn DataField="Column5" HeaderText="Col 5" />
            <telerik:GridBoundColumn DataField="Column6" HeaderText="Col 6" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
 
<script type="text/javascript">
 
if (typeof(Telerik) != "undefined" && typeof(Telerik.Web.UI) != "undefined")
{
    Telerik.Web.UI.Grid.RemoveHiddenColGroupCols = function(colGroup)
    {
        try
        {
            var cols = colGroup.getElementsByTagName("col");
            for (var j = 0; j < cols.length; j++)
            {
                if (cols[j].style.display && cols[j].style.display == "none")
                {
                    cols[j].parentNode.removeChild(cols[j]);
                    j--;
                }
            }
        }
        catch (e)
        {}
    };
}
 
</script>
  
</form>
</body>
</html>



Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 22 Dec 2009, 01:06 PM
Hello,

Thank you, Yuvika for solving this problem.
I add rewritten on my side, being unable to find in a short delay this very annoying problem.

I expect a new RadControl version, latest build or final ASAP, I don't want to generalize this javascript uggly patch everywhere.

But what is this story of bad document mode, where does it come from ???
Should we include something special for IE8 now in our applications ?

I would appreciate a more general answer from Telerik, because other Rad components or own components could be affected by this.


Regards
CS
0
Yuvika
Top achievements
Rank 1
answered on 22 Dec 2009, 01:16 PM
Hi,

Thanks a ton Dimo. It works.

Regards,
Yuvika
0
Dimo
Telerik team
answered on 23 Dec 2009, 09:55 AM
Hello Christian,

IE8 has a Browser Mode and a Document Mode. The Browser Mode determines how the browser "introduces" itself on the server and client, while the Document Mode determines how the browser renders the page HTML. Both properties can be manipulated manually by the user, by the browser settings, or by meta tags in the page. In general, some combinations of the two properties can produce unexpected side effects in controls, which rely on the browser version for their HTML rendering or scripting. We do our best to fix such issues as soon as we encounter them.


Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 23 Dec 2009, 10:01 AM
Hello Dimo,


I missed this point when IE 8 appeared.
Could you clarify providing the tags and the way we could understand settings set by the user, clientside and server side ?
If this is 'new IE8 material' there is certainly a compatibility mode ?


Thanks you for your Help.

CS
0
Dimo
Telerik team
answered on 28 Dec 2009, 12:02 PM
Hi Christian,

You can read the following articles:

http://blogs.msdn.com/ie/archive/2008/01/21/compatibility-and-ie8.aspx

(Eventually Microsoft decided to make the IE8 standards mode default, so this infomation above is not true.)

http://blogs.msdn.com/ie/archive/2009/03/12/site-compatibility-and-ie8.aspx

http://blogs.msdn.com/ie/archive/2008/06/10/introducing-ie-emulateie7.aspx

http://blogs.msdn.com/mikeormond/archive/2008/09/25/ie-8-compatibility-meta-tags-http-headers-user-agent-strings-etc-etc.aspx

Best wishes,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 28 Dec 2009, 12:53 PM
Thank you Dimo,
Very interesting.

Happy new 2010 year
...with IE9 and others

CS
0
CSurieux
Top achievements
Rank 2
answered on 28 Dec 2009, 01:47 PM
Hello Dimo,

Last question after full reading.
Could we assume that if we use Telerik's RadControls in our page, independently of other controls, we could stay in IE8 std mode ?
So we could safely add the 
<meta http-equiv="X-UA-Compatible" content="IE=8" />
 tag in our headers ?
Thank you for official confirmation.

Regards
CS
0
Dimo
Telerik team
answered on 28 Dec 2009, 04:16 PM
Hi,

Yes, the IE8 meta tag will override the browser settings, if such exist.

Regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
CSurieux
Top achievements
Rank 2
answered on 28 Dec 2009, 05:19 PM
This implies that RadControls are all Ok with IE8 mode, Ok ?

CS
0
Dimo
Telerik team
answered on 29 Dec 2009, 07:26 AM
Hi Christian,

Of course.

http://www.telerik.com/products/aspnet-ajax/resources/browser-support.aspx


Regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Alex
Top achievements
Rank 1
answered on 21 Jan 2014, 06:27 PM
Hello,

The thread is an old one but currently having an issue similar to it.

Please see screenshots.

Any ideas?
0
Venelin
Telerik team
answered on 24 Jan 2014, 02:59 PM
Hello Alex,

I would suggest you to open a support ticked and provide more relevant information, like code (at least the grid declaration) and also tell us which is your version of the dlls. This will help us alot. Also, can you confirm that you have tried all the suggestions from this thread and none of them helped?

Regards,
Venelin
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
CSurieux
Top achievements
Rank 2
Answers by
Martin
Telerik team
CSurieux
Top achievements
Rank 2
Yuvika
Top achievements
Rank 1
Dimo
Telerik team
Alex
Top achievements
Rank 1
Venelin
Telerik team
Share this question
or