You must Sign In to post a response.
  • Category: .NET

    I have a problem c# - Winforms DataGridView UI does not update

    c# - Winforms DataGridView UI does not update using multi threding

    private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
    { PopulateXmlFiles(); }
    private void PopulateXmlFiles()
    string[] strArrFileArray = Directory.GetFiles(txtSource.Text, "*.xml");
    clsXmlFiles objXml = new clsXmlFiles();
    List<clsXmlFiles> ListXmlFiles = new List<clsXmlFiles>();
    var varFileName = "";

    foreach (string strXmlFile in strArrFileArray)
    FileInfo InfoXmlFile = new FileInfo(strXmlFile);
    varFileName = Path.GetFileName(InfoXmlFile.FullName);
    ListXmlFiles.Add(new clsXmlFiles() { XMLFileName = varFileName, Status = "Unprocessed" });
    grdXmlData.DataSource = ListXmlFiles.ToList();

    //Cross-thread operation
    //UI is not updated
  • #763492

    Your question is not clear, I request you to please update your question so that one of our experts will let you know shortly.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • Sign In to post your comments