Unplanned
Last Updated: 20 Mar 2024 11:40 by ADMIN
Bert
Created on: 20 Mar 2024 11:29
Category: VirtualGrid
Type: Bug Report
1
RadVirtualGrid: Text appears upper in cell with Font Arial, 8.25 when the text is larger that the column width
1 comment
ADMIN
Nadya | Tech Support Engineer
Posted on: 20 Mar 2024 11:40

Hello, Bert,

You can use the following workaround:

private void RadVirtualGrid1_CellFormatting(object sender, VirtualGridCellElementEventArgs e)
{
	if (e.CellElement.RowIndex >= 0)
	{
		switch (_font)
		{
			case 1:
				var cell =	e.CellElement as VirtualGridCellElement;
					e.CellElement.Font = _arial825;
                    TextPart textPart = new TextPart(cell);
                    SizeF textSize = textPart.Measure(new SizeF(float.PositiveInfinity, float.PositiveInfinity));

					if (textSize.Width > cell.Size.Width)
					{
						e.CellElement.Padding = new Padding(0, 3, 0, 0);
					}
					else
					{
                                        e.CellElement.Padding = new Padding(0);
                                         }
					
				break;
		}
	}
}

Regards,
Nadya | Tech Support Engineer
Progress Telerik

A brand new ThemeBuilder course was just added to the Virtual Classroom. The training course was designed to help you get started with ThemeBuilder for styling Telerik and Kendo UI components for your applications. You can check it out at https://learn.telerik.com