我有一个DevExpress网格视图控件(ASP.Net),我的一个列是GridViewDataComboBoxColumn。下拉列表的数据源在后面的代码中设置,并且没有问题。我似乎唯一的问题是当你点击下拉列表时,组合框与值之间有很大的距离。
知道我在这里做错了吗?
<dx:ASPxGridView ID="Grid" runat="server" KeyFieldName="CompetencyEmployeeLevelLinkId" EnableRowsCache="False" ClientInstanceName="grid" Width="100%" OnCellEditorInitialize="EditingCell"
OnCustomJSProperties="Grid_CustomJSProperties" OnBatchUpdate="OnBatchUpdate" OnRowUpdating="OnRowUpdate" AutoGenerateColumns="False" EnableTheming="True" Theme="PlasticBlue">
<SettingsEditing Mode="Batch">
<BatchEditSettings EditMode="Cell" StartEditAction="Click"></BatchEditSettings>
</SettingsEditing>
<SettingsBehavior ColumnResizeMode="Control"></SettingsBehavior>
<ClientSideEvents BatchEditStartEditing="OnBatchStartEdit" />
<Columns>
<dx:GridViewDataColumn FieldName="Competency">
<EditFormSettings Visible="False" />
</dx:GridViewDataColumn>
<dx:GridViewDataColumn FieldName="PreviousAScore" Caption="Previous A Score">
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle"></CellStyle>
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
<EditFormSettings Visible="False" />
</dx:GridViewDataColumn>
<dx:GridViewDataColumn FieldName="PreviousBScore" Caption="Previous B Score">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle"></CellStyle>
<EditFormSettings Visible="False" />
</dx:GridViewDataColumn>
<dx:GridViewDataComboBoxColumn FieldName="MentorA" Caption="Mentor's A Score">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle"></CellStyle>
</dx:GridViewDataComboBoxColumn>
<dx:GridViewDataComboBoxColumn FieldName="MentorB" Caption="Mentor's B Score">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle"></CellStyle>
<PropertiesComboBox />
</dx:GridViewDataComboBoxColumn>
<dx:GridViewDataColumn FieldName="Description" Caption="Development Plan">
<EditFormSettings Visible="False" />
</dx:GridViewDataColumn>
<dx:GridViewDataColumn FieldName="RequiredScore" Caption="Required Score">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle"></CellStyle>
<EditFormSettings Visible="False" />
</dx:GridViewDataColumn>
<dx:GridViewDataColumn FieldName="Achieved" Caption="Achieved">
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle"></HeaderStyle>
<CellStyle HorizontalAlign="Center" VerticalAlign="Middle"></CellStyle>
<EditFormSettings Visible="False" />
</dx:GridViewDataColumn>
</Columns>
<SettingsEditing Mode="Batch" />
<Settings VerticalScrollableHeight="400" VerticalScrollBarMode="Visible" VerticalScrollBarStyle="Virtual" />
<SettingsPager>
<PageSizeItemSettings Visible="False" />
</SettingsPager>
</dx:ASPxGridView>
答案 0 :(得分:0)
问题在于我在父容器中使用的CSS类。有问题的元素是“Display:inline”属性:
#container
{ 显示:内联; padding-left:50px; padding-right:80px; }
删除它解决了这个问题。不确定我理解为什么这是问题,但至少问题已经解决了。希望这有时可以帮助别人。