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

Expand Column not able to resize

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin Pretorius
Top achievements
Rank 1
Justin Pretorius asked on 28 Oct 2011, 01:34 PM
I am probably sure this has been covered somewhere but I cannot find the exact cause of the problem I am experiencing.

I have a grid that has a CommandItemTemplate with an image and Label control.  When the grid is populated with data from a pivot query, the expand column expands to beyond 20 pixels with CommandHeaderDispaly=Top.  When CommandHeaderDisplay=None, I get the correct width as set by the code I have on the page.

Here is the Grid markup:

<telerik:RadGrid ID="rgdFacilityOT" runat="server" Visible="True" Skin="Office2007"
                          oncolumncreated="rgdFacilityOT_ColumnCreated"
                          ondetailtabledatabind="rgdFacilityOT_DetailTableDataBind"
                          onitemdatabound="rgdFacilityOT_ItemDataBound" AutoGenerateColumns="true"
                          onitemcreated="rgdFacilityOT_ItemCreated" MasterTableView-ExpandCollapseColumn-HeaderStyle-Width="20px">
                          <MasterTableView TableLayout="Fixed" CommandItemDisplay="Top">
                          <CommandItemTemplate>
                          <div>
                              <asp:Label runat="server" CssClass="rgHeader" ID="lblFacilityOTGridTitle" Text="" meta:ResourceKey="lblFacilityOTGridTitleResource1"></asp:Label>
                           <div class="export_button_right">
                            <asp:ImageButton ID="btnGridExport" ImageUrl="~/Images/Excel-16x16.gif" OnClick="btnExcel_Click"
                                           runat="server" ToolTip="Export To Excel"
                                   meta:resourcekey="btnGridExportResource1" />
                             </div>
                             </div>
                      </CommandItemTemplate>
                        <CommandItemSettings ShowExportToExcelButton="True"
                            ShowAddNewRecordButton="False" ExportToPdfText="Export to PDF" />
                           <ExpandCollapseColumn Resizable="True" Visible="False">
                         
                        </ExpandCollapseColumn>
                              <CommandItemSettings ExportToPdfText="Export to PDF" />
                        <RowIndicatorColumn Visible="False">
                          
                        </RowIndicatorColumn>

                              <EditFormSettings>
                                  <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                  </EditColumn>
                              </EditFormSettings>

                          </MasterTableView>
                              <ClientSettings AllowExpandCollapse="False">
                        <Scrolling AllowScroll="True" UseStaticHeaders="False" ScrollHeight="">
                        </Scrolling>
                     </ClientSettings>
                          <FilterMenu EnableImageSprites="False">
                          </FilterMenu>
                          <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007">
                          </HeaderContextMenu>
               </telerik:RadGrid>   


I just want to be able to control the width of the expand column.  I have tried the following CSS:

.rgExpandCol
{
    width: 10px !important;
       padding-left: 0 !important ;
       padding-right: 0 !important ;
       text-align: left ;
}

but it still does not work. I am sure it is something simple or I have missed something

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 02 Nov 2011, 03:49 PM
Hello Justin Pretorius,

To decrease the expand column's width below 20px - you need to first remove the cells' side paddings and decrease the width of the expand/collapse buttons inside grid PreRender event. Please refer to the attached sample project which demonstrates how this can be achieved and let me know if it works for you.

All the best,
Pavlina
the Telerik team
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 their blog feed now
Tags
Grid
Asked by
Justin Pretorius
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or