Home Forums WinForms controls Xceed Grid for WinForms Setting .DataSource, but .Columns.Count = 0 Reply To: Setting .DataSource, but .Columns.Count = 0

User (Old forums)
Member
Post count: 23064

I’ve had this problem too, but I figured it out. The actual databinding happens when the GridControl itself needs the data for the first time (when painting). To force the databinding to happen immediately, do this: <pre>grid.DataSource = view;
if (grid.BindingContext == null) grid.BindingContext = new BindingContext();</pre>

Imported from legacy forums. Posted by Tommy (had 198 views)