aspnet-devexpress-dot-web-dot-aspxgridview-dot-getcurrentpagerowvalues-x28-system-dot-string-x29.md
Returns the row values displayed within the current page.
Namespace : DevExpress.Web
Assembly : DevExpress.Web.v25.2.dll
NuGet Package : DevExpress.Web
public List<object> GetCurrentPageRowValues(
params string[] fieldNames
)
Public Function GetCurrentPageRowValues(
ParamArray fieldNames As String()
) As List(Of Object)
| Name | Type | Description |
|---|---|---|
| fieldNames | String[] |
The names of data source fields whose values are returned.
|
| Type | Description |
|---|---|
| List<Object> |
The list of objects that contain row values displayed within the current page.
|
If you call the GetCurrentPageRowValues method while an unbound grid control builds its hierarchy (for example, within the HtmlRowCreated, CustomButtonInitialize or ContextMenuItemVisibility event handlers), the GetRowValues(Int32, String[]) method rebinds to data to reset the hierarchy. It might result in displaying the grid with empty data and losing values entered by an end user. To avoid this behavior, call the grid’s ASPxWebControl.DataBind method within the Page_Load event handler.
List <object> rowValues = sender.GetCurrentPageRowValues(new string[] { "CheckId", "Check" });
int startCk = 0;
if (rowValues.Count() > 0)
foreach (object[] selectedValues in rowValues)
startCk = (int)selectedValues[1];
// ...
See Also