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

HeaderStyle-HorizontalAlign problem

1 Answer 266 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bader
Top achievements
Rank 1
Bader asked on 07 Jul 2011, 05:20 AM

Hello,

I have a problem with the items and headers HorizontalAlign properties.
I set the "Right" value (<%$ Resources:MngResource, ContentFloat %>" in the following code) for both ItemStyle-HorizontalAlign and HeaderStyle-HorizontalAlign properties, but as a result the radgrid records are not displayes well (please find attached screen-shot).

The code is:

<telerik:RadAjaxPanel runat="server" ID="MngRadAjaxPanel" LoadingPanelID="MngRadAjaxLoadingPanel"
    <telerik:RadGrid ID="MngRadGrid" runat="server" GridLines="None" AllowPaging="True" CssClass="RadGrid"
                AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="true" OnPreRender="MngRadGrid_PreRender"
                OnNeedDataSource="MngRadGrid_NeedDataSource" OnUpdateCommand="MngRadGrid_UpdateCommand"
                OnInsertCommand="MngRadGrid_InsertCommand" OnDeleteCommand="MngRadGrid_DeleteCommand">
            <MasterTableView Width="100%" CommandItemDisplay="Top" Dir="RTL" ItemStyle-HorizontalAlign="<%$ Resources:MngResource, ContentFloat %>" HeaderStyle-HorizontalAlign="<%$ Resources:MngResource, ContentFloat %>"
                             CommandItemSettings-RefreshText="<%$ Resources:GeneralTelerikResource, TelerikRadGridRefreshText %>" DataKeyNames="WbstID"
                             CommandItemSettings-AddNewRecordText="<%$ Resources:GeneralTelerikResource, TelerikRadGridAddNewRecordText %>" >
            <Columns>
                <telerik:GridEditCommandColumn EditText="<%$ Resources:GeneralTelerikResource, TelerikRadGridEditColumnText %>" ItemStyle-Width="7%" UniqueName="EditCommandColumn1" >
                </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn UniqueName="WbstID" HeaderText="<%$ Resources:MngResource, PagesSecureSqlServerWebsitesMngRadGridColumnsWbstID %>" ItemStyle-Width="7%" DataField="WbstID">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="WNam" HeaderText="<%$ Resources:MngResource, PagesSecureSqlServerWebsitesMngRadGridColumnsWNam %>" ItemStyle-Width="50%" DataField="WNam" >
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn UniqueName="ViewWebsite" HeaderText="<%$ Resources:MngResource, PagesSecureSqlServerWebsitesMngRadGridColumnsViewWebsite %>" ItemStyle-Width="13%" DataField="ViewWebsite">
                </telerik:GridCheckBoxColumn>
                <telerik:GridBoundColumn UniqueName="UserName" Visible="false" HeaderText="<%$ Resources:MngResource, PagesSecureSqlServerMngRadGridColumnsUserName %>" ItemStyle-Width="12%" DataField="UserName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="LastModifyDate" HeaderText="<%$ Resources:MngResource, PagesSecureSqlServerMngRadGridColumnsLastModifyDate %>" ItemStyle-Width="16%" DataField="LastModifyDate">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn ConfirmText="<%$ Resources:GeneralTelerikResource, TelerikRadGridDeleteColumnConfirmText %>" ConfirmDialogType="RadWindow" ItemStyle-Width="7%"
                    ConfirmTitle="<%$ Resources:GeneralTelerikResource, TelerikRadGridDeleteColumnConfirmTitle %>" ButtonType="ImageButton" CommandName="Delete" Text="<%$ Resources:GeneralTelerikResource, TelerikRadGridDeleteColumnText %>"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                </telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings UserControlName="~/SecureSiteManagenment/Pages/SecureSQLServer/Websites/SubUserControl.ascx" EditFormType="WebUserControl">
                <EditColumn UniqueName="EditCommandColumn1">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>
    </telerik:RadGrid>
</telerik:RadAjaxPanel>

Please, I need your help in order to make all records of the RadGrid control to be displayed aligned to right well.
It is appreciated to send me the modified code.

Regards,
Bader

1 Answer, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 07 Jul 2011, 09:09 AM
Hello Bader,

To resolve this problem you should also set AlternatingStyle-HorizontalAlign property as shown below:
ASPX:
<MasterTableView Width="100%" CommandItemDisplay="Top" Dir="RTL" ItemStyle-HorizontalAlign="<%$ Resources:MngResource, ContentFloat %>" AlternatingStyle-HorizontalAlign="<%$ Resources:MngResource, ContentFloat %>"   HeaderStyle-HorizontalAlign="<%$ Resources:MngResource, ContentFloat %>"
  
                             CommandItemSettings-RefreshText="<%$ Resources:GeneralTelerikResource, TelerikRadGridRefreshText %>" DataKeyNames="WbstID"
  
                             CommandItemSettings-AddNewRecordText="<%$ Resources:GeneralTelerikResource, TelerikRadGridAddNewRecordText %>"

Give it a try and let me know how it goes.

Best wishes,
Pavlina
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
Grid
Asked by
Bader
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or