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.

PrepareViewStyleInfo Event

Thread ID:

Created:

Updated:

Platform:

Replies:

42505 Mar 30,2006 04:35 AM Apr 5,2006 09:58 AM Windows Forms 5
loading
Tags: GridControl
Ravichandran
Asked On March 30, 2006 04:35 AM

Hi, The grid is populated with data and the visible rows are 50. I am clicking on the 48 th row, then applying some grouping logic seperately not on grid now the visible row count is 30 and refreshing the grid that time PrepareViewStyleInfo event fires for the first time the rowindex is coming as 48 i am having some logic there to change the color of cetain rows but throwing up an "ndex was out of range" exception bcos it is trying to acces the element in 48 th row but the visible rows are only 30. My question here is does grid holds the last clicked row no before refreshing? Pls clarify the events function... Thanks Ravi

Ravichandran
Replied On March 30, 2006 09:51 AM

Hi Got want I am trying to say?? Thanks Ravi >Hi, > >The grid is populated with data and the visible rows are 50. I am clicking on the 48 th row, then applying some grouping logic seperately not on grid now the visible row count is 30 and refreshing the grid that time PrepareViewStyleInfo event fires for the first time the rowindex is coming as 48 i am having some logic there to change the color of cetain rows but throwing up an "ndex was out of range" exception bcos it is trying to acces the element in 48 th row but the visible rows are only 30. My question here is does grid holds the last clicked row no before refreshing? > >Pls clarify the events function... > >Thanks >Ravi

Administrator [Syncfusion]
Replied On March 31, 2006 06:16 AM

Hi Ravichandran, Sorry for the delayed response. Please provide some more information on the grouping logic that you are applying? We were not able to reproduce the issue here. Thanks for your patience. Best regards, Madhan Sample : PopulateValues_GGC

Ravichandran
Replied On April 4, 2006 09:39 AM

Hi Madhan, No problem. My problem is whenever I do Refresh() the QueryCellInfo and PrepareViewStyleInfo are fired with RowIndex of the last clicked row in the grid before I do refresh. Before doing Refresh() 1. I have expanded all the rows in the grid and clicked some of the bottom row say for example 45th row. 2. Then collapse all the rows.Now the QueryRowCount() events fires there I am setting the e.Count = my_document.VisibleRowCount; 3. So after collapsing the row count becomes 30. 4. Now if I call the Refresh() method of grid those two events are fired (QueryCellInfo and PrepareViewStyleInfo ) 5. Since the bound datasource is changed with 30 rows its throwing an Index outof range exception while trying to get the record in 45th row. These events are fired always with the rowindex previously displayed grid ( before refresh). My question is where it is keeping those rowindex value? Is there any way to avoid? Thanks Ravi. We have written some logic in those events to get the record of clicked row. >Hi Ravichandran, > >Sorry for the delayed response. Please provide some more information on the grouping logic that you are applying? We were not able to reproduce the issue here. > >Thanks for your patience. > >Best regards, >Madhan > >Sample : PopulateValues_GGC

Administrator [Syncfusion]
Replied On April 5, 2006 08:00 AM

Hi Ravi, Try setting the ResetVolatileData( ) before refreshing the grid and let us know if this helps. externalData.ExpandAll( ); gridControl1.ResetVolatileData(); gridControl1.Refresh( ); gridControl1.UpdateScrollBars(); this.gridControl1.Invalidate(); Kindly modify the attached sample to reproduce the issue here, if this does not help. Sample : VirtualTreeGrid.zip Thanks for the patience. Best regards, Madhan

Administrator [Syncfusion]
Replied On April 5, 2006 09:58 AM

Hi Madhan, I am calling the method ResetVolatileData() also eventhough getting the same error. But I have fixed the error by checking the following condition in PrepareViewStyleInfo event if ( e.RowIndex > 0 && this.CurrentCell.HasCurrentCellAt(e.RowIndex)) { // logic to get the record based on rowindex. } this returns false if the rowindex is out of range. thanks for your help Cheers Ravi. >Hi Ravi, > >Try setting the ResetVolatileData( ) before refreshing the grid and let us know if this helps. > >externalData.ExpandAll( ); >gridControl1.ResetVolatileData(); >gridControl1.Refresh( ); >gridControl1.UpdateScrollBars(); >this.gridControl1.Invalidate(); > >Kindly modify the attached sample to reproduce the issue here, if this does not help. >Sample : VirtualTreeGrid.zip > >Thanks for the patience. > >Best regards, >Madhan

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.

;