Ticket T230765
Visible to All Users

ASPxDataView - Creating external search form with the ASPxTextBox and highlighting found items

created 10 years ago (modified 10 years ago)

Hi,

I follow the example in https://www.devexpress.com/Support/Center/Example/Details/E4538, but i found a problem in the sample code.

C#
protected void ASPxDataView1_CustomCallback(object sender, DevExpress.Web.ASPxClasses.CallbackEventArgsBase e) { List<DataRowView> selectResult = Products.Select(DataSourceSelectArguments.Empty).Cast<DataRowView>().ToList(); for(int i = 0; i < selectResult.Count; i++) { if(IsSuitableItem(selectResult[i])) { ASPxDataView1.PageIndex = i / ASPxDataView1.PageCount; return; } } }

It is using PageCount to the calculation, but i think it is wrong, it should use page size instead, but i can't find how to get page size, can you help me on this?

Answers approved by DevExpress Support

created 10 years ago (modified 10 years ago)

Hello,

I have reviewed the example, and it works as expected, so I'm not sure what you mean by incorrect calculation. Would you please describe incorrect behavior in greater detail? You can send us a screencast illustrating how to reproduce the issue.
Anyway, if you need to get the number of items on one page, you can use the SettingsTableLayout.ColumnCount and DataViewTableLayoutSettings.RowsPerPage properties. In the case of Flow Layout, use the DataViewFlowLayoutSettings.ItemsPerPage property.

    Comments (1)

      Hi Helen,
      Thanks for your help.
      The example work well because the page number and number of items per page is the same.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.