tags:

views:

15

answers:

2

Following code works in debug mode, but in release mode there are only blank rows shown, with only an icon per file. The file list is correct, since in another mainmenu item the files show correctly ??

    private void FillFileLinks()
    {
        dataGridView1.AutoGenerateColumns = false;
        string[] files = GetFileList();
        var filenamesList = new BindingList<StringValue>();

        foreach (string file in files)
        {
            if (String.IsNullOrEmpty( file.Trim() ))
                continue;

            filenamesList.Add(new StringValue( file ));
        }

        dataGridView1.DataSource = filenamesList;// myDatasource; 

    }



// Example file list: E:\Temp\File01.txt;C:\Desktop\File2.txt;
A: 

did u forget to

dataGridView1.DataBind();

888
This is winforms, there is no DataBind() method ... also, it is already working in debug mode ...
Run CMD
A: 

Well, using a DataTable instead of a BindingList solved the problem. I have no idea whatsoever causes this behavior ... If anyone knows I'll change the accepted answer ..

Run CMD