A solution to finding controls in datagrid footer...

N

Nofear

Hi all,

I saw a lots of developers posting question on finding controls in
datagrid footer...
I have experimenting differents solution and find one that needn't
ItemDataBound ou ItemCommand :

Table tbl = (Table)dgWorkgroup.Controls[0];

foreach(TableRow row in tbl.Rows)
{
RequiredFieldValidator val =
(RequiredFieldValidator)row.FindControl("requireValidatorFooterName");
if(val != null)
{
val.Visible = true;
}
}

Casting dgWorkgroup.Controls[0] to Table allow you to scan in the Rows
collection of the table (header and footer included) so on a
particular row you can find your control(s)....


Hope helping you !

Nofear.
 
G

Guest

Thanks a bunch. It works great; clever too. Indeed, I had the same
problem--disabling the validation controls in the footer.

Isaac Citrom.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top