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

Multiline text

Hi, I have a text box column (in a child grid) that I want to set to a certain width and have the data wrap to the next line if necessary. I''ve tried setting the wraptext property and the colwidth prop but can''t see any effect. Is there an example of how to do this?

31 Replies

AD Administrator Syncfusion Team February 9, 2004 09:51 PM UTC

WrapText is true by default in a GriddataBoundGrid. If you use the mouse and make the row heights larger, you should be able to see the text. If you want to programatically size the rows so you can see the text, you will have to call grid.Mode.RowHeights.ResizeToFit passing it a range of cells to be resized. If you want the cell height to increase as your user types into the cell, you should set style.AutoSize = true for that column.


AD Administrator Syncfusion Team February 9, 2004 10:39 PM UTC

Thanks Clay, That works, but how do I have the grid height increase to the size of the row height? Now I have to pull down on the grid to see the entire cell that I just enlarged. Thanks, CB >WrapText is true by default in a GriddataBoundGrid. If you use the mouse and make the row heights larger, you should be able to see the text. > >If you want to programatically size the rows so you can see the text, you will have to call grid.Mode.RowHeights.ResizeToFit passing it a range of cells to be resized. > >If you want the cell height to increase as your user types into the cell, you should set style.AutoSize = true for that column.


AD Administrator Syncfusion Team February 10, 2004 07:47 AM UTC

If you want to change the height or the width of the grid, you will have to set the grid.Size property. Additionally, the grid cannot be docked or anchored in some manner that prevents the changes to its size from taking effect. If you have docked or anchored the grid in such a manner, then you would have to adjust the size of the grid''s parent control to get the ''new size to take'' provided the parent has not been anchored or docked in such a manner as to prevent it for being sized by setting its Size property.


AD Administrator Syncfusion Team February 10, 2004 10:08 PM UTC

Thanks for the info. The problem I''m having is that the child grid is not showing all of the rows when it is dropped down - now that I have set the RowHeights.ResizeToFit option (the rows got taller). I need for the entire list of records to show or to be able to set a number of them to show, right now it is dropping down and showing the first entire record and only half of the next record. I would like to get rid of the vertical scrollbar if possible. Do you have an example that shows how to do this? I don''t believe there is any docking or anchoring issue that is interferring. Thanks again >If you want to change the height or the width of the grid, you will have to set the grid.Size property. Additionally, the grid cannot be docked or anchored in some manner that prevents the changes to its size from taking effect. If you have docked or anchored the grid in such a manner, then you would have to adjust the size of the grid''s parent control to get the ''new size to take'' provided the parent has not been anchored or docked in such a manner as to prevent it for being sized by setting its Size property.


AD Administrator Syncfusion Team February 10, 2004 10:14 PM UTC

Hi, With regards to docking causing problems sizing the child grid I found this code in dropdowngridcellrenderer: Protected Overloads Overrides Function CreateInnerControl(ByRef grid As GridControlBase) As Control grid = Me.dbgrid grid.Dock = DockStyle.Fill Return grid End Function Could this be causing a problem sizing the grid? >If you want to change the height or the width of the grid, you will have to set the grid.Size property. Additionally, the grid cannot be docked or anchored in some manner that prevents the changes to its size from taking effect. If you have docked or anchored the grid in such a manner, then you would have to adjust the size of the grid''s parent control to get the ''new size to take'' provided the parent has not been anchored or docked in such a manner as to prevent it for being sized by setting its Size property.


AD Administrator Syncfusion Team February 10, 2004 10:31 PM UTC

So you are trying to set the size of a dropdown grid in a cell of another grid like the dropdown grid in the Syncfusion\Essential Suite\Grid\Samples\In Depth\DropdownGrid sample. If so, you need to change the size of the parent popup window because of the DockFill setting. To set the size of such parent popup, you handle the CurrentCellShowingDropDown, and set the e.Size parameter.
private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
	e.Size = new Size(e.Size.Width, 500);
}


AD Administrator Syncfusion Team February 10, 2004 10:54 PM UTC

Here is code that will fully show the dropped grid without scrollbars.
private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(cc.RowIndex == 2 && cc.ColIndex == 1)
	{
		this.GridA.HScrollBehavior = GridScrollbarMode.Disabled;
		this.GridA.VScrollBehavior = GridScrollbarMode.Disabled;
		int width = this.GridA.ColWidths.GetTotal(0, this.GridA.ColCount) + 16;
		int height = this.GridA.RowHeights.GetTotal(0, this.GridA.RowCount) + 16;
		e.Size = new Size(width, height);
	}
}


