Column display=false bug?

4 posts, 0 answers
  1. Datamex
    Datamex avatar
    161 posts
    Member since:
    Jun 2012

    Posted 09 Sep 2009 Link to this post

    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
  2. Martin
    Admin
    Martin avatar
    811 posts

    Posted 11 Sep 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Datamex
    Datamex avatar
    161 posts
    Member since:
    Jun 2012

    Posted 14 Sep 2009 Link to this post

    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!
  5. Martin
    Admin
    Martin avatar
    811 posts

    Posted 14 Sep 2009 Link to this post

    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.
Back to Top