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.
By default, in the Property Builder for GridView, the defaults are:
Header Text Alignment = Middle Center
Text Alignment = Middle Left.
This means that EVERY time I create a new grid, I have to remember to make them both the same.
Why make them different? It makes the grid look rubbish whenthe defaults are used.
Enable the ability to MERGE seperate rows (different records), like found in ITunes "Songs" mode where is shows the artwork (then artist,release undernearth) in a custom class, then the related song rows to the right. Your competitor Dev Express has it already in place. See youtube video here : https://www.youtube.com/watch?v=TfPXwE7GcXs Cheers
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.
When the GridViewComboBoxColumn is added for the master level, once the FieldName property is set, the DataType is synced with its type:
However, for the child levels, this logic is not executed automatically.