This is a migrated thread and some comments may be shown as answers.

RadGridView Not Refreshing/Updating with data in Release Mode

4 Answers 87 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Joe
Top achievements
Rank 1
Joe asked on 29 Aug 2012, 05:59 PM
Hello, 

In debug mode, the RadGridView within the application gets it's information from a SQLCE Database just fine. But once I set it to release mode, The itemsource does have items inside, but the RadGridView shows nothing.

public partial class MainWindow : Window
{
 
    public MainWindow()
    {
        InitializeComponent();
        //radGridView1.ItemsSource = getData();
        radGridView1.IsFilteringAllowed = true;
    }
 
    public DataTable getData()
    {
        // Creating a datatable to bind to the radgrid
        DataTable tableItem = new DataTable();
 
 
        //Readonly Fields, not for inlinje editing
        DataColumn code = new DataColumn("Code", typeof(string));
        code.ReadOnly = true;
        DataColumn product = new DataColumn("Product", typeof(string));
        product.ReadOnly = true;
 
 
        // Adding fields
        tableItem.Columns.Add(new DataColumn("Username", typeof(string)));
        tableItem.Columns.Add(product);
        tableItem.Columns.Add(new DataColumn("Company", typeof(string)));
        tableItem.Columns.Add(new DataColumn("Model", typeof(string)));
        tableItem.Columns.Add(new DataColumn("Serial", typeof(string)));
        tableItem.Columns.Add(new DataColumn("Status", typeof(string)));
        tableItem.Columns.Add(new DataColumn("Date", typeof(string)));
        tableItem.Columns.Add(code);
 
        // Connection string for the local Database, and grab all the data from it to store into the grid
        string conString = Properties.Settings.Default.ExternalInventoryDBConnectionString;
        string queryString = "Select * from externalInventory";
 
        using (SqlCeConnection con = new SqlCeConnection(conString))
        {
            try
            {
                con.Open();
                SqlCeCommand cmd = new SqlCeCommand(queryString, con);
                // create data adapter
 
                SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
                da.Fill(tableItem);
            }
            finally
            {
                con.Close();
            }
        }
        return tableItem;
    }
}

Thank you for reading my problem,
Joe Nguyen

4 Answers, 1 is accepted

Sort by
0
Attila
Top achievements
Rank 2
answered on 24 Mar 2017, 09:26 PM

Hi!

 

Same problem here. I set my RadGridView datasource to my custom list of objects from SQL. It can be seen in Debug mode, but in Release mode the gridview is empty although the list has items, so it's not empty list.

Thanks for helping

Attila

0
Dilyan Traykov
Telerik team
answered on 29 Mar 2017, 01:05 PM
Hello Attila,

Could you please share some more details on the exact setup at your end so that I can better assist you with this? More specifically:

1. What's the type of the collection you're passing in as RadGridView's ItemsSource and does it implement the INotifyCollectionChanged interface??
2. What's the type of the business object in your collection and do they implement the INotifyPropertyChanged interface?

Sending over some code snippets would definitely be of help.

Ideally, you can open a new support ticket and send over a sample project for me to investigate.

With all this information present, I will try to suggest a possible cause and a viable solution to your issue.

I'm looking forward to your reply.

Regards,
Dilyan Traykov
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Max
Top achievements
Rank 1
answered on 24 Jul 2020, 09:04 PM

I am having the same problem presented in this issue. I am passing a POCO as my RadGridView's ItemsSource. Something similar to this:

 

class Entry
{
    public string CaptureGUID { get; set; }
    public string MyObj { get; set; }

}

I have not implemented the  INotifyPropertyChanged interface. In Debug builds of my solution, I have no problems at all rendering items into theRadGridView. In Release builds, I can see that there ARE rows, they just all contain no data...

 

0
Dilyan Traykov
Telerik team
answered on 29 Jul 2020, 12:14 PM

Hello Max,

Would you find it possible to send over a small sample project which demonstrates your issue so that I can further investigate and assist you?

For the purpose, you can upload the project to a storage provider of your choice or open a new support ticket and attach it there.

Thank you in advance for your cooperation on the matter.

Regards,
Dilyan Traykov
Progress Telerik

Tags
GridView
Asked by
Joe
Top achievements
Rank 1
Answers by
Attila
Top achievements
Rank 2
Dilyan Traykov
Telerik team
Max
Top achievements
Rank 1
Share this question
or