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

Column display=false bug?

3 Answers 76 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Datamex
Top achievements
Rank 2
Datamex asked on 09 Sep 2009, 02:50 PM
I think I found a bug in the RadGrid. I got the following:

<telerik:RadGrid ID="AppointmentsGrid" runat="server" DataSourceID="AppointmentsObjectDataSource"  
    AllowPaging="True" AutoGenerateColumns="False" Caption="Afspraken"
    <MasterTableView DataKeyNames="AppointmentID" PageSize="30"
      <Columns> 
        <telerik:GridBoundColumn DataField="AppointmentID" DataType="System.Int32" HeaderText="Afspraak ID" 
          SortExpression="AppointmentID" UniqueName="AppointmentID" Display="false"
          <ItemStyle Width="50px" /> 
          <HeaderStyle Width="50px" /> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="StartedOn" DataType="System.DateTime" HeaderText="Start Tijd" 
          SortExpression="StartedOn" UniqueName="StartedOn"
          <ItemStyle Width="120px" /> 
          <HeaderStyle Width="120px" /> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="EndedOn" DataType="System.DateTime" HeaderText="Eind Tijd" 
          SortExpression="EndedOn" UniqueName="EndedOn"
          <ItemStyle Width="120px" /> 
          <HeaderStyle Width="120px" /> 
        </telerik:GridBoundColumn>

etcetera...

As you can see, I want the first column to be 50px wide (but it should not be shown!), the second should be 120px wide and the third column should also be 120px wide. However, when I use these settings my page shows the grid, it does not show the first column and starts showing the second column first, but... The first column is only 50px wide, while it should be 120px!

http://bart.nimio.info/images/fora/grid.JPG

3 Answers, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 11 Sep 2009, 11:11 AM
Hello,

I tried to reproduce the issue but without success. You can find attached a sample website based on your scenario that runs as expected on my side. Please run it and let me know if you still get the issue.

I hope this helps.

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
Datamex
Top achievements
Rank 2
answered on 14 Sep 2009, 07:32 AM
In the example you've given me, the problem does not show... Could it have something to do with the ObjectDataSource I'm using? Here is my full sourcecode of the grid:

<telerik:RadGrid ID="AppointmentsGrid" runat="server" DataSourceID="AppointmentsObjectDataSource"   
    AllowPaging="True" AutoGenerateColumns="False" Caption="Afspraken">  
    <MasterTableView DataKeyNames="AppointmentID" PageSize="30">  
      <Columns> 
        <telerik:GridBoundColumn DataField="AppointmentID" DataType="System.Int32" HeaderText="Afspraak ID" 
          SortExpression="AppointmentID" UniqueName="AppointmentID" Display="false">  
          <ItemStyle Width="50px" /> 
          <HeaderStyle Width="50px" /> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="StartedOn" DataType="System.DateTime" HeaderText="Start Tijd" 
          SortExpression="StartedOn" UniqueName="StartedOn">  
          <ItemStyle Width="120px" /> 
          <HeaderStyle Width="120px" /> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="EndedOn" DataType="System.DateTime" HeaderText="Eind Tijd" 
          SortExpression="EndedOn" UniqueName="EndedOn">  
          <ItemStyle Width="120px" /> 
          <HeaderStyle Width="120px" /> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Subject" HeaderText="Onderwerp" SortExpression="Subject" 
          UniqueName="Subject">  
          <ItemStyle Width="430px" /> 
          <HeaderStyle Width="430px" /> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Duration" DataType="System.TimeSpan" HeaderText="Duur" 
          ReadOnly="True" SortExpression="Duration" UniqueName="Duration">  
          <ItemStyle HorizontalAlign="Center" Width="50px" /> 
          <HeaderStyle Width="50px" /> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="EmployeeName" DataType="System.String" HeaderText="Medewerker" 
          ReadOnly="True" SortExpression="EmployeeName" UniqueName="EmployeeName">  
          <ItemStyle HorizontalAlign="Center" Width="125px" /> 
          <HeaderStyle Width="125px" /> 
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="CustomerName" DataType="System.String" HeaderText="Klant" 
          ReadOnly="True" SortExpression="CustomerName" UniqueName="CustomerName">  
          <ItemStyle HorizontalAlign="Center" Width="430px" /> 
          <HeaderStyle Width="430px" /> 
        </telerik:GridBoundColumn> 
      </Columns> 
    </MasterTableView> 
  </telerik:RadGrid> 
  <asp:ObjectDataSource ID="AppointmentsObjectDataSource" runat="server" SelectMethod="getScheduledAppointments" 
    TypeName="Datamex.Projects.Saturnus.BusinessLogics.ScheduledAppointments"   
    OnSelecting="AppointmentsObjectDataSource_Selecting">  
    <SelectParameters> 
      <asp:Parameter Name="beginTime" Type="DateTime" /> 
      <asp:Parameter Name="endTime" Type="DateTime" /> 
    </SelectParameters> 
  </asp:ObjectDataSource> 

This is the result: http://bart.nimio.info/images/fora/radgrid.JPG, as you can see the first column is only 50px wide, instead of the 120px I told it to be!
0
Martin
Telerik team
answered on 14 Sep 2009, 04:01 PM
Hello Datamex,

I am not quite sure that the problem comes from the ObjectDataSource itself. However I would recommend you to recheck your project for setting the column width somewhere else in the code. In case you can not find the reason you can send us a simplified runnable project demonstrating the issue. Then we will be able to give you a more detailed answer.

I hope this helps.

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.
Tags
Grid
Asked by
Datamex
Top achievements
Rank 2
Answers by
Martin
Telerik team
Datamex
Top achievements
Rank 2
Share this question
or