Disable VscrollBar in DataGrid

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 > ---
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top