AD Administrator Syncfusion Team February 11, 2004 03:23 PM UTC

Hi, That last code worked great for showing all of the rows in the grid. However, I also need the row heights to resize to show all the text and I would like to resize every time the child grid drops down because different rows need to be different heights depending on the amount of text in certain columns: 1. All of the rows of the grid show when dropped down (using the last bit of code you posted) 2. The rows are resized to fit the text (the text wraps) in each column I''ve added the code: Me.elementGrid2.Model.ColWidths(6) = 200 Me.elementGrid2.Model.RowHeights.ResizeToFit(GridRangeInfo.Col(6)) But when this runs the rows again don''t all show because they are taller after this runs. How and where can I implement both of these size changes so that they both take effect? THanks again >Here is code that will fully show the dropped grid without scrollbars. >
>private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
>{
>	GridCurrentCell cc = this.gridControl1.CurrentCell;
>	if(cc.RowIndex == 2 && cc.ColIndex == 1)
>	{
>		this.GridA.HScrollBehavior = GridScrollbarMode.Disabled;
>		this.GridA.VScrollBehavior = GridScrollbarMode.Disabled;
>		int width = this.GridA.ColWidths.GetTotal(0, this.GridA.ColCount) + 16;
>		int height = this.GridA.RowHeights.GetTotal(0, this.GridA.RowCount) + 16;
>		e.Size = new Size(width, height);
>	}
>}
>


AD Administrator Syncfusion Team February 11, 2004 04:44 PM UTC

Try putting Me.elementGrid2.Model.ColWidths(6) = 200 Me.elementGrid2.Model.RowHeights.ResizeToFit(GridRangeInfo.Col(6)) in CurrentCellShowingDropDown before the calls that use the RowHeights.GetTotal.


AD Administrator Syncfusion Team February 11, 2004 06:25 PM UTC

Hi Clay, Can all of the sizing code be placed in the DropDownContainerShowingDropDown event in the dropdowngridcellrenderer class or does some of it need to go in the event CurrentCellShowingDropDown for the parent grid? I am seeing code for sizing in both of these and this may be causing the problem (and obviously much confusion on my part). Thanks CB >Try putting > >Me.elementGrid2.Model.ColWidths(6) = 200 >Me.elementGrid2.Model.RowHeights.ResizeToFit(GridRangeInfo.Col(6)) > >in CurrentCellShowingDropDown before the calls that use the RowHeights.GetTotal.


AD Administrator Syncfusion Team February 11, 2004 07:34 PM UTC

In the sample I am running, I am only using CurrentCellShowingDropDown (the code shown above).


AD Administrator Syncfusion Team February 11, 2004 07:57 PM UTC

I''ve tried to narrow down the problem and it looks like the resizetofit only takes place the second time I click on a row. The first time the grid drops down the rows are their normal size with now text wrapping, the second time I drop down the grid the resize takes place. Any ideas on why this may be happening? >In the sample I am running, I am only using CurrentCellShowingDropDown (the code shown above).


AD Administrator Syncfusion Team February 11, 2004 08:11 PM UTC

Hi Clay, Can I send you my project and maybe you can take a look at it? I''m really stuck on this sizing problem and I''m sure you could figure it out quickly. Thanks, CB >I''ve tried to narrow down the problem and it looks like the resizetofit only takes place the second time I click on a row. The first time the grid drops down the rows are their normal size with now text wrapping, the second time I drop down the grid the resize takes place. Any ideas on why this may be happening? > >>In the sample I am running, I am only using CurrentCellShowingDropDown (the code shown above).


AD Administrator Syncfusion Team February 11, 2004 09:54 PM UTC

The resizing not working on the first drop is a bug in the 2.0 beta code. Is this what you are using? If you want to send a sample project, you can attach it here or submit it through a Direct Trac support incident.


AD Administrator Syncfusion Team February 11, 2004 11:03 PM UTC

