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.

GGC.RecordExpanded and RecordCollapsed events

Thread ID:

Created:

Updated:

Platform:

Replies:

54905 Jan 19,2007 05:19 AM Feb 20,2007 08:30 AM Windows Forms 17
loading
Tags: GridControl
John H
Asked On January 19, 2007 05:19 AM

Hi,
Im using these events and the GGC.TableControl.VScroll property. If the user expands a record the RecordExpanded fires, but the VScroll property is false even though the GGC now has a scrollbar.
How can I reliably tell if the scrollbar is visible in these events?

Thanks
John

Administrator [Syncfusion]
Replied On January 19, 2007 01:07 PM

Hi John,

Do you want to hide the VerticalScrollbar in a grid? If yes, you should set the TableControl.VScrollBehavior property to GridScrollbarMode.Disabled .Here is a code snippet

this.gridGroupingControl1.TableControl.VScrollBehavior = GridScrollbarMode.Disabled;

Best Regards,
Haneef

John H
Replied On January 23, 2007 04:41 AM

Hi Haneef,
No, I want to resize a column accordingly if the scroll bar is visible.

Thanks
John

>Hi John,

Do you want to hide the VerticalScrollbar in a grid? If yes, you should set the TableControl.VScrollBehavior property to GridScrollbarMode.Disabled .Here is a code snippet

this.gridGroupingControl1.TableControl.VScrollBehavior = GridScrollbarMode.Disabled;

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On January 23, 2007 03:59 PM

Hi John,

Here is a knowledge base article that shows you "How to allocate equal size for each of the columns in all the tables of a GridGroupingControl?"
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=356

Best Regards,
Haneef

John H
Replied On January 26, 2007 05:43 AM

Hi Haneef,
Yeah I saw that example, but it seems overly complex for what should be a simple task? Filtering out everything else in the example (helper class etc), I have implemented the QueryColWidth event as follows;

grid.TableModel.QueryColWidth += new Syncfusion.Windows.Forms.Grid.GridRowColSizeEventHandler( TableModel_QueryColWidth );

and;

void TableModel_QueryColWidth( object sender, Syncfusion.Windows.Forms.Grid.GridRowColSizeEventArgs e )
{
if(e.Index == 3)
{
e.Size = grid.ClientSize.Width - 19;
e.Handled = true;
}
}

when horizontally resizing the GGC, the rows don't repaint correctly?
Also, when expanding a node that contains many rows the scrollbar appears, but the column I resize doesn't adjust accordingly.

Any pointers would be very welcome.

Thanks
John

John H
Replied On January 30, 2007 09:39 AM

Any feedback on this issue please?

Thanks
John

Administrator [Syncfusion]
Replied On January 31, 2007 03:08 PM

Hi John,

Sorry for the delay in updating you.

We were not able to reproduce the issue here. Is it possible for you to upload us a sample or modify the any of our browser sample to reproduce the issue here? This will help us to analyse the issue further.

Thanks for your patience.

Best Regards,
Haneef

John H
Replied On February 1, 2007 11:13 AM

Hi Haneef,
Sure, I should be able to put together an example.
One thing I forgot to mention is that I have drawn some images in the TableControlDrawCell event for the column that is to be resized, using e.Inner.Bounds.Width - 35 as the firsts left position.

Does this help?

Thanks
John

John H
Replied On February 7, 2007 05:50 AM

Hi Haneef,
I have attached an example project that displays 2 icons in the top level row, and I have implimented QueryColWidth as per the example.

If you resize the form you will see that the icons are not painted correctly, and if you expand node 2 and then one of its child nodes so that the scroll bar appears, you can see that the top level column widths are not resized and so the right most icon is obscured by the scroll bar.

Thanks
John

GGC_3_levels_example.zip

Administrator [Syncfusion]
Replied On February 7, 2007 06:28 PM

Hi John,

Please refer to the following forum thread for more details.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=55958


Best regards,
Haneef

John H
Replied On February 9, 2007 04:17 AM

Hi Haneef,

The example you posted doesn't resolve the repainting issue when you drag the form wider or smaller, or the problem where the right most icon is covered by the scrollbar when you expand Table2 node and a child node.

Any ideas?

Thanks
John


>Hi John,

Please refer to the following forum thread for more details.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=55958


Best regards,
Haneef

John H
Replied On February 14, 2007 06:48 AM

Hi Haneef,
I still need feedback on this issue please.

Thanks
John

>Hi Haneef,

The example you posted doesn't resolve the repainting issue when you drag the form wider or smaller, or the problem where the right most icon is covered by the scrollbar when you expand Table2 node and a child node.

Any ideas?

Thanks
John


>Hi John,

Please refer to the following forum thread for more details.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=55958


Best regards,
Haneef

John H
Replied On February 15, 2007 11:04 AM

Hi Haneef,
I still need feedback on this issue please.

Thanks
John

>Hi Haneef,
I still need feedback on this issue please.

Thanks
John

>Hi Haneef,

The example you posted doesn't resolve the repainting issue when you drag the form wider or smaller, or the problem where the right most icon is covered by the scrollbar when you expand Table2 node and a child node.

Any ideas?

Thanks
John


>Hi John,

Please refer to the following forum thread for more details.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=55958


Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 15, 2007 01:43 PM

Hi John,

Thanks for your response. We will analyze your issues in detail and let you know the feedback in few hours. We regret for any inconvenience caused.

Thanks for being patience.

Best regards,
Haneef

