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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridControl - some general questions

Thread ID:





104495 Jul 24,2012 02:07 PM UTC Aug 2,2012 07:46 AM UTC WPF 1
Tags: GridControl
xi wang
Asked On July 24, 2012 02:07 PM UTC


I have got some general questions regards to your GridControl.

1. Is there any way to obtain the current in view row and column index ranges by calling one function for once?

2. What should I do if I want to bring a line into view

3. When InvalidateCells is called, what does it do internally and which part of work is on the Dispatcher thread, which is not? The main reason why I am asking this question is because InvalidateCells is returned immediately after it is called then QueryCellInfo is fired. I feel there are gaps in between, which causes the command binding in the DataTemple which associated with the cells are not fired on user actions (e.g. a button binding to some ICommand in the DataTemplate, when the InvalidateCells are called frequently with very small intervals, the command sometimes is not fired when I click it)  


Kathirvel P [Syncfusion]
Replied On August 2, 2012 07:46 AM UTC

Hi Xi Wang,
Thanks for using Syncfusion Products.
Regarding query 1:
You can get the visible rows and columns range from the grid by using the method GridControl.ScrollRows.GetVisibleLines(). This method will return visible line collections from grid. From this VisibleLinesCollection we can get the line index for the particular visible index.
Please refer the following snipped.
Code Snipped[C#]
// To get the visible rows and columns.
VisibleLinesCollection visibleRows = grid.ScrollRows.GetVisibleLines();
VisibleLinesCollection visibleColumns = grid.ScrollColumns.GetVisibleLines();
int top = visibleRows[visibleRows.FirstBodyVisibleIndex].LineIndex;
int left = visibleColumns[visibleColumns.FirstBodyVisibleIndex].LineIndex;
int bottom = visibleRows[visibleRows.LastBodyVisibleIndex].LineIndex;
int right = visibleColumns[visibleColumns.LastBodyVisibleIndex].LineIndex;
Regarding query 2:
You can achieve this requirement by using the GridControl.ScrollInView() method. This method will bring the specified row column index cell in to view.
Code Snipped[C#]
// To bring cell in to view.
RowColumnIndex rowColumnIndex = new RowColumnIndex(1,3);
Regarding query 3:
InvalidateCells marks the cells a dirty flag. If the invalidated cell is in view then it will trigger the QueryCellInfo while arranging the cells. In case the cells which are not in view is invalidated, the dirty flag is set to the particular cells, but the QueryCellInfo trigger when those cells brought to view.
Please let us know if this helps.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

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