none
I am using C# WPF help me? RRS feed

  • Question

  • I am using c# wpf and I want to clear all  string from devexpress textedit . Can you help me?

    for example 

    public static void EmptyTextBoxes(Control parent)
        {
         foreach (Control c in parent.Controls) {
           if (c.GetType() == typeof(TextBox))
           {
             ((TextBox)(c)).Text = string.Empty;
           }
        }

    and I want to the smiler code for Devexpress  textedit  or combobox check box radio button or list box for c# wpf 


    Thursday, July 26, 2018 12:27 PM

All replies

  • Hi ANIL,

    Your issue is related about devexpress, it is third-party control, you can ask your issue at devexpress forum for professional help.

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, July 27, 2018 6:22 AM
  • they didn't help why I ask here

    Saturday, July 28, 2018 11:40 AM
  • I can help you through a remote session, using whether team viewer or other tools, 

    Saturday, July 28, 2018 11:45 AM
  • In found code  about how to clean all values  from all textbox but I cannot find about devexpress textedit. Because I want to clean all values  programically from all textedit

    for example

    I have inside value inside  100 devexpress textedit and  I don't want to use  name.Text=String.Empty; or name.Text=""; for all 100  devpress textedit  for clean all values okay. I don't want to waste my time...

    for example 

    public static void EmptyTextBoxes(Control parent)
        {
         foreach (Control c in parent.Controls) {
           if (c.GetType() == typeof(TextBox))
           {
             ((TextBox)(c)).Text = string.Empty;
           }
        }

    and I want to the smiler code for Devexpress  texedit for c# wpf


    Saturday, July 28, 2018 1:44 PM
  • are your controls bound to the ViewModel, if so all you have to do is to assign new instance to your ViewModel, and all bound controls would take their default values, otherwise the same technique qil qork for DevExpress controls just evaluate type of your control based on typepof(YourDevExpressControl)

    Saturday, July 28, 2018 2:38 PM
  • I cannot use it for wpf because It gives  error about Controls word I don't know It doesn't work even for textbox

    parent.Controls doesn' work. I am using C# WPF

    public static void EmptyTextBoxes(Control parent)
        {
         foreach (Control c in parent.Controls) {
           if (c.GetType() == typeof(TextBox))
           {
             ((TextBox)(c)).Text = string.Empty;
           }
        }


    Monday, July 30, 2018 5:43 AM
  • hello, I found an article about this with a beautiful UIHelper that i'll use in future :

    https://social.msdn.microsoft.com/Forums/vstudio/en-US/042c9310-a551-409b-8778-cb4c2c36443f/wpf-control-collection?forum=wpf

    and here is the UIHelper.cs class :

    http://www.hardcodet.net/uploads/2009/06/UIHelper.cs


    good coding;


    Monday, July 30, 2018 8:59 AM