Disable VscrollBar in DataGrid

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

In a windowsapplication i have a datagrid where I dont want the vertical
scrollbar to be visible. I can't find HorizontalScrollBar and
VerticalScrollBar properties anywhere.

I've tried to create controls for this... without luck. Here is the code
I'm using. Please tell me what I'm doing wrong.

this.InitializeScrollBar(DataGrid1)
....

// Initialize scrollbar for datagrid
private void InitializeScrollBar(DataGrid drg)
{
VScrollBar vScrollBar1 = new VScrollBar();

vScrollBar1.Visible = false;

drg.Controls.Add(vScrollBar1);
}

Any help appreciates.

--- < Hans > ---
 
After som research I found som error in my code. But I still havn't solved my
problem.
Or more precisly another problem appeared.

After folowing code my DataGrid disappeared.

InitializeScrollBar(DataGrid1);

// Initialize scrollbar for datagrid
private void InitializeScrollBar(DataGrid dgr)
{
VScrollBar vScrollBar1 = new VScrollBar();
vScrollBar1.Hight = DataGrid1.Hight;
vScrollBar1.Location = new Point (x, y);
vScrollBar1.Enabled = false;
this.Controls.Add (vScrollBar1);
vScrollBar.Controls.Add(dgr);
}

Can anyone help me!!!!


Hans
 
Back
Top