Databinding with a GridView

Here’s how to call a codebehind function for the rows of a GridView. No rocket science, but useful for reference…

ASPX:
< %# GetStatusImage(Container) %>

Code behind:
protected string GetStatusImage(IDataItemContainer row)
{
}

or

ASPX:
< %# GetStatusImage(Container as GridViewRow) %>

Code behind:
protected string GetStatusImage(GridViewRow row{
}

/Emil

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.