John H
Replied On February 19, 2007 11:42 AM

Hi Haneef,
I still need feedback on this issue please.

Thanks
John


>Hi John,

Thanks for your response. We will analyze your issues in detail and let you know the feedback in few hours. We regret for any inconvenience caused.

Thanks for being patience.

Best regards,
Haneef

Administrator [Syncfusion]
Replied On February 19, 2007 01:16 PM

Hi John,

Thanks for being patience.

Before draw the icon in a grid cell, you should check table cell identity of the cell and also you should check the drawing point of the error icon. Please find the code snippet for drawing the error in a cell.

void NavParent_DrawCell(object sender, GridDrawCellEventArgs e)
{
GridTableControl tc = sender as GridTableControl;
int filed = tc.TableDescriptor.ColIndexToField(e.ColIndex);
GridTableCellStyleInfo style = tc.GetTableViewStyleInfo(e.RowIndex, e.ColIndex) as GridTableCellStyleInfo;

//before draw a cell, you need to check Table cell identity.
if ((style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
&& (tc.TableDescriptor.Columns.Count > filed))
{

string columnName = tc.TableDescriptor.Columns[filed].Name;
if (columnName == "group")
{
e.Renderer.Draw(e.Graphics, e.Bounds, e.RowIndex, e.ColIndex, e.Style);

Icon failureIcon = SystemIcons.Error;
Icon warningIcon = SystemIcons.Warning;
//Also you can check the drawing point of the icon....
Rectangle iRect = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width/2,e.Bounds.Height);
e.Graphics.DrawIconUnstretched(failureIcon, iRect);
e.Cancel = true;
}
}
}

Here is a modified sample.
GGCModified2.zip

Thanks for your continued interest in Syncfusion products.

Best regards,
Haneef

John H
Replied On February 20, 2007 05:35 AM

Hi Haneef,
your example fixes the repaint issue, thanks.
But it doesn't fix the problem when the icon is being drawn to the right of the Description column, and then expand nodes until a scrollbar appears. Do you have a property I can check to see if the scrollbar is visible?

I have modifed the example to show you what I mean.

Thanks
John


>Hi John,

Thanks for being patience.

Before draw the icon in a grid cell, you should check table cell identity of the cell and also you should check the drawing point of the error icon. Please find the code snippet for drawing the error in a cell.

void NavParent_DrawCell(object sender, GridDrawCellEventArgs e)
{
GridTableControl tc = sender as GridTableControl;
int filed = tc.TableDescriptor.ColIndexToField(e.ColIndex);
GridTableCellStyleInfo style = tc.GetTableViewStyleInfo(e.RowIndex, e.ColIndex) as GridTableCellStyleInfo;

//before draw a cell, you need to check Table cell identity.
if ((style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
&& (tc.TableDescriptor.Columns.Count > filed))
{

string columnName = tc.TableDescriptor.Columns[filed].Name;
if (columnName == "group")
{
e.Renderer.Draw(e.Graphics, e.Bounds, e.RowIndex, e.ColIndex, e.Style);

Icon failureIcon = SystemIcons.Error;
Icon warningIcon = SystemIcons.Warning;
//Also you can check the drawing point of the icon....
Rectangle iRect = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width/2,e.Bounds.Height);
e.Graphics.DrawIconUnstretched(failureIcon, iRect);
e.Cancel = true;
}
}
}

Here is a modified sample.
GGCModified2.zip

Thanks for your continued interest in Syncfusion products.

Best regards,
Haneef

GGCModified2.zip

John H
Replied On February 20, 2007 08:30 AM

Hi Haneef,
I found the grid.TableControl.VScroll property, which does what I need, thanks.

John

>Hi Haneef,
your example fixes the repaint issue, thanks.
But it doesn't fix the problem when the icon is being drawn to the right of the Description column, and then expand nodes until a scrollbar appears. Do you have a property I can check to see if the scrollbar is visible?

I have modifed the example to show you what I mean.

Thanks
John


>Hi John,

Thanks for being patience.

Before draw the icon in a grid cell, you should check table cell identity of the cell and also you should check the drawing point of the error icon. Please find the code snippet for drawing the error in a cell.

void NavParent_DrawCell(object sender, GridDrawCellEventArgs e)
{
GridTableControl tc = sender as GridTableControl;
int filed = tc.TableDescriptor.ColIndexToField(e.ColIndex);
GridTableCellStyleInfo style = tc.GetTableViewStyleInfo(e.RowIndex, e.ColIndex) as GridTableCellStyleInfo;

//before draw a cell, you need to check Table cell identity.
if ((style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
&& (tc.TableDescriptor.Columns.Count > filed))
{

string columnName = tc.TableDescriptor.Columns[filed].Name;
if (columnName == "group")
{
e.Renderer.Draw(e.Graphics, e.Bounds, e.RowIndex, e.ColIndex, e.Style);

Icon failureIcon = SystemIcons.Error;
Icon warningIcon = SystemIcons.Warning;
//Also you can check the drawing point of the icon....
Rectangle iRect = new Rectangle(e.Bounds.X, e.Bounds.Y, e.Bounds.Width/2,e.Bounds.Height);
e.Graphics.DrawIconUnstretched(failureIcon, iRect);
e.Cancel = true;
}
}
}

Here is a modified sample.
GGCModified2.zip

Thanks for your continued interest in Syncfusion products.

Best regards,
Haneef

GGCModified2.zip

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.

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.

;