KB Article A509
Visible to All Users

How to force the Grid to refresh the values displayed in a LookUp column after loading data

Description:
My grid has a lookup column. I load data into the grid's and lookup's data tables inside the Form.Load event handler. But when the grid is displayed the lookup column's cells are all empty. Values are displayed when I click on a row. Why are the values not being automatically displayed?

Answer:
The cause of the problem is that lookup data is populated after the grid's data source. Earlier versions had an extra call of the LayoutChanged method, which made loading of the grid slower. However, there was no problem with the lookup editor. Now you should explicitly call the GridView.LayoutChanged method after populating a lookup dataset as shown below.

C#
oleDbDataAdapter1.Fill(dataSet11, "Orders"); oleDbDataAdapter2.Fill(dataSet11, "Customers"); gridControl.MainView.LayoutChanged(); // NEW LINE

See Also:
Text disappears from a LookUp editor after focusing another grid column

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.