How to get rows element of DevExpress.Web.ASPxGridView.ASPxGridView in foreach loop

asp.net-3.5devexpress

I am used Dev Express.Web.ASPxGridView.ASPxGridView control in my application ,
I want to hide the visibility of link button and anchor tag which in DataItemTemplate of ASPGridview.

I did this like as

protected void objGrid_DataBound(object sender, EventArgs e)
{

    foreach (GridViewRow dr in objGrid.Rows)
    {
        LinkButton objedit = (LinkButton)dr.FindControl("lnbEdit");
        objedit.Visible = false;
    }
}

but I get error becouse objGrid has no property or methos of rows.
so, how to use foreach for ASPxGridview of DevExpress control as databound event in asp.net 3.5 C#

Best Answer

You should use ASPxGridView.FindRowCellTemplateControl to access controls defined in DataCellTemplate.

Related Topic