Код: Выделить всё
В обработчике изменения индекса страницы у меня есть:
Код: Выделить всё
protected void wdtgMovimenti_PageIndexChanged(object sender, EventArgs e)
{
List ListValueSaved = .... List of Selected Key checkbox;
int startNum = (masterGrid.PageIndex ) * masterGrid.SettingsPager.PageSize;
int endNum = ((masterGrid.PageIndex ) * masterGrid.SettingsPager.PageSize) + masterGrid.SettingsPager.PageSize ;
for (int i = startNum; i < endNum; i++)
{
string rowKey = masterGrid.GetRowValues(i, "Key_POL").ToString();
int indiceRiga = masterGrid.FindVisibleIndexByKeyValue(rowKey);
ASPxGridView detailGrid = masterGrid.FindDetailRowTemplateControl(masterGrid.FindVisibleIndexByKeyValue(rowKey), "detailGrid") as ASPxGridView;
if (detailGrid != null)
{
string rowKey1 = detailGrid.GetRowValues(0, "Key_MOV").ToString();
string key = "$" + rowKey1 + "$" + rowKey + "$";
if (ListValueSaved.Where(x => x.Contains(key)).Count() > 0)
{
int detailRowIndex = detailGrid.FindVisibleIndexByKeyValue(rowKey1);
if (detailRowIndex >= 0)
{
detailGrid.Selection.SelectRow(detailRowIndex); // Programmatically select the checkbox
}
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... n-gridview