Hi,
My grid has Item Template column with controls. This kind of requirement is on many pages. Some pages have label and textbox in template column. other pages have radio button list or dropdown list. What I am trying to do is write global code to iterate through template column controls and enable or disable them.
Something like this:
private void EnableTemplateContrils(GridTemplateColumn tmpCol)
{
bool status = false;
foreach (cell or control in tmpCol)
{
enableORDisableControl(control, status);
}
}
private void enableORDisableControl(System.Web.UI.Control pControl, bool pStatus)
{
string controlName = pControl.GetType().Name;
switch(controlName)
{
case "TextBox":
((WebControl)pControl).enabled = pStatus;
break;
case "CheckBox":
}
}
I appreciate your response. Please let me know how to loop thru controls in template column.
Thanks,
Prathiba
My grid has Item Template column with controls. This kind of requirement is on many pages. Some pages have label and textbox in template column. other pages have radio button list or dropdown list. What I am trying to do is write global code to iterate through template column controls and enable or disable them.
Something like this:
private void EnableTemplateContrils(GridTemplateColumn tmpCol)
{
bool status = false;
foreach (cell or control in tmpCol)
{
enableORDisableControl(control, status);
}
}
private void enableORDisableControl(System.Web.UI.Control pControl, bool pStatus)
{
string controlName = pControl.GetType().Name;
switch(controlName)
{
case "TextBox":
((WebControl)pControl).enabled = pStatus;
break;
case "CheckBox":
}
}
I appreciate your response. Please let me know how to loop thru controls in template column.
Thanks,
Prathiba