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

Grid title changes with horizontal scroll

Thread ID:

Created:

Updated:

Platform:

Replies:

94368 May 10,2010 12:53 PM UTC May 12,2010 10:35 AM UTC ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Administrator [Syncfusion]
Asked On May 10, 2010 12:53 PM UTC

Hi,

I'm right now facing an issue related to the title display for a given grid file.

This scenario can be easily reporoduced using the customerOrders.grid file , the steps are shown below,

- Open CustomerOrders.grid
- After the grid file is loaded scroll the contents horizontally to the left.
- Now the initial titile "Customer : 91 items" gets trimmed depending on the intensity of the scroll.

Attached is the screenshots which has both before and after scroll scenarios mentioned above

Solution required.

- Is there any way to keep the grid title (Customers : 91 items) stationary without getting trimmed even if the user makes a horizontal scroll to view the grid contents

Awaiting for a positive reply for this solution at the earliest.




afterscroll_5430bf3a.rar

Jisha Joy [Syncfusion]
Replied On May 12, 2010 10:35 AM UTC

Hi Lim,

Thank you for using Syncfusion products.

You could avaoid the issue by handling the TableControlDrawCell and TableControl.HScrollPixelPosChanged events. See the code:


private void TableControlDrawCell(object sender, GridTableControlDrawCellEventArgs e)
{
GridTableCellStyleInfo style = e.Inner.Style as GridTableCellStyleInfo;

if (style.TableCellIdentity.TableCellType == GridTableCellType.GroupCaptionCell
&& e.Inner.ColIndex == 0 )
{
e.Inner.Cancel = true;
string s = e.Inner.Style.Text;
e.Inner.Style.Text = string.Empty;

Rectangle rect = e.Inner.Bounds;
rect.Location = new Point(0, rect.Y);

e.Inner.Renderer.Draw(e.Inner.Graphics, e.Inner.Bounds, e.Inner.RowIndex, e.Inner.ColIndex, e.Inner.Style);
e.Inner.Graphics.DrawString(s, e.Inner.Style.GdipFont, new SolidBrush(e.Inner.Style.TextColor), rect);

e.Inner.Style.Text = s;
}
}

private void HScrollPixelPosChanged(object sender, GridScrollPositionChangedEventArgs e)
{
GridTableControl tc = sender as GridTableControl;
tc.RefreshRange(GridRangeInfo.Row(1));
}


Sample for your reference:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GGCScrolling-1116423455.zip

Please let me know if this helps.

Regards,
Jisha

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

;