Dear All,
I have a project that contains numerous radgrid, and need to rebind them all in timely manner. I'm just wonder will it be even possible to use a for loop to reduce the length of my code?
Some thing like this (just an idea, obviously the type conversion is incorrect):
//For RadGrid1, RadGrid2,... to RadGrid20, I have a click function using a button
protected void Refresh_Click(object sender, EventArgs e)
{
string raw_radgridname = "RadGrid";
string radgridname = "";
for (int i = 0; i<20; i++)
{
radgridname = "";
radgridname = raw_radgridname + Convert.ToString(i);
(radgridname as RadGrid).Rebind();
}
}
Many Thanks!
I have a project that contains numerous radgrid, and need to rebind them all in timely manner. I'm just wonder will it be even possible to use a for loop to reduce the length of my code?
Some thing like this (just an idea, obviously the type conversion is incorrect):
//For RadGrid1, RadGrid2,... to RadGrid20, I have a click function using a button
protected void Refresh_Click(object sender, EventArgs e)
{
string raw_radgridname = "RadGrid";
string radgridname = "";
for (int i = 0; i<20; i++)
{
radgridname = "";
radgridname = raw_radgridname + Convert.ToString(i);
(radgridname as RadGrid).Rebind();
}
}
Many Thanks!