Hi Clay, I''ve attached the project. It''s called Niamy_ice. To run the project click ''open'' from the file menu and browse to the location of the file ''test_ice.xml'' which I included in the zip file I''m attaching. To reproduce the problem 1. click on the second drop down child grid. Notice that the rows are not resized to accomadate all of the text in the field ''meaning'' (they are not tall enough). 2. Staying on the same parent record, close the chld grid and drop down a second time and the grid is correctly resized. 3. Close the child grid and go to the third row in the parent grid. Click the second drop down again and notice that the rows are still sized to accomadate the text in the previous row that was dropped down (now they are too tall). 4. Staying on the same parent record, close the chld grid and drop down a second time and the grid is now correctly resized. I really appreciate your help. I have no idea why this is happening and I am out of time for getting it finished. CB >The resizing not working on the first drop is a bug in the 2.0 beta code. Is this what you are using? > >If you want to send a sample project, you can attach it here or submit it through a Direct Trac support incident. Build21104_3453.zip


AD Administrator Syncfusion Team February 12, 2004 07:06 AM UTC

I looked at your code for a few minutes and see some problems, but to work with it and get it running would be more in the line of consulting than support. The things that appear to be problems include 1) it looks like you are trying to set the contesnt of the dropped grids in CurrentCellShowedDropDown. But the size of teh dropdown has to be set in CurrentCellShowingDropDown. This would be a problem as the contents are not known until after you have set the size. Another thing that confuses me is the in your CurrentCellShowedDropDown code (in the ''If (cc.ColIndex = 1) Then'' code), you are working with the datasource Me.correctionGrid3.DataSource. How does this affect the Me.elementGrid2 which is teh only thing you work with in CurrentCellShowedDropDown. Some other points, since you are dropping a GridDataBoundGrid, you might want to set Me.elementGrid2.AllowResizeToFit = flase to turn off the default sizing that might interfere with your explicit sizing. If you want to resize headers, you need to include the second argument when you call ResizeToFit. When I run your code, the first dropdown never has any rows. Is this what you expect?


AD Administrator Syncfusion Team February 12, 2004 01:42 PM UTC

Hi Clay, Thanks for the feedback. It looks like I need to set the grid contents and then size the grids - maybe that will solve the problem. I actually am setting a row filter for both columns in currentcellshoweddropdown, but maybe I should do this in currentcellshowingdropdown instead. The first dropdown is not supposed to have any records yet. I''ll try the rest of your suggestion - Thanks! CB >I looked at your code for a few minutes and see some problems, but to work with it and get it running would be more in the line of consulting than support. > >The things that appear to be problems include 1) it looks like you are trying to set the contesnt of the dropped grids in CurrentCellShowedDropDown. But the size of teh dropdown has to be set in CurrentCellShowingDropDown. This would be a problem as the contents are not known until after you have set the size. > >Another thing that confuses me is the in your CurrentCellShowedDropDown code (in the ''If (cc.ColIndex = 1) Then'' code), you are working with the datasource Me.correctionGrid3.DataSource. How does this affect the Me.elementGrid2 which is teh only thing you work with in CurrentCellShowedDropDown. > >Some other points, since you are dropping a GridDataBoundGrid, you might want to set Me.elementGrid2.AllowResizeToFit = flase to turn off the default sizing that might interfere with your explicit sizing. > >If you want to resize headers, you need to include the second argument when you call ResizeToFit. > >When I run your code, the first dropdown never has any rows. Is this what you expect? > > > >


AD Administrator Syncfusion Team February 12, 2004 05:47 PM UTC

Clay, I corrected some of the problems and the resize seems to work now. I have a question about autosize. I have set a column in the parent (gridheirboundgrid) autosize = true, but when I type in the column it does not expand in height as it should. Is there some other property to set or unset to make this happen? Thanks, CB >I looked at your code for a few minutes and see some problems, but to work with it and get it running would be more in the line of consulting than support. > >The things that appear to be problems include 1) it looks like you are trying to set the contesnt of the dropped grids in CurrentCellShowedDropDown. But the size of teh dropdown has to be set in CurrentCellShowingDropDown. This would be a problem as the contents are not known until after you have set the size. > >Another thing that confuses me is the in your CurrentCellShowedDropDown code (in the ''If (cc.ColIndex = 1) Then'' code), you are working with the datasource Me.correctionGrid3.DataSource. How does this affect the Me.elementGrid2 which is teh only thing you work with in CurrentCellShowedDropDown. > >Some other points, since you are dropping a GridDataBoundGrid, you might want to set Me.elementGrid2.AllowResizeToFit = flase to turn off the default sizing that might interfere with your explicit sizing. > >If you want to resize headers, you need to include the second argument when you call ResizeToFit. > >When I run your code, the first dropdown never has any rows. Is this what you expect? > > > >


