I have an ASPXGridview that includes a GridViewDataComboBoxColumn with two columns and an EnitityServerModeDataSource. See the source from the aspx and the aspx.cs.
ASPX:
<dx:GridViewDataComboBoxColumn FieldName="ServiceCode" VisibleIndex="3" >
<PropertiesComboBox IncrementalFilteringMode="Contains" DataSourceID="EntityServerModeDataSourceBillingService"
TextFormatString="{0}" ValueField="ServiceCode"
ValueType="System.String">
<ValidationSettings RequiredField-IsRequired="true" RequiredField-ErrorText="Service Code is required!">
</ValidationSettings>
<Columns>
<dx:ListBoxColumn FieldName="ServiceCode" Caption="Service" Width="120"/>
<dx:ListBoxColumn FieldName="Description" Width="400" />
</Columns>
</PropertiesComboBox>
</dx:GridViewDataComboBoxColumn>
<dx:EntityServerModeDataSource ID="EntityServerModeDataSourceBillingService" runat="server" />
ASPX.CS:
protected void Page_Init(object sender, EventArgs e)
{
...
EntityServerModeDataSourceBillingService.Selecting += EntityServerModeDataSourceBillingService_Selecting;
}
private void EntityServerModeDataSourceBillingService_Selecting(object sender, LinqServerModeDataSourceSelectEventArgs e)
{
var visibleFieldList = new HashSet<string>();
visibleFieldList.Add("ServiceCode");
visibleFieldList.Add("Description");
e.KeyExpression = nameof(BillingDAL.BillingService.ServiceCode);
var query = _billingServiceRepository.GetAll();
e.QueryableSource = query.Select(string.Format("new ({0})", visibleFieldList.ToSeparatedString()));
}
It works like a charm, including the filtering.
But while the DataSource contains 118 elements, only 100 are shown.
What am I overlooking?