Back to Devexpress

ASPxGridView.GetCurrentPageRowValues(String[]) Method

aspnet-devexpress-dot-web-dot-aspxgridview-dot-getcurrentpagerowvalues-x28-system-dot-string-x29.md

latest2.8 KB
Original Source

ASPxGridView.GetCurrentPageRowValues(String[]) Method

Returns the row values displayed within the current page.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public List<object> GetCurrentPageRowValues(
    params string[] fieldNames
)
vb
Public Function GetCurrentPageRowValues(
    ParamArray fieldNames As String()
) As List(Of Object)

Parameters

NameTypeDescription
fieldNamesString[]

The names of data source fields whose values are returned.

|

Returns

TypeDescription
List<Object>

The list of objects that contain row values displayed within the current page.

|

Remarks

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.

csharp
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

GetRowValues(Int32, String[])

GetSelectedFieldValues(String[])

Grid View

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace