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

How to make the Width of Detail Grid always in the Width of Master Grid?

6 Answers 86 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Phuc
Top achievements
Rank 1
Phuc asked on 05 Sep 2011, 09:56 AM
Hi all,

I have a Grid which contains a detail Grid. When I click on "expand" icon to expand the detail Grid (its width may be greater than its parent's width), I want Text in the Detail Grid must be on the second line if it exceeds the parent's width) but the detail Grid always extend its Width automatically.

Please let me know how can I do this.

Thanks in advance.

6 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 05 Sep 2011, 11:26 AM
Hello Phuc,

Try setting the TableLayout property of the MasterTableView to Fixed and let me know if it helps to resolve your issue.
 
<MasterTableView TableLayout="Fixed"/>

Regards,
Pavlina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Phuc
Top achievements
Rank 1
answered on 05 Sep 2011, 11:57 AM
Hi Pavlina,
The Width of Detail Grid is OK now but some texts are lost, it does not go to the second line.
This is my detail grid. Do you have any idea?

<telerik:RadGrid ID="gridDetail" runat="server" AutoGenerateColumns="false" Width="99%" ShowHeader="false" BorderStyle="Solid"   BackColor="White" OnNeedDataSource="gridDetail_NeedDataSource">
         <ClientSettings EnableAlternatingItems="false"></ClientSettings>
         <MasterTableView TableLayout="Fixed">
                  <Columns>
                       <telerik:GridBoundColumn DataField="DetailText" ItemStyle-Wrap="true">
                               <ItemStyle BorderStyle="Solid" BorderColor="Gray" />
                       </telerik:GridBoundColumn>
                   </Columns>
           </MasterTableView>
</telerik:RadGrid>


0
Pavlina
Telerik team
answered on 05 Sep 2011, 12:21 PM
Hi Phuc,

Browsers wrap text by default. If this does not happen in your case, then you are either using too long words (which browsers do not break by default), or there is something else, which prevents it.
 
However, if you want to break long words,you can use the following CSS property:

http://www.brunildo.org/test/IEbreak-word.html

Kind regards,
Pavlina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Phuc
Top achievements
Rank 1
answered on 06 Sep 2011, 05:28 AM
Hi Pavlina,

I found that my Text was formatted with HTML blanks as below :

.....
FEATURES&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
:&nbsp;Phuc&nbsp;PHAM&nbsp;2011/07/29&nbsp;12:28<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Planned&nbsp;start&nbsp;
on&nbsp;7/29/2011&nbsp;at&nbsp;12h28&nbsp;/&nbsp;Authorized&nbsp;late&nbsp;(start)&nbsp;00mn&nbsp;/&nbsp;
Duration&nbsp;120mn&nbsp;/&nbsp;Authorized&nbsp;Suppl.&nbsp;delay&nbsp;00mn

Do you have any suggestion to solve this issue ?
The format must be done like that (Text from DB, for WinForm application "/t" or "/n" is used but 
for Web I used "&nbsp;" and "</br>") to make sure the indent or new line for the paragraph).

Thanks for your help. 
0
Pavlina
Telerik team
answered on 06 Sep 2011, 07:28 PM
Hi Phuc,

Could you please send us a live URL or a small project which demonstrates the issue? Thus we will be able to inspect it locally and advice you further.

All the best,
Pavlina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
Phuc
Top achievements
Rank 1
answered on 07 Sep 2011, 03:31 AM
Hi Pavlina,

When I do not use Replace(" ", "&nbsp;"). It means the string does not contain continuous characters, it's OK.

Thanks for your support.
Tags
Grid
Asked by
Phuc
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Phuc
Top achievements
Rank 1
Share this question
or