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

PLEASE HELP ME!!! bug with ItemStyle HeaderStyle in a grid with custom skin!!! they are not equal!

9 Answers 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
lina fetisova
Top achievements
Rank 1
lina fetisova asked on 30 Nov 2010, 09:02 AM
Good day!
I have got a grid with my custom skin made in the Visual Style Builder.
My custom skin css is here - http://new.globalfarm.ru/FarmPortal/Grid.FarmPortal.css
No matter what i write in ItemStyle Width &  HeaderStyle Width - columns look like they wants by themselfs in different browsers :(
HeaderStyle width is not equal with ItemStyle Width!
for example there are attached images for such code in different browsers (it no matter if i write only HeaderStyle Width or both ItemStyle Width &  HeaderStyle Width)

<telerik:RadGrid ID="grProducts" runat="server" CssClass="MyGridClass1"
        AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
        GridLines="None" Skin="FarmPortal" EnableEmbeddedSkins="false"
        onitemdatabound="grProducts_ItemDataBound" onprerender="grProducts_PreRender" Width="100%">
<MasterTableView Width="100%" TableLayout="Auto">
    <Columns>
        <telerik:GridBoundColumn DataField="Id" HeaderText="Id" ReadOnly="True" UniqueName="Id" SortExpression="Id" Visible="false">
            <HeaderStyle Width="0" />           
            <ItemStyle  HorizontalAlign="Left" Width="0" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Num" HeaderText="№" ReadOnly="True" UniqueName="Num" SortExpression="Num" HeaderStyle-Width="3%" ItemStyle-Width="3%" >
            <HeaderStyle Width="3%" />  
             <ItemStyle Width="3%" />
        </telerik:GridBoundColumn>
        <telerik:GridHyperLinkColumn DataNavigateUrlFields="Name" DataTextField ="Name" HeaderText="Наименование" UniqueName="Name" SortExpression="Name" HeaderStyle-Width="65%" ItemStyle-Width="65%">            
            <ItemStyle   Width="65%"  />
            <HeaderStyle Width="65%" />
        </telerik:GridHyperLinkColumn>
        <telerik:GridBoundColumn DataField="Count" HeaderText="Количество предложений" ReadOnly="True" UniqueName="Count" SortExpression="Count" HeaderStyle-Width="12%" ItemStyle-Width="12%" >           
            <ItemStyle  HorizontalAlign="Center" Width="12%"  />
            <HeaderStyle Width="12%" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MinPrice" HeaderText="Мин. цена" ReadOnly="True" UniqueName="MinPrice" SortExpression="MinPrice" DataFormatString="{0:c2}" HeaderStyle-Width="10%" ItemStyle-Width="10%" >
            <HeaderStyle Width="10%" />
            <ItemStyle  HorizontalAlign="Center" Width="10%"  />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MaxPrice" HeaderText="Макс. цена" ReadOnly="True" UniqueName="MaxPrice" SortExpression="MaxPrice" DataFormatString="{0:c2}" HeaderStyle-Width="10%" ItemStyle-Width="10%" >
            <HeaderStyle Width="10%"  />
            <ItemStyle  HorizontalAlign="Center" Width="10%" />
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
    <ClientSettings AllowColumnsReorder="True" AllowDragToGroup="True"
        ReorderColumnsOnClient="True">
        <Selecting AllowRowSelect="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
</telerik:RadGrid>

there width i not equal, in the example in is not very aufull, but in other tables is. I want them to have equal width. What do I do wrong?

9 Answers, 1 is accepted

Sort by
0
lina fetisova
Top achievements
Rank 1
answered on 30 Nov 2010, 12:02 PM
any ideas?
0
Pavlina
Telerik team
answered on 30 Nov 2010, 04:10 PM
Hi Lina,

Please have in mind that it is not recommended to use ItemStyle-Width to set column widths. Only HeaderStyle-Width should be used.

Give this suggestion a try and see if it helps.

Greetings,
Pavlina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
lina fetisova
Top achievements
Rank 1
answered on 30 Nov 2010, 06:18 PM
Pavlina, i've already tried it. it do not help too, it makes everything worse :(
0
lina fetisova
Top achievements
Rank 1
answered on 30 Nov 2010, 06:25 PM
I use Rad Grid with default skin (office2007), I write there only Header-Style width and everything is ok =(
but not here =(
maybe the problem is in the custom skin?
0
lina fetisova
Top achievements
Rank 1
answered on 01 Dec 2010, 08:49 AM
Pavlina! I've sold my problem - because of smth the bug was in <Scrolling AllowScroll="True" UseStaticHeaders="True" />
=) now everything is ok! =))) thank you!
0
Pavlina
Telerik team
answered on 01 Dec 2010, 09:16 AM
Hello Lina,

I am glad that you could solve the problem on your own.

Best wishes,
Pavlina
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Michael McCallum
Top achievements
Rank 1
answered on 01 Feb 2011, 06:16 AM
I am having the same type of issue using HeaderStyle Width. I can only get the following header style to work:
<HeaderStyle HorizontalAlign="Center" Width="50px" />
when client scrolling is set like this:
<Scrolling AllowScroll="True" UseStaticHeaders="True" />

If is turn of either of the AllowScroll or UseStaticHeaders, the width of the column is no longer set.  This would appear to be a bug. I use both of these client options as false, so I cannot get a column width to work for editing.  I really do not want to have to grab the text box on editing and manually set the width.

Any suggestions?

Thanks, Mike

0
Michael McCallum
Top achievements
Rank 1
answered on 01 Feb 2011, 07:10 PM
Opened a support ticket on this and found that the MasterTableView needs to have following setting for the HeaderStyle widths to be applied to the all columns of the table.

Mike

TableLayout

 

="Fixed"

 

0
Pavlina
Telerik team
answered on 03 Feb 2011, 10:34 AM
Hello Michael,

Please, refer to the support ticket post for additional information. To avoid duplicate posts, I suggest that we continue our communication there.

Best wishes,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Grid
Asked by
lina fetisova
Top achievements
Rank 1
Answers by
lina fetisova
Top achievements
Rank 1
Pavlina
Telerik team
Michael McCallum
Top achievements
Rank 1
Share this question
or