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

Detail View width problem

1 Answer 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Myriam
Top achievements
Rank 1
Myriam asked on 17 Mar 2009, 05:04 PM
Hello
i would like to know how to set the width of my detail table, as when my user has another resolution screen on his pc, it doesn't fit in the screen. The left overflow the screen. so the user doesn't seems the beginning of my detail viewtable
Here is my code
Thanks in advance



 <telerik:RadGrid   
            DataSourceID="CustomerSource" 
            ID="RadGrid1" 
            autogeneratecolumns=False 
            runat="server"   
            GridLines="None"   
            ShowHeader="false"   
             Skin="Office2007" 
            showfooter="true" 
            OnPreRender="RadGrid1_PreRender" 
                
            Width="99%" 
            HorizontalAlign="Center" 
            EnableLinqExpressions="false" 
            > 
            <MasterTableView   
                TableLayout="Auto"    
                datasourceid="CustomerSource"   
                GridLines="None"   
                Width="100%"   
                ShowFooter=false   
                ShowHeader="true" 
                ShowGroupFooter=false 
                HierarchyDefaultExpanded=true   
                DataKeyNames="NO_FOURNISSEUR" 
                HorizontalAlign="Center" 
                NoMasterRecordsText="Aucun enregistrement">  
                   
                  
                <Columns> 
                  
                   <telerik:GridBoundColumn SortExpression="NO_FOURNISSEUR"   
                       HeaderText="NO_FOURNISSEUR"   
                       DataField="NO_FOURNISSEUR"   
                       UniqueName="NO_FOURNISSEUR"   
                       ReadOnly="true"   
                       Visible="false" GroupByExpression="NO_FOURNISSEUR">  
                    </telerik:GridBoundColumn> 
                     
                    <telerik:GridTemplateColumn> 
                        <ItemTemplate>    
                          
                        <asp:textbox id="labelinvisible" runat="server" BorderWidth="0" BorderColor=White></asp:textbox> 
                        <br /> 
                            <asp:Label ID="Label1" Text='<% # DisplayFournDetail(Container) %>' runat="server"></asp:Label>    
                              
                        </ItemTemplate>    
                         <ItemStyle Width="200px"></ItemStyle> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn UniqueName="MessageFourn">  
                        <ItemTemplate>    
                            <asp:TextBox runat=server ID="TxtMessageFourn" TextMode=MultiLine Height="100px" width="500px" Text='<% # RechercheFournisseurMessage(Container) %>'></asp:TextBox>                 
                        </ItemTemplate>     
                        <ItemStyle VerticalAlign="Middle" HorizontalAlign="Center" /> 
                    </telerik:GridTemplateColumn> 
                                                                              
                    <telerik:GridButtonColumn   
                        ButtonType=LinkButton   
                        UniqueName="LkMessEnregistrer"   
                        CommandName="MessEnregistrer"   
                        Text="Sauvegarder">   
                     <ItemStyle Width="200px" CssClass="LienB" HorizontalAlign="Center"></ItemStyle> 
                    </telerik:GridButtonColumn>   
                </Columns> 
                  
                <DetailTables > 
                  
                     <telerik:GridTableView   
                     TableLayout="Auto"   
                     GridLines=Both   
                     Width="126%"   
                     ShowFooter=true   
                     DataKeyNames="No_fournisseur_produit"   
                     ShowHeader=true   
                     DataSourceID="PanierItemSource"   
                     CssClass="Detail"    
                     BorderColor="#336699" 
                     Name="Detail" CommandItemDisplay="Bottom" 
                        
                     > 
                       <CommandItemTemplate>    
                        <img alt="" width="100%" height="20px" src="Image/Fond_Rouge.JPG"/>    
                          
                        </CommandItemTemplate>    
 
                      <HeaderStyle CssClass="ImageFond" /> 
                      <FooterStyle CssClass="ImageFond" /> 
                           <ParentTableRelation> 
                               <telerik:GridRelationFields DetailKeyField="NO_FOURNISSEUR" MasterKeyField="NO_FOURNISSEUR" /> 
                           </ParentTableRelation>    
                             
                            <RowIndicatorColumn Visible="False">  
                                <HeaderStyle></HeaderStyle>  
                            </RowIndicatorColumn> 
 
                            <ExpandCollapseColumn Visible="False" Resizable="False">  
                                <HeaderStyle ></HeaderStyle>  
                            </ExpandCollapseColumn> 
                             
                           <Columns> 
                                                
                                 <telerik:GridTemplateColumn UniqueName="Template3" HeaderText="Confirmer">  
                                    <ItemTemplate> 
                                        <asp:CheckBox ID="CheckBox2" Checked='<% # Eval("CONFIRM") %>' autopostback=true runat="server" OnCheckedChanged="CheckedChanged"/>  
                                    </ItemTemplate>   
 
                                <HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
                                 
                                </telerik:GridTemplateColumn> 
                                  
                                <telerik:GridMaskedColumn    
                                     DataField="NO_PANIER"   
                                     UniqueName="NO_PANIER"   
                                     ReadOnly="true" 
                                     visible="false">  
                                </telerik:GridMaskedColumn > 
                                 
                               <telerik:GridButtonColumn   
                                    ButtonType="LinkButton" 
                                    CommandName="SupprimerItem"   
                                    Text="Supprimer" 
                                    UniqueName"SupprimerColumn"   
                                    HeaderText="Supprimer" 
                                    ItemStyle-Font-Size="Smaller" 
                                    ConfirmText="Voulez-vous supprimer l'élément suivant?" 
                                    ImageUrl="~/image/Item_Supp.jpg" > 
                                      
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
 
