We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Databound Grid Cell Painting Order

While finishing up our evaluation of the Essential Suite, I have run into an issue with painting of cells in the GridDataboundGrid control. We have a project with an unusual request from our users to display multiple "child" values in a single cell for a parent record in the grid. The User interface was designed to use a DropDownList to allow the users to view the child records. The DataSet returned contains two tables with the parent records in one table, and all the child records in the other. I have set this up by adding a ComboBox column style to store the child records, then use the CurrentCellShowingDropdown event to filter the child table based on the key in the selected row. this works fine for the relationships needed. However, we also need to display the first value in the cell when the drop down has not been selected. (Note this value is not a part of the parent table) To do this, I have tried the PrepareViewStyleInfo and DrawCell event handlers to set the Text property of the cell based on the child table value related to the current row being rendered. That said, all appears to be working according to plan with one exception. When the grid is initially painted on the screen, the Text values do not show up. After resizing or scrolling the grid (forcing a repaint) the Text values are displayed. Is there another event I can use to set the Text properties so they will be there upon initial painting, or is there a method I can call to force a repaint operation once the grid is loaded? (I have tried the Refresh method already.) Or is this a bug that has been discovered and will be addressed soon? Any help would be appreciated.

1 Reply

AD Administrator Syncfusion Team April 17, 2003 02:52 PM UTC

If it is all values that are missing, you might check your initial code for a call to grid.BeginUpdate that does not have a matching grid.EndUpdate call. Or, maybe some expception is being thrown that makes the EndUpdate not be hit. You might set the Debug|Exceptions menu iten to break into the Debugger on Common Language Runtime Exceptions to see if there is an exception being thrown during the initialization. Another thing you can try is to make sure the grid is active by set the form.ActiveControl = grid to see if that affects this problem. You can also add some debug output to where you are trying to set these values to make sure the values you are trying to set are available at that point. If you don't spot something, can you create a Direct Trac support incident and attach a sample showing the problem? That would be the quickest way to get to the bottom of the problem.

Loader.
Live Chat Icon For mobile
Up arrow icon