---
title: "Use loop to set property of all RadGrids in webform?"  
description: "Use loop to set property of all RadGrids in webform?"  
author: "Anonymous User"  
published: 2014-09-29  
updated: 2014-09-29  
canonical: https://www.mindstick.com/forum/2282/use-loop-to-set-property-of-all-radgrids-in-webform  
category: "c#"  
tags: ["c#"]  
reading_time: 1 minute  

---

# Use loop to set property of all RadGrids in webform?

I have several radgrids in my webform and I want to set all the visible [property](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) to false without having to specify the [control](https://www.mindstick.com/blog/197/asp-dot-net-repeater-control) name.

How can I do this with a loop?

Thanks.

## Replies

### Reply by Sumit Kesarwani

Hi Jeet, \
try this:

```
protected void Page_Load(object sender, EventArgs e){    for (int i = 0; i< form1.Controls.Count; i++)    {        if((form1.Controls[i]) is RadGrid)           
Response.Write(string.Format("found a grid with ID: {0}<br
/>", form1.Controls[i].ClientID));    }}
```


---

Original Source: https://www.mindstick.com/forum/2282/use-loop-to-set-property-of-all-radgrids-in-webform

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
