We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

HScrollPixelPosChanged event

Thread ID:

Created:

Updated:

Platform:

Replies:

48606 Aug 31,2006 09:47 AM UTC Aug 31,2006 02:08 PM UTC Windows Forms 7
loading
Tags: GridControl
Jay
Asked On August 31, 2006 09:47 AM UTC

Why isn''t the HScrollPixelPosChanged event fired when you if you click a column header and it gets automatically scrolled into view? Is there and equivalent for the column header i.e what event is fired when the column header is automatically scrolled?

Thanks

Administrator [Syncfusion]
Replied On August 31, 2006 10:51 AM UTC

Hi Jay,

The reason is that you are not anable the pixel scrolling of the grid. You can use below code snippet to enable the pixel scrolling.

this.gridControl1.HScrollPixel = true;
this.gridControl1.VScrollPixel = true;

//Occurs before the horizontal pixel scroll position is changed.
private void gridControl1_HScrollPixelPosChanged(object sender, Syncfusion.Windows.Forms.Grid.GridScrollPositionChangedEventArgs e)
{
Console.WriteLine("pixel scrolling postion");
}

Let me know if this helps.
Thanks,
Haneef

Administrator [Syncfusion]
Replied On August 31, 2006 11:00 AM UTC

Hi Haneef,

We already handle HScrollPixelPosChanged but the event is not raised when the column header is selected.

Thanks

Administrator [Syncfusion]
Replied On August 31, 2006 11:29 AM UTC

Hi Jay,

You can use the LeftColChanging event to detect the scroll position changes when the column is clicked. Here is a code snippet.

//form Load....
this.grid.LeftColChanging += new GridRowColIndexChangingEventHandler(this.LeftColChanging);

private void LeftColChanging(object sender, GridRowColIndexChangingEventArgs e)
{
Console.WriteLine("Fired");
}

Thanks,
Haneef

Jay
Replied On August 31, 2006 11:46 AM UTC

Thanks. I have already tried that. When the main grid position changes I need to realign two other grids. In HScrollPixelPosChanged we do the following:

private void gridMain_HScrollPixelPosChanged(object sender, GridScrollPositionChangedEventArgs e)
{
try
{
// Scroll to new position
this.gridTotals.SetCurrentHScrollPixelPos( gridMain.GetCurrentHScrollPixelPos() );
this.gridFilters.SetCurrentHScrollPixelPos( gridMain.GetCurrentHScrollPixelPos() );

However, this didn''t work from LeftColChanging event. Any other ideas?

Administrator [Syncfusion]
Replied On August 31, 2006 12:34 PM UTC

Hi Jay,

The reason is that the LeftColChanging event occurs before the grid is scrolled when the left column index is changed. Try the same code in LeftColChanged event and Let me know if this helps.

private void LeftColChanged(object sender, GridRowColIndexChangedEventArgs e)
{
// Scroll to new position
this.gridTotals.SetCurrentHScrollPixelPos( gridMain.GetCurrentHScrollPixelPos() );
this.gridFilters.SetCurrentHScrollPixelPos( gridMain.GetCurrentHScrollPixelPos() );
}

Thanks,
Haneef


Jay
Replied On August 31, 2006 02:06 PM UTC

Sorry I wasn''t clear. I have already tried your suggestion in LeftColChanging.

Jay
Replied On August 31, 2006 02:08 PM UTC

Apologies. I didn''t read your last post correctly. I will try your suggestion in LeftColChanged event.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;