0

我有一个带有一些列的 ASPxGridView。

当我选择一行并进入编辑模式时,我希望这 3 个复选框(红色的)右对齐而不是左对齐:

在此处输入图像描述

我只是找不到正确的属性来对齐它们(或者我做错了什么,也许?)。

这是我的 ASPxGridView 的代码。

<dx:ASPxGridView ID="grdxFornecedor"  runat="server" AutoGenerateColumns="False" Border-BorderStyle="None"
                Border-BorderWidth="0px" Paddings-Padding="0" SettingsBehavior-AllowSort="true" 
                KeyFieldName="IdFornecedor" Style="margin-right: 0px" 
       ClientInstanceName="grid" Width="975px" >                

     <Paddings Padding="0px" />
    <ClientSideEvents RowClick="function(s, e) {                    
        //s.StartEditRow(e.visibleIndex);
     }" 
    />

     <ClientSideEvents RowDblClick="function(s,e){
        //alert(s.GetFocusedRowIndex());
        //alert(s.GetRowKey(e.visibleIndex));
        //alert(s.GetRowKey(e.htmlEvent.srcElement.cellIndex));
        if(e.htmlEvent.srcElement.cellIndex == 0 || e.htmlEvent.srcElement.cellIndex == 1 ){
            window.open('../Item/Consulta.aspx?Ant=Pl&DETALHE=TRUE&ID_ITEM='+s.GetRowKey(e.visibleIndex),'_blank');
        }
    }"
    />
    <ClientSideEvents EndCallback="OnEndCallback" BeginCallback="OnBeginCallback"/>

    <SettingsCustomizationWindow Enabled="True" PopupVerticalAlign="Below" PopupHorizontalAlign="LeftSides" />

    <Styles>
        <AlternatingRow Enabled="True" CssClass="GridImpar">
        </AlternatingRow>
        <Header CssClass="GridHeader">
        </Header>
        <Row CssClass="GridPar">
        </Row>
    </Styles>
    <Columns>                    
        <dx:GridViewDataTextColumn Caption="FORN-COD" FieldName="CdFornecedor" ToolTip="Código do Fornecedor"
                        HeaderStyle-HorizontalAlign="Center" VisibleIndex="0" SortIndex="0" SortOrder="Ascending" >
                        <EditFormSettings Visible="False" />
                        <HeaderStyle HorizontalAlign="Left" ForeColor="White" Paddings-Padding="3" 
                            SortingImageSpacing="3">
                            <Paddings Padding="3px" />
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </HeaderStyle>
                        <CellStyle HorizontalAlign="Left">
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </CellStyle>
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn Caption="FORN-NOM" 
            FieldName="DsFornecedor" ToolTip="Nome do Fornecedor"
                        HeaderStyle-HorizontalAlign="Center" VisibleIndex="1" 
            Width="318px">
                        <EditFormSettings Visible="False" />
                        <HeaderStyle HorizontalAlign="Left" ForeColor="White" Paddings-Padding="3" 
                            SortingImageSpacing="3">
                            <Paddings Padding="3px" />
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </HeaderStyle>
                        <CellStyle HorizontalAlign="Left">
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </CellStyle>
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn Caption="FORN-IQF" FieldName="NrIqf"
                        ToolTip="IQF do fornecedor" HeaderStyle-HorizontalAlign="Center" VisibleIndex="2"
                        PropertiesTextEdit-DisplayFormatString="{0}%">
                        <PropertiesTextEdit DisplayFormatString="{0}%">
                        </PropertiesTextEdit>
                        <EditFormSettings Visible="False" />
                        <HeaderStyle HorizontalAlign="Right" ForeColor="White" Paddings-Padding="3" 
                            SortingImageSpacing="3">
                            <Paddings Padding="3px" />
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </HeaderStyle>
                        <CellStyle HorizontalAlign="Right">
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </CellStyle>
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn Caption="FORN-IQF Ajuste" FieldName="NrIqfAjuste" ToolTip="IQF de ajuste do fornecedor" HeaderStyle-HorizontalAlign="Center" 
                        VisibleIndex="3">
                        <PropertiesTextEdit DisplayFormatString="{0}%" MaskSettings-Mask="###" 
                            FocusedStyle-HorizontalAlign="Right" Style-HorizontalAlign="Right" >
                            <MaskSettings Mask="###" />
                            <FocusedStyle HorizontalAlign="Right">
                            </FocusedStyle>
                        </PropertiesTextEdit>
                        <EditFormSettings Visible="False" />
                        <HeaderStyle HorizontalAlign="Right" ForeColor="White" Paddings-Padding="3" 
                            SortingImageSpacing="3">
                            <Paddings Padding="3px" />
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </HeaderStyle>
                        <CellStyle HorizontalAlign="Right">
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </CellStyle>
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn Caption="FORN-DS" FieldName="DsConceitoFornecedor" ToolTip="Conceito do Fornecedor"
                        HeaderStyle-HorizontalAlign="Center" VisibleIndex="4">
                        <EditFormSettings Visible="False" />
                        <HeaderStyle HorizontalAlign="Right" ForeColor="White" Paddings-Padding="3" 
                            SortingImageSpacing="3">
                            <Paddings Padding="3px" />
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </HeaderStyle>
                        <CellStyle HorizontalAlign="Right">
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </CellStyle>
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn Caption="FORN-TAK" FieldName="NrTempoRespostaAceiteKanban" ToolTip="Tempo de resposta aceite do Kanban"
                        HeaderStyle-HorizontalAlign="Center" VisibleIndex="5" >
                        <PropertiesTextEdit DisplayFormatString="" MaskSettings-Mask="#.##" Style-HorizontalAlign="Right">
                            <MaskSettings Mask="#.##" />
                        </PropertiesTextEdit>
                        <HeaderStyle HorizontalAlign="Right" ForeColor="White" Paddings-Padding="3" 
                            SortingImageSpacing="3">
                            <Paddings Padding="3px" />
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </HeaderStyle>
                        <CellStyle HorizontalAlign="Right">
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </CellStyle>
                    </dx:GridViewDataTextColumn>
                    <dx:GridViewDataTextColumn Caption="FORN-TT" FieldName="NrTempoTransito" ToolTip="Tempo de trânsito"
                        HeaderStyle-HorizontalAlign="Center" VisibleIndex="5">
                        <PropertiesTextEdit DisplayFormatString="" MaskSettings-Mask="#.##"  Style-HorizontalAlign="Right">
                            <MaskSettings Mask="#.##" />
                        </PropertiesTextEdit>
                        <HeaderStyle HorizontalAlign="Right" ForeColor="White" Paddings-Padding="3" 
                            SortingImageSpacing="3">
                            <Paddings Padding="3px" />
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </HeaderStyle>
                        <CellStyle HorizontalAlign="Right">
                            <Border BorderStyle="None" BorderWidth="0px" />
                        </CellStyle>
                    </dx:GridViewDataTextColumn>

        <dx:GridViewCommandColumn  ButtonType="Image" Caption="Ação" VisibleIndex="15" Width="40px">

            <EditButton Visible="True" >
                <Image Url="~/Library/Images/Alterar.png" ToolTip="Alterar">
                </Image>
            </EditButton>
            <CancelButton Image-Url="~/Library/Images/Cancelar.png" Image-ToolTip="Cancelar">
                <Image ToolTip="Cancelar" Url="~/Library/Images/Cancelar.png">
                </Image>
            </CancelButton>
            <UpdateButton Image-Url="~/Library/Images/Salvar.png" Image-ToolTip="Salvar" >
                <Image ToolTip="Salvar" Url="~/Library/Images/Salvar.png">
                </Image>
            </UpdateButton>

            <HeaderStyle HorizontalAlign="Center" ForeColor="White" Paddings-Padding="3" SortingImageSpacing="3">
                <Paddings Padding="3px" />
                <Border BorderStyle="None" BorderWidth="0px" />
            </HeaderStyle>
            <CellStyle>
                <Border BorderStyle="None" BorderWidth="0px" />
            </CellStyle>
        </dx:GridViewCommandColumn>
    </Columns>
    <Border BorderStyle="None" BorderWidth="0px" />            
</dx:ASPxGridView>

有任何想法吗?

谢谢你。

4

2 回答 2

0

尝试在列上设置 EditCellStyle-Horizo​​ntalAlign 属性,如下所示:

<dx:GridViewDataTextColumn>
    <EditCellStyle HorizontalAlign="Left"/>
    ...
</dx:GridViewDataTextColumn>
于 2012-11-22T15:45:16.493 回答
0

您可以为所有列设置默认对齐方式,然后为您想要的每一列设置自定义样式:

<dx:ASPxGridView Styles-InlineEditCell-HorizontalAlign="Center">
     <dx:GridViewDataTextColumn EditCellStyle-HorizontalAlign="Right" />
<dx:ASPxGridView/>

或者,如果您想使用 BatchEdit 模式:

<dx:ASPxGridView Styles-BatchEditCell-HorizontalAlign="Center">
     <dx:GridViewDataTextColumn EditCellStyle-HorizontalAlign="Right" />
<dx:ASPxGridView/>

但请注意 DataCheckColumn 存在问题:

...复选框编辑器呈现在浏览和编辑模式下是不同的(在浏览模式下,它呈现为只读,在编辑 - 作为可点击)...

来源:T108471

于 2015-07-09T17:33:43.707 回答