Datagrid left-right scroll problem

G

Guest

It will be really helpful if anyone could give me a solution for this problem.
My application is developed in C#.

In my application , I am using a datagrid which is binded with a datasource.
The datagrid is having about 10 columns. So inorder to see all the columns,
I have to use the scroll bar to move to right.The bar in the horizontal scroll
bar is working properly. The problem is other than using the bar, I can't use
the right side arrow (|>)to shroll to right. It is not working. But the left side arrow(<|)is working properly so that i can scroll to the first column using that. Why is the
right side arrow not working.. is there any property so that i can make it work
properly...

so please help me ...in this matter

Thanks and Regards
Gireesh
 
G

Geoffrey Munday

Are you adding custom GridColumnStyles such as DataGridTextBoxColumn? If so
you will want to make sure you are not setting its Width property equal to
zero in efforts to "hide" the column from the user.

In my experience if the Width is set to zero the Scrollbars can't evaluate
how many pixels they need to move to the next column in effect locking
themselves until you move the scrollbar to a column with a width larger than
zero. If you really must hide your column this way try setting its Width
equal to 1, but you really shouldn't include a column in the
GridColumnStylesCollection if it isn't going to be visible to the user.



"Datagrid left-right scroll problem" <Datagrid left-right scroll
(e-mail address removed)> wrote in message
It will be really helpful if anyone could give me a solution for this problem.
My application is developed in C#.

In my application , I am using a datagrid which is binded with a datasource.
The datagrid is having about 10 columns. So inorder to see all the columns,
I have to use the scroll bar to move to right.The bar in the horizontal scroll
bar is working properly. The problem is other than using the bar, I can't use
the right side arrow (|>)to shroll to right. It is not working. But the
left side arrow(<|)is working properly so that i can scroll to the first
column using that. Why is the
 
G

Geoffrey Munday

Are you using custom GridColumnStyles? If so, you may want to think about
leaving the primary key column out all together and in your Double-Click
event try something like the following to get the value of the currently
selected row's primary key column:

CType(Me.BindingContext(MyGrid.DataSource, "TableName").Current,
DataRowView).Row("PrrmaryKeyColumnName")

Anyway, good luck!
 

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

Similar Threads


Top