RE: Missing scroll bars on datagrid by v-jetan
v-jetan
Thu Oct 21 00:50:54 CDT 2004
Hi Richard,
Thanks for your posting!
I have reproduced out this issue. And then, I found that this is a known
issue of our product, it seems the scrollbar as the child control of
DataGrid did not become enable with DataGrid.Enable=true.
Now, I will provide you 2 workarounds:
1. Just find the scrollbar and explicitly enable it:
private void button1_Click(object sender, System.EventArgs e)
{
dataGrid1.Enabled = true;
foreach(Control c in this.dataGrid1.Controls)
{
System.Windows.Forms.ScrollBar sb = c as ScrollBar;
if (sb != null)
{
sb.Enabled = true;
}
}
}
2. Call PerformLayout method:
private void button1_Click(object sender, System.EventArgs e)
{
dataGrid1.Enabled = true;
dataGrid1.PerformLayout();
}
Please apply my suggestion above and let me know if it helps resolve your
problem. If you need further help, please feel free to tell me. Thanks
===================================================
Thank you for your patience and cooperation. If you have any questions or
concerns, please feel free to post it in the group. I am standing by to be
of assistance.
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.