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. Image for the cookie policy date
close icon

PrepareViewStyleInfo event for GGC

Hi, to influence the style of a cell immediately before the cell is drawn I can handle the PrepareViewStyleInfo event for GDBG. Is there any similar event for gridGroupingControl? Is there an event raised when the datasource has changed for ggc and gdbg? thx, Klaus

8 Replies

ST stanleyj Syncfusion Team February 2, 2006 02:10 PM UTC

Hi Klaus, GGC also has PrepareViewStyleInfo as TableControlPrepareViewStyleInfo, you may also try QueryCellStyleInfo for better results. The events you are looking for GDBG is Binder.DataSourceChanged. Try TableSourceListChanged for GGC. Best regards, Stanley


AD Administrator Syncfusion Team February 3, 2006 07:36 AM UTC

Hi Stanley, thank you for your fast answers all the time. TableControlPrepareViewStyleInfo for GGC works fine but can you give me a hint how to access the currently drawn GridRecordRow from the given GridTableControlPrepareViewStyleInfoEventArgs. I have no idea how to use e.Inner.ColIndex and e.Inner.RowIndex to get the Record. I think there is a general leak in my understanding of how Table, TableDescriptor, TableModel and TableControl works together in GGC. Is there a document where this is described? thx, Klaus >Hi Klaus, > >GGC also has PrepareViewStyleInfo as TableControlPrepareViewStyleInfo, you may also try QueryCellStyleInfo for better results. > >The events you are looking for GDBG is Binder.DataSourceChanged. Try TableSourceListChanged for GGC. > >Best regards, >Stanley >


ST stanleyj Syncfusion Team February 3, 2006 11:37 AM UTC

Hi Klaus, Thanks for all your feedbacks. There are couple of forums on this related task. Refer this KB article to get an idea. You can search the forum section with ''PrepareViewStyleInfo AND grouping'' or ''PrepareViewStyleInfo AND GGC'' to get related results. >>I think there is a general leak in my understanding of how Table, TableDescriptor, TableModel and TableControl works together in GGC. Is there a document where this is described? There are no separate document on these now, We will work on explaining these and update appropriately in the KB section. Thanks and regards, Stanley


RE resmi March 29, 2006 01:13 PM UTC

hi By using TableControlPrepareViewStyleInfo Iam changing the style according to some condition.But for one column I dont want to apply the style.Is it possible


AD Administrator Syncfusion Team March 29, 2006 01:58 PM UTC

Hi, Try the below code to get the column name in the TableControlPrepareViewStyleInfo event. Rectangle rect = e.TableControl.RangeInfoToRectangle(GridRangeInfo.Cell(e.Inner.RowIndex,e.Inner.ColIndex)); GridTableCellStyleInfo style = e.TableControl.PointToTableCellStyle(new Point(rect.X,rect.Y)); if(style.TableCellIdentity.Column != null ) Console.WriteLine(style.TableCellIdentity.Column); Regards, Calvin.


RE resmi March 30, 2006 05:30 AM UTC

this will give me only the column name.i want that column say ''name'',not to apply any changes,but the other columns with records should apply changes


AD Administrator Syncfusion Team March 30, 2006 10:44 AM UTC

Hi, Please try this code snippet and let us know if this helps to resolve the issue. private void gridGroupingControl1_TableControlPrepareViewStyleInfo(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlPrepareViewStyleInfoEventArgs e) { // Record r = e.TableControl.Table.CurrentRecord; // int rowindex = e.TableControl.Table.DisplayElements.IndexOf(r); int colindex = this.gridGroupingControl1.TableModel.NameToColIndex("Integer"); if(!(colindex == e.Inner.ColIndex))// && e.Inner.RowIndex == rowindex) e.Inner.Style.BackColor = Color.Red; } Best regards, Madhan


AD Administrator Syncfusion Team March 31, 2006 06:16 AM UTC

thanks

Loader.
Live Chat Icon For mobile
Up arrow icon