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

Set Auto Widht of Grid

4 Answers 40 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Testing
Top achievements
Rank 1
Testing asked on 03 Jan 2014, 12:39 PM
Hi,
I would like to set 'Auto' width of grid.. because my Page contains left sidebar with hide and show functionality and I have grid with 15 columns.
When I bind the data to grid with '100%' width, it goes outside of design and If I set specific width to grid then it not display properly b'coz of the side bar hide and show functionality.
If same grid contain less column then it works properly..so please give me proper solution.
thank you.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 03 Jan 2014, 01:33 PM
Hi ,

Have you tried setting the RadGrid's MasterTable TableLayout property as Auto to keep the grid rows to contain all the columns.
Please provide your code snippet to know more about this issue.

ASPX:
<MasterTableView TableLayout="Auto". . .>
</MasterTableView>

Thanks,
Shinu
0
Testing
Top achievements
Rank 1
answered on 03 Jan 2014, 01:48 PM
             <table style="margin-left:10px;" >
                     <tr>
                     <td >
                    <div style="width:99%;  ">
                                <telerik:RadGrid ID="gv_Payment_Approve_RejectList" runat="server" Width="100%"
                                      AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True"
                                        AutoGenerateColumns="False"  AllowMultiRowSelection="false" CssClass="AutoShrink" >
                                          <ClientSettings >
                                                      <Selecting AllowRowSelect="true" />
                                                      <Scrolling AllowScroll="true" />
                                                 </ClientSettings>
                                                  
                                                 <MasterTableView  TableLayout="Auto">
                                                     <Columns>
                                                         <telerik:GridBoundColumn DataField="UnitContractId" Display="false" HeaderText="Unit Contract Id" UniqueName="UnitContractId" />
                                                         <telerik:GridBoundColumn DataField="PaymentId" Display="false" HeaderText="Payment Id" UniqueName="PaymentId" />
                                                         <telerik:GridBoundColumn DataField="TenentName" HeaderText="Tenent Name" UniqueName="TenentName" />
                                                         <telerik:GridBoundColumn DataField="ParcelName" HeaderText="Parcel Name" UniqueName="ParcelName" />
                                                         <telerik:GridBoundColumn DataField="ProertyName" HeaderText="Property Name" UniqueName="PropertyName" />
                                                         <telerik:GridBoundColumn DataField="UnitNo" HeaderText="Unit Number" UniqueName="UnitNo" />
                                                         <telerik:GridBoundColumn DataField="ReceiptNo" HeaderText="Receipt Number" UniqueName="ReceiptNo" />
                                                         <telerik:GridBoundColumn DataField="PaymentType" HeaderText="Unit Number" UniqueName="PaymentType" />
                                                         <telerik:GridBoundColumn DataField="Amount" HeaderText="Amount" UniqueName="BudgetRent" />
                                                         <telerik:GridBoundColumn DataField="PaymentStatus" HeaderText="Status" UniqueName="Status" />
                                                         <telerik:GridBoundColumn DataField="ChequeNo" HeaderText="Cheque Number" UniqueName="ChequeNo" />
                                                         <telerik:GridBoundColumn DataField="BankName" HeaderText="Bank Name" UniqueName="BankName" />
                                                         <telerik:GridBoundColumn DataField="ReturnCheckDate" HeaderText="Return Check Date" UniqueName="ReturnChequeDate" />
                                                     </Columns>
                                                 </MasterTableView>
                                             </telerik:RadGrid>
                                             </div>
                                         </td>
                                     </tr>
                                 </table>
0
Testing
Top achievements
Rank 1
answered on 04 Jan 2014, 06:44 AM
hello,
 can anybody tell me how to solve this problem?????
0
Galin
Telerik team
answered on 08 Jan 2014, 01:32 PM
Hi Ganesh,

You can resolve the issue by setting table-layout:fixed on the main table.

I hope this helps.

Regards,
Galin
Telerik
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 the blog feed now.
Tags
Grid
Asked by
Testing
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Testing
Top achievements
Rank 1
Galin
Telerik team
Share this question
or