In this scenario, the Browsable(false) attribute is set to both properties which are used to create the self-referencing hierarchy. When the columns are predefined, running that application will freeze as the RadGridView could not correctly get the parent row. If the columns are auto-generated, this behavior is not observed.
This is not exactly a real solution as setting the Browsable(false) attribute will remove the properties from the source. However, the control should not freeze the application.
maskBoxColumn.FormatInfo = CultureInfo.CreateSpecificCulture("en-AE");
RadGridview 1.BestFitColumns(Telerik.WinControls.UI.BestFitColumnMode.HeaderCells)
To reproduce use the code below:
DataTable table = new DataTable();
for (int i = 0; i < 20; i++)
{
table.Columns.Add("Left" + i, typeof(int));
table.Columns.Add("Right" + i, typeof(int));
}
for (int i = 0; i < 27; i++)
{
List<object> parameters = new List<object>();
for (int j = 0; j < table.Columns.Count - 2; j++)
{
parameters.Add(100 * i + i);
}
table.Rows.Add(parameters.ToArray());
}
this.radGridView1.DataSource = table;
ColumnGroupsViewDefinition def = new ColumnGroupsViewDefinition();
for (int i = 0, j = 0; i < 20; i++)
{
var group = new GridViewColumnGroup("Group" + 3 + i);
def.ColumnGroups.Add(group);
group.Groups.Add(new GridViewColumnGroup("0"));
group.Groups[0].Rows.Add(new GridViewColumnGroupRow() { MinHeight = 30});
group.Groups[0].Rows[0].ColumnNames.Add(this.radGridView1.Columns[j].Name);
this.radGridView1.Columns[j].Width = 58;
j++;
group.Groups[0].Rows[0].ColumnNames.Add(this.radGridView1.Columns[j].Name);
this.radGridView1.Columns[j].Width = 58;
j++;
}
radGridView1.MasterTemplate.ShowRowHeaderColumn = false;
this.radGridView1.ViewDefinition = def;
// To Export:
GridViewPdfExport pdfExport = new GridViewPdfExport(this.radGridView1);
pdfExport.FitToPageWidth = false;
pdfExport.ExportViewDefinition = true;
pdfExport.ExportVisualSettings = true;
pdfExport.RunExport(@"..\..\pdf", new PdfExportRenderer());
There is a sample project attached and the result is illustrated below:
200%:
100%:
When typing text in a new row in the RadGridView control with Windows 11 theme, the text appears to be moved down from the top of the row and makes it look like it is hidden, thus making it hard to see.
I am using all the defaults of the RadGridView control with AutoSizeRows = true.
To reproduce:
public RadForm1()
{
InitializeComponent();
this.radGridView1.Columns.Add("Telerik");
this.radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
for (int i = 0; i < 10; i++)
{
this.radGridView1.Rows.Add(Guid.NewGuid().ToString());
}
}
private void radButton1_Click(object sender, EventArgs e)
{
RadPrintDocument document = new RadPrintDocument();
document.DefaultPageSettings.Landscape = false;
this.radGridView1.PrintPreview(document);
}
Step 1: Open Print Settings dialog:
Step 2: Change the Orientation to Landscape:
Step 3: Click directly the Print button here. Once the default Print dialog is opened choose Preferences:
Step 4: You will notice that the Orientation is still Portrait instead of Landscape:
When the font size of the OK and Cancel buttons inside the Excel-like filtering popup is increased, the buttons are cut.