AD Administrator Syncfusion Team February 12, 2004 05:57 PM UTC

Are you handling the QueryRowHieght event for some reason? If so , this may prevent explicitly to happening. Also, the style.WrapText needs to be true to make the text wrap.


AD Administrator Syncfusion Team February 12, 2004 06:05 PM UTC

Thanks, I''ll check into that. When a rowheight is resized I notice that it sometimes splits a word onto the next line. Is there some way to move the whole word to the next line if it doesn''t fit rather than have it split up like that? Thanks CB >Are you handling the QueryRowHieght event for some reason? If so , this may prevent explicitly to happening. > >Also, the style.WrapText needs to be true to make the text wrap.


AD Administrator Syncfusion Team February 12, 2004 07:13 PM UTC

Hi Clay, I checked and the wraptext, and autosize for this columns are both set to true. When I enlarge the row I can see that the text is wrapped, but the row doesn''t grow as the user is typing the text for this column. Any other ideas? Thanks > >Thanks, I''ll check into that. When a rowheight is resized I notice that it sometimes splits a word onto the next line. Is there some way to move the whole word to the next line if it doesn''t fit rather than have it split up like that? > >Thanks CB > >>Are you handling the QueryRowHieght event for some reason? If so , this may prevent explicitly to happening. >> >>Also, the style.WrapText needs to be true to make the text wrap.


AD Administrator Syncfusion Team February 12, 2004 08:49 PM UTC

There was an early version (say 1.5 ???) where this was broken, but it has been fixed for a while. Here is simple sample that seems to work for me. Can you modify it to show the problem you are having? WindowsApplication10_6696.zip


AD Administrator Syncfusion Team February 13, 2004 03:43 AM UTC

I cannot find any significant differences between that code and my own here is mine: Me.phraseGrid1.ThemesEnabled = True Me.phraseGrid1.Location = New Point(20, 20) Me.phraseGrid1.Size = New Size((Me.ClientSize.Width - 40), (Me.ClientSize.Height - 40)) Me.phraseGrid1.Anchor = (((AnchorStyles.Bottom Or AnchorStyles.Left) _ Or AnchorStyles.Right) _ Or AnchorStyles.Top) Me.phraseGrid1.BorderStyle = BorderStyle.Fixed3D Me.phraseGrid1.BaseStylesMap("Header").StyleInfo.BackColor = Color.FromKnownColor(KnownColor.ActiveCaption) Me.phraseGrid1.BaseStylesMap("Header").StyleInfo.TextColor = Color.FromKnownColor(KnownColor.ActiveCaptionText) Me.phraseGrid1.TableStyle.BackColor = Color.White Me.phraseGrid1.Model.HideCols("Created") = True Me.phraseGrid1.Model.HideCols("Updated") = True Me.phraseGrid1.Model.HideCols("Phrase_Id") = True Me.phraseGrid1.Model.HideCols("Block_Id") = True Me.phraseGrid1.Model.HideCols("Created_By") = True Me.phraseGrid1.Model.HideCols("Updated_By") = True Me.phraseGrid1.EnableAddNew = False Me.Controls.Add(Me.phraseGrid1) Me.phraseGrid1.GridBoundColumns("Source").StyleInfo.ReadOnly = True Me.phraseGrid1.GridBoundColumns("Hints").StyleInfo.ReadOnly = True Me.phraseGrid1.GridBoundColumns("Target").StyleInfo.AutoSize = True Me.phraseGrid1.GridBoundColumns("Target").StyleInfo.WrapText = True Me.phraseGrid1.Model.ColWidths(1) = 18 Me.phraseGrid1.Model.ColWidths(2) = 18 Me.phraseGrid1.Model.ColWidths(3) = 200 '' default target width Me.phraseGrid1.Model.ColWidths(4) = 200 Me.phraseGrid1.Model.ColWidths(5) = 200 phraseGrid1.CurrentCell.Deactivate(True) Me.phraseGrid1.CurrentCell.Activate(1, 2, GridSetCurrentCellOptions.SetFocus) Can you see any glaring problems? >There was an early version (say 1.5 ???) where this was broken, but it has been fixed for a while. > >Here is simple sample that seems to work for me. Can you modify it to show the problem you are having? > >WindowsApplication10_6696.zip > >


