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.

Finding cell position by given cell value

Thread ID:

Created:

Updated:

Platform:

Replies:

43742 May 2,2006 09:47 AM May 3,2006 01:53 AM Windows Forms 1
loading
Tags: GridControl
Georgi Kashev
Asked On May 2, 2006 09:47 AM

Hello, In my application the GridContol receives custom type objects as cell values. The objects store the real data inside. The grid then displays the string representation of the objects (object.ToString()), which is formed regarding to the real data. The cell value objects in the cells remain unchanged during the lifetime of the grid. What is changed (and it is changed asynchronous) is the inside data in the value objects (and of course the string representation). This works fine but unfortunately there is a big problem. It is essential for the program logic to be able to get the cell coordinates by given cell value object (not the GridStyleInfo but only the object stored as GridStyleInfo.CellValue). This turns to be quite tricky. I have tried to provide the GridStyleInfo object as a Parent to the cell value objects (my custom type is named GridCell). The GridCell stores the GridStyleInfo parent in itself and gets the cell positon like this: this.position = Parent.CellIndentity.CellPos. This doesn''t work... The GridStyleInfo objects are volatile. New GridStyleInfo objects seem to be created everytime the QueryCellInfo event is rised and the Parent that is stored in the GridCell becomes fake. Setting the newly created GridStyleInfo as a GridCell.Parent in OnQueryCellInfo does not help, because this event is rised only for the visible cells. So the Parent will remain fake until the cell is scrolled into the visible area. Not to mention that the VolatileData cache makes the situation even more complicated. Next I have tried to update all cell value objects by providing them their new position everytime a row or column is added, removed or moved. It works but too slow. My question is: is there a way to get the cell position when having only the cell value (not the entire GridStyleInfo)?

Administrator [Syncfusion]
Replied On May 3, 2006 01:53 AM

Hi Georgi, Do you need the Primary Column Search? if so, there is no built-in searching facility in the grid. You will have to write your own. If you want to search the row by the primary key column then you can generate the key column as per your requirement and add it to the GridControl. Then find the text in the Key Column using the attached sample. It might be fairly quick to do this. Here is a sample that has a fast way of searching text by moving it to an arraylist. Here is a sample. http://www.syncfusion.com/Support/user/uploads/gridFindDialog_7f73eb32.zip Also refer the forum thread for more details. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=4509 Thanks for Choosing Syncfusion Products. Best Regards, Haneef

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.

;