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

ListBox.Grid without multiline contents

Hello,

is it possible to disable (general) multiline entries in the grid?

Best regards,
Frank

Attachment: GridControlMultiline_7a0253ab.zip

5 Replies

AG Anish George Syncfusion Team May 9, 2016 12:34 PM UTC

Hi Frank, 

Thank you for using Syncfusion products. 

It is possible disable the multi-lines in GridControl by setting the WrapText property as false. Please refer the below code snippet. 

C#: 
this.gridControl1.TableStyle.WrapText = false; 


Please let us know if you need any further assistance. 

Regards, 
Anish. 



FP Frank Piplak May 9, 2016 12:59 PM UTC

Hello Anish,

thanks for but it not works. Please see my code, perhaps I made a mistake?!

My Code:
            Dim vGridControl As Syncfusion.Windows.Forms.Grid.GridControl = pMultiColumnComboBox.ListBox.Grid

            With vGridControl
                .DefaultRowHeight = vgIntRowHeightDef
                .DefaultGridBorderStyle = Syncfusion.Windows.Forms.Grid.GridBorderStyle.Solid
                .GridLineColor = vgColBorderMid(vgBytTheme)
                .ColWidths(1) = 0
                .TableStyle.WrapText = False
            End With

Best regards,
Frank


AG Anish George Syncfusion Team May 10, 2016 09:45 AM UTC

Hi Frank, 

Thank you for your update. 

We request you to make use of the QueryCellInfo event and then set the WrapText property as false. Please refer the below code snippet. We have also created a simple sample for your convenience. 

VB: 
 
AddHandler Me.multiColumnComboBox1.ListBox.Grid.QueryCellInfo, AddressOf Grid_QueryCellInfo 
 
Private Sub Grid_QueryCellInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs) 
        e.Style.WrapText = False 
    End If 
End Sub 


Please let us know if you need any further assistance. 

Regards, 
Anish 



FP Frank Piplak May 13, 2016 07:39 AM UTC

Hello Anish,

works, many thanks.

Best regards,
Frank


AG Anish George Syncfusion Team May 16, 2016 05:44 AM UTC

 Hi Frank, 
  
We are glad to hear that the given suggestion helps you to find a solution. 
  
Please let us know if you need any further assistance. 
  
Regards, 
Anish 


Loader.
Up arrow icon