AD Administrator Syncfusion Team February 13, 2004 06:07 AM UTC

No I don''t. The only way I would know to track this problem is to use the Assembly Manager (Start Menu|Syncfusion) to create a debug build of our libraries. The autosize should be triggerred in the TextBoxChanged method found in the GridTextBoxCellRenderer.cs class. When the cell should AutoSize, place a stop at the top of this method to see if this is hit. If it is, step through the code to see what is preventing the autosize. There is also one other place the sizing may get triggerred in GridTextBoxControl.cs. It is in OnContentsResized. (Search for AutoSize). You can place a stop there as well and step through that code to see what might be failing. To build debug libraries, you must have source code. If you cannot spot something, submit a Direct Trac support incident with a sample showing the problem, and we can try to look at it here.


AD Administrator Syncfusion Team February 13, 2004 01:33 PM UTC

Hi Clay, Thanks for all of your help on this. Does the problem have anything to do with the column being in a gridheirdatabound grid with child grids? I will try the techniques you mentioned and see if that works. Thanks, Amanda >No I don''t. > >The only way I would know to track this problem is to use the Assembly Manager (Start Menu|Syncfusion) to create a debug build of our libraries. The autosize should be triggerred in the TextBoxChanged method found in the GridTextBoxCellRenderer.cs class. When the cell should AutoSize, place a stop at the top of this method to see if this is hit. If it is, step through the code to see what is preventing the autosize. > >There is also one other place the sizing may get triggerred in GridTextBoxControl.cs. It is in OnContentsResized. (Search for AutoSize). You can place a stop there as well and step through that code to see what might be failing. > >To build debug libraries, you must have source code. > >If you cannot spot something, submit a Direct Trac support incident with a sample showing the problem, and we can try to look at it here.


AD Administrator Syncfusion Team February 13, 2004 01:51 PM UTC

Hi Clay, Can you provide me with more instructions on how to build a build debug with the assembly manager? Thanks CB >No I don''t. > >The only way I would know to track this problem is to use the Assembly Manager (Start Menu|Syncfusion) to create a debug build of our libraries. The autosize should be triggerred in the TextBoxChanged method found in the GridTextBoxCellRenderer.cs class. When the cell should AutoSize, place a stop at the top of this method to see if this is hit. If it is, step through the code to see what is preventing the autosize. > >There is also one other place the sizing may get triggerred in GridTextBoxControl.cs. It is in OnContentsResized. (Search for AutoSize). You can place a stop there as well and step through that code to see what might be failing. > >To build debug libraries, you must have source code. > >If you cannot spot something, submit a Direct Trac support incident with a sample showing the problem, and we can try to look at it here.


AD Administrator Syncfusion Team February 13, 2004 02:10 PM UTC

Hi again, I got it working finally. There was some code in the currentcellchanged event (for a different column) that for some reason was causing the resize to cancel - not sure why this was happening but it appears to work now. I really appreciate all of you help! Thanks CB >Hi Clay, > >Thanks for all of your help on this. Does the problem have anything to do with the column being in a gridheirdatabound grid with child grids? I will try the techniques you mentioned and see if that works. > >Thanks, >Amanda > >>No I don''t. >> >>The only way I would know to track this problem is to use the Assembly Manager (Start Menu|Syncfusion) to create a debug build of our libraries. The autosize should be triggerred in the TextBoxChanged method found in the GridTextBoxCellRenderer.cs class. When the cell should AutoSize, place a stop at the top of this method to see if this is hit. If it is, step through the code to see what is preventing the autosize. >> >>There is also one other place the sizing may get triggerred in GridTextBoxControl.cs. It is in OnContentsResized. (Search for AutoSize). You can place a stop there as well and step through that code to see what might be failing. >> >>To build debug libraries, you must have source code. >> >>If you cannot spot something, submit a Direct Trac support incident with a sample showing the problem, and we can try to look at it here.


AD Administrator Syncfusion Team February 13, 2004 02:25 PM UTC

