Hi to everyone
this is my problem
on a radform, I placed a radpageview control with 02 pages
inside this pages, I placed texboxes, group etc..
I also have a button somewhere inside the radform
How can I reset all the textboxes (xtextbox.text="") ?
My english is not so good
1) in the designer, select the control and clear it's Text Property. That should also work with multiple controls selected. You might need to select the different pages individually - that gives some more clicks.
2) open the designer codebehind file and work out a clever regular expression to replace .Text=".*" with .Text=""
3) in code: recursively iterate over the forms controls collection and reset the .Text properties of the controls you are interested in. When you get a RadPageView control you may need some more specific code to get to the different pages and their controls.
I'm sure other people will come up with even more ways.
answered on 07 Oct 2011, 05:08 PM
Thank you for writing.
As Erwin has posted, it depends on when you want to "reset" the text. If you are doing it in the designer, you can use the Visual Studio property grid and set the Text property of each RadTextBox. Or you can use the Find & Replace dialog of Visual Studio to replace the text with an empty string in the form .Designer.cs file. If you want to do it at runtime, you can iterate through the controls on each page of the RadPageView, check if the control is RadTextBox and then reset the text. Here is a code snippet which demonstrates this: