The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
I have a GDBG with several GLC''s and I''m resizing the columns in the GridCurrentCellShowingDropDownEvent and using the Following:
GridDataBoundGrid grid = (GridDataBoundGrid) sender;
GridCurrentCell cc = grid.CurrentCell;
if (cc.Renderer is GridDropDownGridListControlCellRenderer)
{
GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
cr.ListControlPart.Grid.ColWidths[colpos] = width;
}
The first time I click on the control, the sizes do not change, the second and subsequent clicks however; all work as expected.
Using 4.102.0.62.
Thanks
ADAdministrator Syncfusion Team April 24, 2006 04:24 AM UTC
Hi JMS,
I could see this issue. You can workaround this issue by handling the CellButtonClicked event which occurs just before the CurrentCellShowigDropDown is triggered. You can set the size of the column here. Here is the code snippet.
if( this.gridDataBoundGrid1.Model[e.RowIndex,e.ColIndex].CellType == "GridListControl")
{
this.gridDataBoundGrid1.CurrentCell.MoveTo(e.RowIndex,e.ColIndex);
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
if(cr != null)
{
cr.ListControlPart.Grid.ColWidths[1] = 500;
}
}
Here is a sample.
http://www.syncfusion.com/Support/user/uploads/ColumnHeader1_5d8260ce.zip
Please let me know if you need any further assistance.
Thanks for choosing Syncfusion Products.
Regards,
Haneef
ADAdministrator Syncfusion Team April 24, 2006 11:46 AM UTC
Thanks,
Works perfect.
>Hi JMS,
>
>I could see this issue. You can workaround this issue by handling the CellButtonClicked event which occurs just before the CurrentCellShowigDropDown is triggered. You can set the size of the column here. Here is the code snippet.
>
>if( this.gridDataBoundGrid1.Model[e.RowIndex,e.ColIndex].CellType == "GridListControl")
>{
> this.gridDataBoundGrid1.CurrentCell.MoveTo(e.RowIndex,e.ColIndex);
> GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
> GridDropDownGridListControlCellRenderer cr = cc.Renderer as GridDropDownGridListControlCellRenderer;
> if(cr != null)
> {
> cr.ListControlPart.Grid.ColWidths[1] = 500;
> }
>}
>
>Here is a sample.
>http://www.syncfusion.com/Support/user/uploads/ColumnHeader1_5d8260ce.zip
>
>Please let me know if you need any further assistance.
>
>Thanks for choosing Syncfusion Products.
>Regards,
>Haneef
>