Hello,
when i am using RadGridView with Office2010Black theme, and loading some data into, i got vertical scrollbar painted wrong. See the screenshot attached.
My grid initialization section:
When loading data, i have (according to requirements) to disable the Grid control first, and enable it as soon as data loaded.
Here is an example:
After doing so, i have wrong painting behavior of the vertical scrollbar (it is only so in Office 2010 black theme!!), as it shown on the screenshot. See second image, as it should be expected.
In addition, i have experinced that the scroller thumb does not update it's height immediately, according to the added rows count.
It will only redraw itself when user is dragging it or resizing control.
I have tried: radGridView1.Invalidate(), but it does not help.
So far workarounds are:
1) decorating code with BeginUpdate/EndUpdate does partially fix the problem, scrollbar thumb does not change it's size
2) do not disable grid when loading data - works fine for me and even updates scrollbar thumb size, but i need to disable grid before doing data loading due to application requirements.
when i am using RadGridView with Office2010Black theme, and loading some data into, i got vertical scrollbar painted wrong. See the screenshot attached.
My grid initialization section:
private
DataTable dataTable;
public
Form1()
{
InitializeComponent();
radGridView1.AutoSizeRows =
false
;
radGridView1.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill;
radGridView1.RowFormatting += radGridView1_RowFormatting;
radGridView1.ReadOnly =
true
;
radGridView1.ShowRowHeaderColumn =
false
;
radGridView1.VerticalScrollState = ScrollState.AlwaysShow;
radGridView1.ThemeName =
"Office2010Black"
;
dataTable =
new
DataTable();
dataTable.Columns.Add(
"number"
,
typeof
(
int
));
dataTable.Columns.Add(
"descriptions"
,
typeof
(
string
));
radGridView1.DataSource = dataTable;
}
void
radGridView1_RowFormatting(
object
sender, RowFormattingEventArgs e)
{
e.RowElement.RowInfo.Height = 120;
}
When loading data, i have (according to requirements) to disable the Grid control first, and enable it as soon as data loaded.
Here is an example:
private
void
radButton1_Click(
object
sender, EventArgs e)
{
radGridView1.Enabled =
false
;
Random rnd =
new
Random((
int
)DateTime.Now.Ticks);
dataTable.Clear();
for
(
int
i = 0; i < rnd.Next(1000); i++)
{
DataRow row = dataTable.NewRow();
row[0] = i + 1;
row[1] =
"description"
+ i.ToString();
dataTable.Rows.Add(row);
}
radGridView1.Enabled =
true
;
}
After doing so, i have wrong painting behavior of the vertical scrollbar (it is only so in Office 2010 black theme!!), as it shown on the screenshot. See second image, as it should be expected.
In addition, i have experinced that the scroller thumb does not update it's height immediately, according to the added rows count.
It will only redraw itself when user is dragging it or resizing control.
I have tried: radGridView1.Invalidate(), but it does not help.
So far workarounds are:
1) decorating code with BeginUpdate/EndUpdate does partially fix the problem, scrollbar thumb does not change it's size
2) do not disable grid when loading data - works fine for me and even updates scrollbar thumb size, but i need to disable grid before doing data loading due to application requirements.