Hi,
Could I make RadGridView control's initialization faster? Currently first initialization of this control can take few seconds, what is quite long in case of dialog window, appearing on demand.
Sample code:
After first opening this form, when user clicks on btnInitialize button application is freezing for few seconds, clicking on btnBuild button is much faster. Second and next clicks on btnInitialize (no matter in the same or other dialog in the same application) are faster too.
I've noticed that it's a reason of calling:
Telerik.WinControls.Themes.ControlDefault.ExternalControlsThemeHelper.LoadGridThemes()
in the static constructor of class Telerik.WinControls.UI.RadGridViewElement.
Is it possible to speed up first initialization of this class?
Regards
Could I make RadGridView control's initialization faster? Currently first initialization of this control can take few seconds, what is quite long in case of dialog window, appearing on demand.
Sample code:
public
partial
class
RadGridViewDialog : Form
{
private
RadGridView _grid;
public
RadGridViewDialog()
{
InitializeComponent();
}
private
void
btnInitialize_Click(
object
sender, EventArgs e)
{
_grid =
new
RadGridView();
panel2.Controls.Add(_grid);
_grid.Dock = DockStyle.Fill;
_grid.BringToFront();
}
private
void
btnBuild_Click(
object
sender, EventArgs e)
{
using
(_grid.DeferRefresh())
{
GridViewDataColumn firstColumn =
new
GridViewTextBoxColumn();
firstColumn.HeaderText =
"Name"
;
_grid.Columns.Add(firstColumn);
firstColumn.ReadOnly =
true
;
GridViewDataRowInfo[] rows =
new
GridViewDataRowInfo[200];
GridViewDataColumn secondColumn =
new
GridViewTextBoxColumn();
secondColumn.HeaderText =
"Value"
;
_grid.Columns.Add(secondColumn);
secondColumn.Width = 110;
secondColumn.MinWidth = 70;
int
rowIndex = 0;
for
(
int
i = 0; i < rows.Length; i++)
{
rows[rowIndex] =
new
GridViewDataRowInfo(_grid.MasterView);
rows[rowIndex].Cells[0].Value =
"name"
+ i;
rows[rowIndex].Cells[1].Value =
"value"
+ i;
rowIndex++;
}
firstColumn.IsPinned =
true
;
_grid.Rows.AddRange(rows);
firstColumn.BestFit();
}
}
}
After first opening this form, when user clicks on btnInitialize button application is freezing for few seconds, clicking on btnBuild button is much faster. Second and next clicks on btnInitialize (no matter in the same or other dialog in the same application) are faster too.
I've noticed that it's a reason of calling:
Telerik.WinControls.Themes.ControlDefault.ExternalControlsThemeHelper.LoadGridThemes()
in the static constructor of class Telerik.WinControls.UI.RadGridViewElement.
Is it possible to speed up first initialization of this class?
Regards