none
I am using C# WPF help me?

    Pertanyaan

  • 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 


    Kamis, 26 Juli 2018 12.27

Semua Balasan

  • 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.

    Jumat, 27 Juli 2018 06.22
  • they didn't help why I ask here

    Sabtu, 28 Juli 2018 11.40
  • I can help you through a remote session, using whether team viewer or other tools, 

    Sabtu, 28 Juli 2018 11.45
  • 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


    Sabtu, 28 Juli 2018 13.44
  • 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)

    Sabtu, 28 Juli 2018 14.38
  • 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;
           }
        }


    Senin, 30 Juli 2018 05.43
  • 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;


    Senin, 30 Juli 2018 08.59