Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Grid Tech Support » Retrieve grid corresponding row for a given cell Collapse All
Subject Author Date
Mirea Catalin Nov 5, 2008 - 1:13 AM

Hello,


I have a couple of situations where i have a cell pointer and i need to retrive the coresponding grid row or column.


Example:


CExtGridCell* pCell;


Is there anything like this?


    int rowNb = m_wndGrid->GetCellRow(pCell);


If this functionality is not  supported maybe there is an
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="Word.Document" name="ProgId" />
<meta content="Microsoft Word 11" name="Generator" />
<meta content="Microsoft Word 11" name="Originator" />
<link href="file:///C:\DOCUME~1\CATALI~1.MIR\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml" rel="File-List" /><!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:PunctuationKerning />
<w:ValidateAgainstSchemas />
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables />
<w:SnapToGridInCell />
<w:WrapTextWithPunct />
<w:UseAsianBreakRules />
<w:DontGrowAutofit />
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]--><style type="text/css">
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
    {mso-style-parent:"";
    margin:0cm;
    margin-bottom:.0001pt;
    mso-pagination:widow-orphan;
    font-size:12.0pt;
    font-family:"Times New Roman";
    mso-fareast-font-family:"Times New Roman";}
@page Section1
    {size:612.0pt 792.0pt;
    margin:72.0pt 90.0pt 72.0pt 90.0pt;
    mso-header-margin:35.4pt;
    mso-footer-margin:35.4pt;
    mso-paper-source:0;}
div.Section1
    {page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->workaround. (I’m trying with HitTest function but no luck)


Tx

Technical Support Nov 6, 2008 - 1:05 PM

The CExtGridWnd grid control does not contain any grid cells. It only allows grid cells to be painted, hit-tested, edited, resized and etc. All the grid controls are stored in a data provider component, which is internal and invisible. This architecture is similar to MFC’s document/view architecture. The grid control is like a view window and the data provider is like a document. It’s possible to make more than one grid control using the same data provider containing the same two dimensional array of grid cells. So, the grid cells does not know anything about their location inside grid window. The grid cells even don’t know whether they are displayed at least in one grid window. That is why most of methods in grid cell classes have parameters with pointer/reference to grid control and row/column numbers. As a result, if a grid cell class is notified about anything via some of its virtual methods, this method knows grid window pointer/reference, cell coordinates and other/additional event information via method parameters. The same is related to virtual methods of CExtGridWnd class. Your code always knows where is the grid cell located and which event happened.

Please note: your question should have been posted to either of the following forums rather than to this forum (.NET Elegant Grid):

http://www.prof-uis.com/prof-uis/tech-support/support-forum.aspx
http://www.prof-uis.com/prof-uis/tech-support/general-forum.aspx



Mirea Catalin Nov 5, 2008 - 1:16 AM

Sorry for the previous post. It should look like this:

Hello,

I have a couple of situations where i have a cell pointer and i need to retrive the coresponding grid row or column.

Example:

CExtGridCell* pCell;

Is there anything like this?

int rowNb = m_wndGrid->GetCellRow(pCell);

If this functionality is not supported maybe there is an workaround. (I’m trying with HitTest function but no luck)
Tx