incorrect location of items inside dropdown part of combobox control in grid foreign key column

hi,

I have a grid (GridGroupingControl) with column where foreign key relation is configured for displaying lookup list in dropdown.
Additionally, in the grid there is sorting, grouping and filtering (excel-like) turned on.

At the begining, when the grid is displayed, it seems that dropdown works fine.
But when I sort columns a few times and then display dropdown list, then happens something like this:


... items in dropdown list are moved up and first element is hidden and covered by combo's edit part (1).
at the place of last element there is empty space (2).

how can I fix this ?
please help,

best regards,
Adam



7 Replies

MG Mohanraj Gunasekaran Syncfusion Team March 30, 2018 05:02 AM UTC

Hi Adam, 
 
Thanks for using Syncfusion product. 
 
We have tried to reproduce your scenario in your last downloaded Syncfusion product version 15.4.0.17. But, we are unable to reproduce your scenario. We suspect that this issue may occur based on your customization of drop down grid. So, please provide that customization, if you have any settings for dropdown grid.  
 
Also, here we have attached our tested sample. Please let us know, if it is differ from your customization. It will be helpful to provide the solution at the earliest. 
 
 
Regards, 
Mohanraj G 



AM amsm March 30, 2018 08:37 AM UTC

hi,
I attached source project where You can reproduce described scenario.
to do it, first of all, run application and in the left part of window, in group box called "Spektakle" select row in grid.
then, in the right part of window do the following:
click at column (marked 1), then click at dropdown (2):

at this moment items in dropdown are placed correctly.
Next, again click column (3) and dropdown (4):

and then You will see that items in dropdown are incorrectly moved up.
best regards,
Adam

Attachment: test_grid_cd2d6f51.zip


AR Arulpriya Ramalingam Syncfusion Team April 5, 2018 12:58 PM UTC

Hi Adam, 
 
Sorry for the delay in response. 
 
We have analyzed the provided sample at our end. By default, the DropDownContainer height will be measured based on the number of items and height of each item. In the provided sample, the RecordRowHeight for the table was set as 25 and the dropdown container size will be initialized based on the items count. However, while opening the DropDown, the row heights will be reset based on the ChildTableDescriptor default row height (default 22). So, that the reported issue occurred. In order to resolve the issue, we would suggest you, to set the RecordRowHeight for the related child table (i.e. PersonID in the provided sample). We have modified the sample as per your requirement and please refer to the below code and modified sample, 
 
Code example 
//To set record row height for the related child table. 
this.grdCast.GetTableDescriptor("PersonId").TableOptions.RecordRowHeight = 26; 
 
 
 
  
 
Regards, 
Arulpriya 



AM amsm April 6, 2018 08:04 AM UTC

hi,
thank You for the solution.

I didn't set intentionally the value of RecordRowHeight to 25, it was set automatically by Visual Studio designer, probably due to an earlier change of font size for grid's container.
The default value of RecordRowHeight for child grid in my case (as I can see in designer's property bag) is 30. But, the issue can't be fixed without explicitly specify this value. When I tried to set the value of RecordRowHeight to any lower than 30 then the issue still occurred. This minimum suitable value is affected also by the border settings for items in child grid.

best regards,
Adam


AR Arulpriya Ramalingam Syncfusion Team April 9, 2018 05:25 PM UTC

Hi Adam, 
 
Thanks for the update. 
 
As we updated earlier, the reported issue occurred due to resetting the default size of the drop down ListControlPart. So, we would suggest you to, reset the default size of the dropdown grid based on the record row height as per the default value after the drop down is shown. Please refer to the below code, 
 
Code example 
 
//Event triggering 
gridGroupingControl1.TableControlCurrentCellShowedDropDown += GridGroupingControl1_TableControlCurrentCellShowedDropDown; 
 
//Event triggering 
private void GridGroupingControl1_TableControlCurrentCellShowedDropDown(object sender, GridTableControlEventArgs e) 
{ 
    if (e.TableControl.CurrentCell.Renderer != null && e.TableControl.CurrentCell.Renderer is GridTableDropDownListCellRenderer) 
    { 
        GridTableDropDownListCellRenderer renderer = e.TableControl.CurrentCell.Renderer as GridTableDropDownListCellRenderer; 
        //To get the table descriptor name 
        string name = e.TableControl.TableDescriptor.Name; 
        int recordRowHeight = gridGroupingControl1.GetTableDescriptor(name).TableOptions.RecordRowHeight; 
        //To set the default size for the dropdown grid. 
        renderer.ListControlPart.Grid.Model.Rows.DefaultSize = recordRowHeight; 
      } 
} 
 
Regards, 
Arulpriya 



AM amsm April 9, 2018 09:53 PM UTC

hi,
thank You very much for help.
However, I think it shouldn't be necessary for user to do all this configuration, especially handling events, to make drop down list work. It seems to me it should be the responsibility of internal grid's logic.
There is another simple option to resolve the issue: set the border style of child grid's cell to "NotSet".
best regards,
Adam


AR Arulpriya Ramalingam Syncfusion Team April 10, 2018 12:55 PM UTC

Hi Adam, 
 
Thanks for the update. 
 
We have tested the reported scenario at our end and the reported issue can also be overcome by avoiding the BorderStyle of the dropdown grid. Moreover, we are glad that the reported scenario had been resolved by yourself. 
 
Please let us know, if you have any other queries. 
 
Regards, 
Arulpriya 


Loader.
Up arrow icon