Hi Dan,
1)How do I control the left location and width of the entire drop down control (as you see the right side of the grid is not showing).
>>>>
If you want to change the width of the DropDown in a GridDropDownl Cell, then you have to handle the CurrentCellShowingDropDown event, and set e.Size there. (Only the width is applicable in a GridListControl celltype, the height is determined by the DropDownRows parameter. Here is a code snippet to show this.
DropDownGridCellRenderer cr = gridDx.CurrentCell.Renderer as DropDownGridCellRenderer;
if (cr != null)
{
DropDownGridCellModel model = cr.StyleInfo.CellModel as DropDownGridCellModel;
if (model != null)
{
GridDataBoundGrid grid = model.EmbeddedGrid as GridDataBoundGrid;
if (grid != null)
{
int width = grid.Model.ColWidths.GetTotal(0, grid.Model.ColCount);
int hegiht = grid.Model.RowHeights.GetTotal(0, grid.Model.RowCount);
e.Size = new Size(width, hegiht);
}
}
}
2. How do I control the width of the columns in the drop down grid.
>>>
You can use the below code snippet to set the column width of the DropDown grid.
DropDownGridCellModel model = cr.StyleInfo.CellModel as DropDownGridCellModel;
if (model != null)
{
GridDataBoundGrid grid = model.EmbeddedGrid as GridDataBoundGrid;
if (grid != null)
{
grid.Model.ColWidths["Drug Name"] = 10;
}
}
3 & 5) Can the dropdown grid columns be sorted?
>>>>>
You can use the SortColumn method to sort the required column in a grid.
DropDownGridCellModel model = cr.StyleInfo.CellModel as DropDownGridCellModel;
if (model != null)
{
GridDataBoundGrid grid = model.EmbeddedGrid as GridDataBoundGrid;
if (grid != null)
{
grid.SortColumn(i);
}
}
4)Once the grid is dropped down, pressing the drop down button again closes it. Can I add a close button to the control?
>>>>>
You can create custom celltype, it requires a model class and a renderer class. The model class handles the serialization requirements for the control and creates the renderer class. The renderer class handles the UI requirements of the cell. This sample in \Syncfusion\Essential Studio\4.1.0.10\windows\Grid.Windows\Samples\In Depth\DerivedCellControlTutorial can be referred.
Please look at the sample for more detail
GridListEditSample.zipBest regards,
Haneef