<ItemStyle Font-Size="Smaller"></ItemStyle> 
                                 </telerik:GridButtonColumn> 
                                      
                                <telerik:GridButtonColumn   
                                    ButtonType="LinkButton"   
                                    CommandName="ModifierItem"   
                                    Text="Modifier" 
                                    headertext = "Modifier" 
                                    ItemStyle-Font-Size="Smaller" 
                                    UniqueName"ModifierColumn"   
                                    ImageUrl="~/image/Item_Mod.jpg">  
                          
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
 
<ItemStyle Font-Size="Smaller"></ItemStyle> 
                                 </telerik:GridButtonColumn> 
                          
                               <telerik:GridMaskedColumn   
                                     DataField="CONFIRM"   
                                     UniqueName="CONFIRM"   
                                     ReadOnly="true" 
                                     visible="false">  
                               </telerik:GridMaskedColumn> 
                                 
                               <telerik:GridMaskedColumn   
                                     DataField="Non_Liste"   
                                     UniqueName="Non_Liste"   
                                     ReadOnly="true" 
                                     visible="false">  
                               </telerik:GridMaskedColumn> 
                                                               
                                 <telerik:GridTemplateColumn   
                                    HeaderText="Image" 
                                   > 
                                    <ItemTemplate>    
                                        <asp:Label   
                                            ID="Label2"   
                                            Text='<% # DisplayImage(Container) %>'   
                                            runat="server">  
                                        </asp:Label>    
                                    </ItemTemplate>    
 
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridTemplateColumn   
                                 ItemStyle-Font-Size="Smaller" 
                                    HeaderText="Produit">  
                                    <ItemTemplate>    
                                        <asp:Label   
                                         CssClass="Texte13N" 
                                            ID="Label3"   
                                            Text='<% # DisplayItemDetail(Container) %>'   
                                            runat="server">  
                                        </asp:Label>    
                                    </ItemTemplate>    
 
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
 
