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

RadGrid Not Recognizing Width

3 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tracy
Top achievements
Rank 1
Tracy asked on 24 Oct 2013, 04:02 AM
Hi,

I have a rad grid with the width set to 1800px but when it renders it doesn't recognize the width.  It makes the grid the size of all the columns.
Does anyone know why this would happen.   I have a lot of other grids and this doesn't happen.

Thanks for you help.
Tracy
<div ID="divGrid" runat="server"  style="width:1900; background-color:Red;">
 
            <telerik:RadGrid ID="rgvMainGrid"       runat="server"                  DataSourceID="SQLDS_Receivables"  
                 EnableEmbeddedSkins="true"         Skin="Office2010Silver"         EnableAjaxSkinRendering="true"        Height="600px"  Width="1800px"
                 EnableViewState="true"             AutoGenerateColumns="false"     AllowMultiRowSelection="false"     
                 AllowFilteringByColumn="false"     EnableHeaderContextMenu="false" EnableHeaderContextFilterMenu="false"  ShowGroupPanel="false"  
                 AllowAutomaticDeletes="false"      AllowAutomaticInserts="false"   AllowAutomaticUpdates="false"                                 
                 AllowSorting="true"                EnableLinqExpressions="false"   AllowPaging="false"  PageSize="100"     >                                 
                <ItemStyle              Wrap="true"  />
                <AlternatingItemStyle   Wrap="true" />
                <ActiveItemStyle        BackColor="CornflowerBlue"/>
                <HeaderStyle            HorizontalAlign="Center"/>
                <EditItemStyle      BackColor="CornflowerBlue"/>     
                <ClientSettings     AllowColumnsReorder="true"      ReorderColumnsOnClient="true"     ColumnsReorderMethod="Reorder"   AllowDragToGroup="false"  EnablePostBackOnRowClick="false"    EnableRowHoverStyle="false"  
                     
                    <Resizing       AllowColumnResize="false"        EnableRealTimeResize="true"         ResizeGridOnColumnResize="false"  AllowRowResize="false" />
                    <Selecting      AllowRowSelect="true"/>
                    <Scrolling      AllowScroll="true"              UseStaticHeaders="true" />                       
                </ClientSettings>
                <GroupHeaderItemStyle Font-Size="11px"              Font-Names="calibri"                Font-Bold="true"  Height="12px"/>
                <MasterTableView    Name="Invoices"                 DataSourceID="SQLDS_Receivables"    DataKeyNames="RecordId"         ClientDataKeyNames="RecordId"
                                    EnableViewState="true"          EditMode="EditForms"                CommandItemDisplay="None"       TableLayout="Fixed" Width="1800px"
                                    EnableNoRecordsTemplate="true"  ShowHeadersWhenNoRecords="true" >                                                                                                             
                    <NoRecordsTemplate> <div>There are no records to display. </div></NoRecordsTemplate>
 
                    <Columns>  
                        <telerik:GridBoundColumn  UniqueName="Job"                      DataField="Job"                     HeaderText="Job"                    HeaderStyle-Width="87px"    ReadOnly="true"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="JobDescription"           DataField="JobDescription"          HeaderText="Job Name"               HeaderStyle-Width="200px"   ReadOnly="true"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Extra"                    DataField="Extra"                   HeaderText="Extra"                  HeaderStyle-Width="87px"    ReadOnly="true"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="CustomerName"             DataField="CustomerName"            HeaderText="Customer Name"          HeaderStyle-Width="200px"   ReadOnly="true"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="ContractNumber"           DataField="ContractNumber"          HeaderText="Contract"               HeaderStyle-Width="100px"   ReadOnly="true"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="DocumentId"               DataField="DocumentId"              HeaderText="Document Id"            HeaderStyle-Width="100px"   ReadOnly="true"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Draw"                     DataField="Draw"                    HeaderText="Draw"                   HeaderStyle-Width="125px"   ReadOnly="true"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="InvoiceDate"              DataField="InvoiceDate"             HeaderText="Inv Date"               HeaderStyle-Width="80px"    ReadOnly="true"  DataType="System.DateTime"   DataFormatString="{0:MM/dd/yy}"      ItemStyle-HorizontalAlign="Center" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="DaysOld"                  DataField="DaysOld"                 HeaderText="Days Old"               HeaderStyle-Width="40px"    ReadOnly="true"  DataType="System.Int16"      DataFormatString="{0:#,###,###}"     ItemStyle-HorizontalAlign="Right"  FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="AccountingDate"           DataField="AccountingDate"          HeaderText="Acct Date"              HeaderStyle-Width="80px"    ReadOnly="true"  DataType="System.DateTime"   DataFormatString="{0:MM/dd/yy}"      ItemStyle-HorizontalAlign="Center" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="BilledLessRetainage"      DataField="BilledLessRetainage"     HeaderText="Billed Less Ret"        HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="UnbilledRetainage"        DataField="UnbilledRetainage"       HeaderText="Unbilled Retainage"     HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridTemplateColumn UniqueName="gtcUpdateAll"                                               HeaderText="Update All Transactions"  AllowFiltering="false" >
                            <ItemTemplate></ItemTemplate>
                            <EditItemTemplate><asp:CheckBox ID = "chkUpdateAll"         runat="server"  Checked="true" /></EditItemTemplate>
                        </telerik:GridTemplateColumn>
                                                                                                                                                               
                        <telerik:GridTemplateColumn UniqueName="gtcExpectedPaymentDate" DataField="ExpectedPaymentDate"     HeaderText="Exp Pay Date"           HeaderStyle-Width="80px"    ItemStyle-HorizontalAlign="Center" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" >
                            <ItemTemplate><asp:Label ID="lblExpectedPaymentDate"        runat="server"  Text='<%# Eval("ExpectedPaymentDate", "{0:MM-dd-yy}" ) %>'   /></ItemTemplate>
                            <EditItemTemplate><telerik:RadDatePicker ID = "rdpExpectedPaymentDate"         runat="server" Width="85px" DbSelectedDate='<%# Bind("ExpectedPaymentDate") %>'   SkinID="skn_RadDatePicker" /></EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn    UniqueName="DaysToPay"              DataField="DaysToPay"               HeaderText="Days To Pay"            HeaderStyle-Width="55px"   ReadOnly="true"  DataType="System.Int16"      DataFormatString="{0:#,###,###}"     ItemStyle-HorizontalAlign="Right"  FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridDropDownColumn UniqueName="ActionCode"             DataField="ActionCode"              HeaderText="Action"                 HeaderStyle-Width="100px"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>"       ListTextField="LevelCode"  ListValueField="IdentifierCode"  DataSourceID="SQLDS_ActionCode"       DropDownControlType="RadComboBox" DefaultInsertValue="NA" />
                        <telerik:GridDropDownColumn UniqueName="StatusCode"             DataField="StatusCode"              HeaderText="Status"                 HeaderStyle-Width="120px"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>"       ListTextField="LevelCode"  ListValueField ="IdentifierCode" DataSourceID="SQLDS_StatusCode"       DropDownControlType="RadComboBox" DefaultInsertValue="NA"/>
                        <telerik:GridDropDownColumn UniqueName="ResponsibleParty"       DataField="ResponsibleParty"        HeaderText="Responsible Party"      HeaderStyle-Width="150px"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>"       ListTextField="LevelCode"  ListValueField ="IdentifierCode" DataSourceID="SQLDS_ResponsibleParty" DropDownControlType="RadComboBox" DefaultInsertValue="NA"/>
                        <telerik:GridTemplateColumn UniqueName="Comments"               DataField="Comments"                HeaderText="Comments"               HeaderStyle-Width="120px"   FilterImageUrl="<%$ Resources:Images,FilterGray16%>" >
                            <ItemTemplate>
                                <asp:Label ID="lblComments"                   runat="server"  Text='<%# Bind("Comments") %>'  />
                                <asp:ImageButton ID="ibtHistory"              runat="server"  ImageUrl='<%# Eval("HistoryImage") %>' ToolTip="Click To Show Status History" />
                            </ItemTemplate>
                            <EditItemTemplate><telerik:RadTextBox  ID="txtComments"     runat="server"  Text='<%# Bind("Comments") %>'  TextMode="MultiLine"  InputType="Text"  Width="500px" Rows="5" Height="50px" Resize="Both" ButtonsPosition="Right"/></EditItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn  UniqueName="CurrentlyDue"             DataField="CurrentlyDue"            HeaderText="Currently Due"          HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Days31"                   DataField="Days31"                  HeaderText="Age 31-60 Days"         HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Days61"                   DataField="Days61"                  HeaderText="Age 61-90 Days"         HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Days91"                   DataField="Days91"                  HeaderText="Age > 90 Days"          HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="PastDue"                  DataField="PastDue"                 HeaderText="Payment Past Due"       HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Pay30"                    DataField="Pay30"                   HeaderText="Due 0-30 Days"          HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Pay60"                    DataField="Pay60"                   HeaderText="Due 31-60 Days"         HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Pay90"                    DataField="Pay90"                   HeaderText="Due 61-90 Days"         HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="Pay91"                    DataField="Pay91"                   HeaderText="Due >90 Days"           HeaderStyle-Width="100px"   ReadOnly="true"  DataType="System.Decimal"    DataFormatString="{0:#,###,###.#0}"  ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                        <telerik:GridBoundColumn  UniqueName="RecordId"                 DataField="RecordId"                HeaderText="Record Id"              HeaderStyle-Width="50px"    ReadOnly="true"  DataType="System.Int32"      DataFormatString="{0:###}"           ItemStyle-HorizontalAlign="Right" FilterImageUrl="<%$ Resources:Images,FilterGray16%>" />
                    </Columns>
                 
                </MasterTableView>
            </telerik:RadGrid>
</div>

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 24 Oct 2013, 06:56 AM
Hello,

1. Please write "1900px" in div and then check it
<div ID="divGrid" runat="server"  style="width:1900px; background-color:Red;">

2. Please make sure you have not created any global skin for radgrid. (may be you have created skin for this grid, in this skin you have assigned different width)

Let me know if any concern.

Thanks,
Jayesh Goyani
0
Tracy
Top achievements
Rank 1
answered on 24 Oct 2013, 04:50 PM
Hi Jayesh,

Thank you for your response.  That didn't fix my problem, but I created a new page and put the grid in it and it worked fine.  It must have been something weird in visual studio.

Thanks
Tracy
0
Jayesh Goyani
Top achievements
Rank 2
answered on 28 Oct 2013, 04:46 AM
Hello,

(May be) Sorry but this issue is raised in your existing page because of some other Style is affected to your Radgrid/Div.

Can you please check it using Firefbug/Developer tool?

Let me know if any concern.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Tracy
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Tracy
Top achievements
Rank 1
Share this question
or