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

Columns ovver each other

5 Answers 33 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Carlos
Top achievements
Rank 1
Carlos asked on 26 Sep 2013, 02:23 PM
HI all i have a radgrid that its scrollable, but that doesnt happen and the columns are over each other? my problem is get the columns all tidy and add a horizontal scroll bar to it.

Best Regards

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 26 Sep 2013, 02:33 PM
Hi Carlos,

Please have a look into this thread on RadGrid Columns Overlapping. In order to display horizontal scroll for navigation, you need to make sure that the total width of the columns (either auto-generated or declaratively set) exceeds the width of the grid as demonstrated in this online demo.

Thanks,
Shinu.
0
Carlos
Top achievements
Rank 1
answered on 26 Sep 2013, 02:53 PM
Tanks the problem its taht it is already off the page even with the overlap columns.
this is what happens to my columns.


0
Shinu
Top achievements
Rank 1
answered on 27 Sep 2013, 10:59 AM
Hi Carlos,

You can set the HeaderStyle, width for the columns that are not displayed fully.Please try the following sample code snippet.If this doesn't help,Please provide your full code snippet.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" DataSourceID="SqlDataSource1"
           GridLines="None" AllowPaging="true" AllowFilteringByColumn="true">
           <MasterTableView DataKeyNames="OrderID">
               <Columns>
                   <telerik:GridBoundColumn UniqueName="OrderID" DataField="OrderID" HeaderText="OrderID">
                       <HeaderStyle Width="100px" />
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="CustomerID" DataField="CustomerID" HeaderText="CustomerID">
                       <HeaderStyle Width="100px" />
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn UniqueName="EmployeeID" DataField="EmployeeID" HeaderText="EmployeeID" />
                   <telerik:GridBoundColumn UniqueName="ShipVia" DataField="ShipVia" HeaderText="ShipVia" />
                   <telerik:GridBoundColumn UniqueName="OrderDate" DataField="OrderDate" HeaderText="OrderDate" />
                   <telerik:GridBoundColumn UniqueName="RequiredDate" DataField="RequiredDate" HeaderText="RequiredDate" />
                   <telerik:GridBoundColumn UniqueName="ShipName" DataField="ShipName" HeaderText="ShipName" />
                   <telerik:GridBoundColumn UniqueName="ShipCountry" DataField="ShipCountry" HeaderText="ShipCountry" />
               </Columns>
           </MasterTableView>
           <ClientSettings Scrolling-AllowScroll="true">
           </ClientSettings>
       </telerik:RadGrid>

Thanks,
Shinu
0
Carlos
Top achievements
Rank 1
answered on 27 Sep 2013, 01:53 PM
Thanks,

That would work if i didnt had autogenerated columns. Is it a way to do it with autogenerated columns, and the horizontal scrollbar.

Best regards
0
Shinu
Top achievements
Rank 1
answered on 01 Oct 2013, 03:44 AM
Hi Carlos,

You can try the following code snippet to set width for the Autogenerated columns.

C#:
protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
   {
     foreach (GridColumn col in RadGrid1.MasterTableView.AutoGeneratedColumns)
        {
         if (col.DataType == typeof(int))
          {                
            col.HeaderStyle.Width = Unit.Pixel(100);
            col.ItemStyle.Width = Unit.Pixel(100);
          }
        }
    }

Thanks,
Shinu
Tags
Grid
Asked by
Carlos
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Carlos
Top achievements
Rank 1
Share this question
or