<ItemStyle Font-Size="Smaller"></ItemStyle> 
                                </telerik:GridTemplateColumn> 
                                <telerik:GridNumericColumn   
                                    SortExpression="QUANTITE"   
                                    DataType="System.double"   
                                    HeaderText="QTE"   
                                    ItemStyle-Font-Size="Smaller" 
                                    DataField="QUANTITE"   
                                    UniqueName="QUANTITE"   
                                    Visible="true" 
                                    > 
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
 
                                    <ItemStyle HorizontalAlign="Right" CssClass="Texte13N" /> 
                                </telerik:GridNumericColumn> 
                                  
                                                                 
                                <telerik:GridNumericColumn   
                                    SortExpression="PRIX"   
                                    DataType="System.double"   
                                    HeaderText="PRIX"   
                                    ItemStyle-Font-Size="Smaller" 
                                    DataField="PRIX"   
                                    UniqueName="PRIX"   
                                    DataFormatString="{0:C}" 
                                    Visible="true">  
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
 
                                    <ItemStyle   
                                        HorizontalAlign="Right"   
                                        Width="40px" CssClass="Texte13N"/>  
                                </telerik:GridNumericColumn> 
                                       
                                <telerik:GridCalculatedColumn   
                                    HeaderText="Sous Total"   
                                    ItemStyle-Font-Size="Smaller" 
                                    UniqueName="SousTotal"   
                                    DataType="System.Double" 
                                    DataFields="QUANTITE, PRIX" 
                                    Expression="{0}*{1}"   
                                    DataFormatString="{0:C}">  
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
 
                                    <ItemStyle   
                                        HorizontalAlign="Right" CssClass="Texte13N">  
                                    </ItemStyle> 
                                    </telerik:GridCalculatedColumn> 
                                  
                                <telerik:GridCalculatedColumn   
                                    HeaderText="TPS"   
                                    ItemStyle-Font-Size="Smaller" 
                                   UniqueName="TPS"   
                                    DataType="System.Double" 
                                    DataFields="QUANTITE, PRIX, TPS" 
                                    Expression="({0}*{1})*{2}"   
                                    DataFormatString="{0:C}">  
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
 
                                    <ItemStyle   
                                        HorizontalAlign="Right" CssClass="Texte13N">  
                                    </ItemStyle> 
                                    </telerik:GridCalculatedColumn> 
                                  
                                <telerik:GridCalculatedColumn   
                                    HeaderText="TVQ"   
                                    ItemStyle-Font-Size="Smaller" 
                                    UniqueName="TVQ"   
                                    DataType="System.decimal" 
                                    DataFields="QUANTITE, PRIX, TPS, TVQ"   
                                    Expression="(({0}*{1}) + (({1}*{0})*{2}))*{3}"   
                                    DataFormatString="{0:C}">  
<HeaderStyle  CssClass="EnteteTable2 ImageFond"></HeaderStyle> 
 
                                    <ItemStyle   
                                        HorizontalAlign="Right" CssClass="Texte13N">  
                                    </ItemStyle> 
                                </telerik:GridCalculatedColumn> 
                                
                                 
                                 <telerik:GridCalculatedColumn   
                                    HeaderText="Total"   
                                    ItemStyle-Font-Size="Smaller" 
                                   UniqueName="Total"   
                                    DataType="System.Double" 
                                    DataFields="QUANTITE, PRIX, TPS, TVQ" 
                                    Expression="(({1}*{0})+(({1}*{0})*{2}) + (({0}*{1}) + (({1}*{0})*{2}))*{3})"   
                                    FooterText="Total : " 
                                    Aggregate="Sum"   
                                    DataFormatString="{0:C}" 
                                    FooterAggregateFormatString="{0:C}">  
                                    <HeaderStyle CssClass="EnteteTable2 ImageFond" BorderWidth="1" BorderColor="GrayText"></HeaderStyle> 
 
                                    <ItemStyle   
                                        HorizontalAlign="Right" BorderWidth="1" BorderColor="GrayText" CssClass="Texte13N">  
                                    </ItemStyle> 
                                    <FooterStyle ForeColor="#FFFFFF" BorderWidth="1" BorderColor="GrayText" HorizontalAlign="Right" /> 
                                    </telerik:GridCalculatedColumn>        
                           </Columns> 
                             
                            <EditFormSettings> 
                          <PopUpSettings ScrollBars="None"></PopUpSettings> 
                      </EditFormSettings> 
                     </telerik:GridTableView> 
                 </DetailTables> 
                 <EditFormSettings> 
                     <PopUpSettings ScrollBars="None"></PopUpSettings> 
                 </EditFormSettings> 
 
                 <RowIndicatorColumn Visible="False">  
                    <HeaderStyle Width="20px"></HeaderStyle> 
                 </RowIndicatorColumn> 
 
                 <ExpandCollapseColumn Visible=false Resizable=false>  
<HeaderStyle Width="20px"></HeaderStyle> 
                 </ExpandCollapseColumn> 
                   
            </MasterTableView> 
           <ClientSettings>   
                <Resizing AllowColumnResize="false" />   
           </ClientSettings>   
             
<FilterMenu Skin="Office2007" EnableTheming="True">  
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
             
        </telerik:RadGrid> 

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 18 Mar 2009, 06:19 AM

Hi Myriam,

 

You have set the master table width is 99% and details table is 126%, that can be the reason of details table not fit in the screen. So, try setting the width as 100% of DetailTable and see what happens. You can also check the code library which demonstrates how to add scrolls to each table in grid hierarchy.
Separate scrolls for inner tables in hierarchical grid

Thanks,
Princy.

Tags
Grid
Asked by
Myriam
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or