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 » Prof-UIS General Discussion » SimpleGrid Collapse All
Subject Author Date
Shailesh Nikam Jul 13, 2007 - 12:50 AM

Hi,
In simpleGrid application I have created few cells which are editable and few cell has combo boxes.
1) I want to perform some validations in cell edit to find whether entered characters are valid or not. If those characters are valid then only I want to save those changes otherwise the cell should get cleared.
2) In combo box if I write few character then elements which are present in combo box should get highlighted automatically.
3) I want to insert row but inserted row should contain combo boxes and editable cell at the same position in respective columns as it appearns in above row.

Regards,
Shailesh

Technical Support Jul 13, 2007 - 11:55 AM

1) There are several virtual methods which allow you to entirely control the inplace edit.

- CExtGridCell::OnInplaceControlTextInputVerify() and CExtGridWnd::OnGridCellInplaceControlTextInputVerify() are called when the user is typing text in the in-place editor. The methods return true if the text data has a valid format; false otherwise.

- CExtGridCell::OnParseText() is called for parsing the text specified by the sText parameter.

- CExtGridCell::OnInplaceControlPreTranslateMessage() performs the message pre-translation for the in-place active editor and returns true if the message has successfully been filtered by the cell object.

Please take a look at these methods in the documentation. You can use them to implement custom parsing and filtering for the inplace editor.

virtual bool OnGridCellInplaceControlTextInputVerify(
       const CExtGridCell & _cell,
       HWND hWndInplaceControl,
       LONG nVisibleColNo,
       LONG nVisibleRowNo,
       LONG nColNo,
       LONG nRowNo,
       INT nColType,
       INT nRowType,
       __EXT_MFC_SAFE_LPCTSTR sTextInitial,
       __EXT_MFC_SAFE_LPCTSTR sTextPrevious,
       CExtSafeString & sTextNew,
       bool bEndEdit
       );
If the bEndEdit parameter is false, the method is invoked each time when the user changes text in the editor. If the bEndEdit parameter is true, the editing is complete and you can return true or false depending on whether you want to apply or cancel the results of editing. Of course, you can use this method when the editing is complete. There are also several type-specific methods of this kind:
virtual bool OnGridCellInplaceControlDateTimeInputVerify(
    const CExtGridCell & _cell,
    HWND hWndInplaceControl,
    LONG nVisibleColNo,
    LONG nVisibleRowNo,
    LONG nColNo,
    LONG nRowNo,
    INT nColType,
    INT nRowType,
    COleDateTime dtInitial,
    COleDateTime dtPrevious,
    COleDateTime & dtNew,
    bool bEndEdit
    );
virtual bool OnGridCellInplaceControlDurationInputVerify(
    const CExtGridCell & _cell,
    HWND hWndInplaceControl,
    LONG nVisibleColNo,
    LONG nVisibleRowNo,
    LONG nColNo,
    LONG nRowNo,
    INT nColType,
    INT nRowType,
    COleDateTimeSpan dtSpanInitial,
    COleDateTimeSpan dtSpanPrevious,
    COleDateTimeSpan & dtSpanNew,
    bool bEndEdit
    );
virtual bool OnGridCellInplaceControlHotKeyInputVerify(
    const CExtGridCell & _cell,
    HWND hWndInplaceControl,
    LONG nVisibleColNo,
    LONG nVisibleRowNo,
    LONG nColNo,
    LONG nRowNo,
    INT nColType,
    INT nRowType,
    DWORD dwHotKeyInitial,
    DWORD dwHotKeyPrevious,
    DWORD & dwHotKeyNew,
    bool bEndEdit
    );
virtual bool OnGridCellInplaceControlSliderInputVerify(
    const CExtGridCell & _cell,
    HWND hWndInplaceControl,
    LONG nVisibleColNo,
    LONG nVisibleRowNo,
    LONG nColNo,
    LONG nRowNo,
    INT nColType,
    INT nRowType,
    INT nPosInitial,
    INT nPosPrevious,
    INT & nPosNew,
    bool bEndEdit
    );
virtual bool OnGridCellInplaceControlIPAddressInputVerify(
    const CExtGridCell & _cell,
    HWND hWndInplaceControl,
    LONG nVisibleColNo,
    LONG nVisibleRowNo,
    LONG nColNo,
    LONG nRowNo,
    INT nColType,
    INT nRowType,
    DWORD dwIPAddressInitial,
    DWORD dwIPAddressPrevious,
    DWORD & dwIPAddressNew,
    bool bEndEdit
    );


2) Auto completion combo box cells are not supported at the moment.

3) When you insert a new row, you should manually instantiate cells in columns. Typically grid cells are instantiated inside the grid window automatically when you invoke CExtGridWnd::GridCellGet() (you specify the desired run-time class information when calling it). This method allows you to instantiate grid cells in any area of the grid window having the coordinates specified by nColNo and nRowNo.