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.

VisibleCell

Thread ID:

Created:

Updated:

Platform:

Replies:

73724 May 15,2008 12:21 PM Jun 2,2008 12:15 PM Windows Forms 3
loading
Tags: GridControl
mattia locatelli
Asked On May 15, 2008 12:21 PM

Hi all,
how can i find out if a cell is visible? For visible I mean the user can see it. For example a cell covered by another window is not visible.
Is it possible to have this information?



Administrator [Syncfusion]
Replied On May 22, 2008 09:49 AM

Hi ML,

Thanks for the interest in Syncfusion Grid.

It is not possible to find out the visible cell(covered by another window). But you can calculate the number of visible rows and column in a Grid. Please refer the following code snippet for more detail.


//To Calculate the number of visible rows in a Grid.
int visibleRows = this.gridControl1.ViewLayout.LastVisibleRow - this.gridControl1.TopRowIndex;
//To Calculate the number of visible columns in a Grid.
int visibleCols = this.gridControl1.ViewLayout.LastVisibleCol - this.gridControl1.LeftColIndex;
//To set the TopRowIndex for changing the Row view of the Grid.
this.gridControl1.TopRowIndex = RowIndex - visibleRows/2;
//To set the LeftColIndex for changing the Column view of the Grid.
this.gridControl1.LeftColIndex = ColIndex - visibleCols/2;



Please refer the sample in the below link that illustrates the above.

http://websamples.syncfusion.com/samples/Grid.Windows/I73724/main.htm

Please let me know if you have any questions.

Regards,
Asem.


mattia locatelli
Replied On May 23, 2008 04:58 AM

Hi,
Thanks for the reply.
I'm using the PaintElement method to repaint some cells and I see that even if the grid is completly covered by another window it seems that the cells are painted ( I can see this by the CPU usage ), but if instead I use the InvalidateRange method to invalidate the cells, if the grid is covered by another window the cells are not repainted (the CPU usage is 0). What is the difference between the two ? Why with the invalidateRange method the grid doesn't repaint the hidden cell ?

>Hi ML,

Thanks for the interest in Syncfusion Grid.

It is not possible to find out the visible cell(covered by another window). But you can calculate the number of visible rows and column in a Grid. Please refer the following code snippet for more detail.


//To Calculate the number of visible rows in a Grid.
int visibleRows = this.gridControl1.ViewLayout.LastVisibleRow - this.gridControl1.TopRowIndex;
//To Calculate the number of visible columns in a Grid.
int visibleCols = this.gridControl1.ViewLayout.LastVisibleCol - this.gridControl1.LeftColIndex;
//To set the TopRowIndex for changing the Row view of the Grid.
this.gridControl1.TopRowIndex = RowIndex - visibleRows/2;
//To set the LeftColIndex for changing the Column view of the Grid.
this.gridControl1.LeftColIndex = ColIndex - visibleCols/2;



Please refer the sample in the below link that illustrates the above.

http://websamples.syncfusion.com/samples/Grid.Windows/I73724/main.htm

Please let me know if you have any questions.

Regards,
Asem.




Administrator [Syncfusion]
Replied On June 2, 2008 12:15 PM

Hi all,
is there any response to my question ?

Thanks.
ML

>Hi,
Thanks for the reply.
I'm using the PaintElement method to repaint some cells and I see that even if the grid is completly covered by another window it seems that the cells are painted ( I can see this by the CPU usage ), but if instead I use the InvalidateRange method to invalidate the cells, if the grid is covered by another window the cells are not repainted (the CPU usage is 0). What is the difference between the two ? Why with the invalidateRange method the grid doesn't repaint the hidden cell ?

>Hi ML,

Thanks for the interest in Syncfusion Grid.

It is not possible to find out the visible cell(covered by another window). But you can calculate the number of visible rows and column in a Grid. Please refer the following code snippet for more detail.


//To Calculate the number of visible rows in a Grid.
int visibleRows = this.gridControl1.ViewLayout.LastVisibleRow - this.gridControl1.TopRowIndex;
//To Calculate the number of visible columns in a Grid.
int visibleCols = this.gridControl1.ViewLayout.LastVisibleCol - this.gridControl1.LeftColIndex;
//To set the TopRowIndex for changing the Row view of the Grid.
this.gridControl1.TopRowIndex = RowIndex - visibleRows/2;
//To set the LeftColIndex for changing the Column view of the Grid.
this.gridControl1.LeftColIndex = ColIndex - visibleCols/2;



Please refer the sample in the below link that illustrates the above.

http://websamples.syncfusion.com/samples/Grid.Windows/I73724/main.htm

Please let me know if you have any questions.

Regards,
Asem.






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.

;