Skip to content

Create a templated column, add content to the template, and use client-side GetCellTextContainer and GetControlsByPredicate methods to access and modify the template content in batch edit mode.

License

Notifications You must be signed in to change notification settings

DevExpress-Examples/asp-net-web-forms-grid-access-and-modify-template-controls-in-batch-mode

Repository files navigation

Grid View for ASP.NET Web Forms - How to access and modify a template control in batch edit mode

This example demonstrates how to create a templated column, add content to the template, and use client-side GetCellTextContainer and GetControlsByPredicate methods to access and modify the template content in batch edit mode.

Access and modify template control in batch mode

Overview

Specify a column's DataItemTemplate property and populate the template with content. To access the templated cell's container in batch edit mode, call the grid's client-side BatchEditApi.GetCellTextContainer method. To get any client objects within the specified container, call the client-side GetControlsByPredicate method.

function GetControl(visibleIndex, column) {
    return ASPx.GetControlCollection().GetControlsByPredicate(function (c) {
        var parent = grid.batchEditApi.GetCellTextContainer(visibleIndex, column);
        return ASPx.GetIsParent(parent, c.GetMainElement());
    })[0];
}

Files to Review

Documentation

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)

About

Create a templated column, add content to the template, and use client-side GetCellTextContainer and GetControlsByPredicate methods to access and modify the template content in batch edit mode.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •