Sharepoint 2010 WebPart with Repeater resizing issue
-
13 aprilie 2012 17:35
This is a strange issue i have and i can't figure out what's happening
Visual studio 2010 webpart for Sharepoint foundation 2010.
ii have a repeater in a webPart and a button in the repeater that adds a row to the repeater. each time i click "Add", the width of the webpart goes over 100% of the screen which make it scrollable. i want to avoid that. Any ideas ??
When i load the site, it is peferct, no scrollbar and the width is actually 100% of the screen.
i tried to wrap all in a <div> and nothing same issue.
<asp:repeater id="rpt" EnableViewState="true" runat="server" width="100%">
<headertemplate>
<table cellspacing="0" width="100%" style="font-size:xx-small;font-weight:bolder;" border="0">
<tr>
...
</tr>
<tr>
...
</tr>
</headertemplate>
<itemtemplate>
<tr bgcolor="lightsteelblue">
....
</tr>
</itemtemplate>
<alternatingitemtemplate>
<tr>
...
</tr>
</alternatingitemtemplate>
<footertemplate>
<tr>
<td align="center">
<asp:Button id="bntAdd" CommandName="Add" Runat="server" Text="Add"></asp:Button></td>
<td></td>
</tr>
</table>
</footertemplate>
</asp:repeater>Thanks
Toate mesajele
-
13 aprilie 2012 17:45
May be the issue is with the structure you follow.
as in the last tr of the table (containing button) has only one td, try to map it with columns in other rows / by setting its colspan.
secondly when you add the new row use firebug to see the structure may be there is some html break or the number columns are mismatched
-
13 aprilie 2012 20:39
Thanks for the idea. I did have a mismatch <td> and use colspan. i checked my html and it all looks good. i used firebug and no hml break.
The issue remains !!!!
- Marcat ca răspuns de CSharpAlex 16 aprilie 2012 14:57
-
16 aprilie 2012 07:30
ok , so please tell me that is there something you set by javascript / jquery (specially width of td )
if possible share the code you have implemented.
-
16 aprilie 2012 14:57
No javascript.
I did figure it out. the issue was that the textboxes on my new row were too large (width) and therefore pushing all the controls to the right.
Once i set a width to the textbox, no more issue.
- Propus ca răspuns de servy42Microsoft Community Contributor 16 aprilie 2012 16:52
-
16 aprilie 2012 17:25
Thanks for the idea. I did have a mismatch <td> and use colspan. i checked my html and it all looks good. i used firebug and no hml break.
The issue remains !!!!
remember to mark answers & vote as helpful....