Hi, One more thing I''ve noticed is that when I resize a column in the parent grid and then drop down a grid list in the child grid (which I think is the same column index) the second column of the drop down list gets resized as well making it much smaller in width and causing the header to wrap. Is there some way to keep the column widths in this list static and not allow them to change if other column widths change? THanks again CB >No I don''t. > >The only way I would know to track this problem is to use the Assembly Manager (Start Menu|Syncfusion) to create a debug build of our libraries. The autosize should be triggerred in the TextBoxChanged method found in the GridTextBoxCellRenderer.cs class. When the cell should AutoSize, place a stop at the top of this method to see if this is hit. If it is, step through the code to see what is preventing the autosize. > >There is also one other place the sizing may get triggerred in GridTextBoxControl.cs. It is in OnContentsResized. (Search for AutoSize). You can place a stop there as well and step through that code to see what might be failing. > >To build debug libraries, you must have source code. > >If you cannot spot something, submit a Direct Trac support incident with a sample showing the problem, and we can try to look at it here.


AD Administrator Syncfusion Team February 13, 2004 10:48 PM UTC

The default behavior of a GridDataBoundGrid is to size the grid so the headers fit on one line. Now if you turn off gridA.AllowResizeToFit, then the grid no longer tries to fit the headers, but instead just uses the default colwidth (65). I think this is what you are seeing. So, when you turn off AllowResizeToFit, you should explicitly set gridA.Model.ColWidths for each column, or call gridA.Model.ColWidths.ResizeToFit(GridRangeInfo.Row(0), GirdResizeToFitOptions.IncludeHeader) to let the grid autosize the header row.


AD Administrator Syncfusion Team February 17, 2004 01:48 AM UTC

Hi Clay, Thanks for the info. The problem I''m having is actually with the columns of a gridlistcontrol. Is there a way to explicitly set the width of these? The width of the cell that contains the gridlist stays the same, but when I change the width of a column in the parent grid it makes the columns of this gridlistcontrol that is in one of the child columns too narrow. I hope that makes sense. >The default behavior of a GridDataBoundGrid is to size the grid so the headers fit on one line. Now if you turn off gridA.AllowResizeToFit, then the grid no longer tries to fit the headers, but instead just uses the default colwidth (65). I think this is what you are seeing. So, when you turn off AllowResizeToFit, you should explicitly set gridA.Model.ColWidths for each column, or call gridA.Model.ColWidths.ResizeToFit(GridRangeInfo.Row(0), GirdResizeToFitOptions.IncludeHeader) to let the grid autosize the header row.


AD Administrator Syncfusion Team February 17, 2004 07:13 AM UTC

If you need to enlarge some columns an ddo not need the width to vary from cell to cell, you can just set the larger column withd with code like this in formload. GridDropDownGridListControlCellRenderer cr = (GridDropDownGridListControlCellRenderer)this.gridControl1.CellRenderers["GridListControl"]; cr.ListControlPart.Grid.Model.ColWidths[1] =100; If you want to size columns smaller, or need the sizes to vary from cell to cell, you will have to handle CurrentCellShowingDropDown and subscribe to the embedded grid''s QueryColWidth event, and provide the size there dynamically. You should also handle the CurrentCellClosedDroppeDown and unsubscribe to the embedded grid''s QueryColWith event.
Private Sub gridControl1_CurrentCellShowingDropDown(sender As Object, e As Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs)
   Dim cr As GridDropDownGridListControlCellRenderer = CType(Me.gridControl1.CurrentCell.Renderer, GridDropDownGridListControlCellRenderer)
   
   If Not (cr Is Nothing) Then
      AddHandler cr.ListControlPart.Grid.Model.QueryColWidth, AddressOf cr_QueryColWith
   End If
End Sub ''gridControl1_CurrentCellShowingDropDown
 

Private Sub gridControl1_CurrentCellCloseDropDown(sender As Object, e As Syncfusion.Windows.Forms.PopupClosedEventArgs)
   Dim cr As GridDropDownGridListControlCellRenderer = CType(Me.gridControl1.CurrentCell.Renderer, GridDropDownGridListControlCellRenderer)
   
   If Not (cr Is Nothing) Then
      RemoveHandler cr.ListControlPart.Grid.Model.QueryColWidth, AddressOf cr_QueryColWith
   End If
End Sub ''gridControl1_CurrentCellCloseDropDown
 
Private Sub cr_QueryColWith(sender As Object, e As GridRowColSizeEventArgs)
   If e.Index = 1 Then
      e.Size = 50
      e.Handled = True
   Else
      If e.Index = 2 Then
         e.Size = 30
         e.Handled = True
      End If
   End If
End Sub ''cr_QueryColWith

Loader.
Live Chat Icon For mobile
Up arrow icon