nirz
  • nirz
  • Newbie Topic Starter
2011-11-22T14:50:02Z
Hi,
I'm using the igrid 4.7 demo version (for now) and I've added to my form a ComboBox.
The problem is that i need to be able to manually write to the box (if needed)
This way i can either write the parameter myself or choosing it from the optional parameters

You're help will be most appreciated

thanks
Igor/10Tec
2011-11-23T08:15:27Z
Originally Posted by: nirz 

I've added to my form a ComboBox.
The problem is that i need to be able to manually write to the box (if needed)



It sounds like you have a separate (from iGrid) combobox. Did you mean that, or you are talking about combobox cells inside iGrid?

Originally Posted by: nirz 


I'm using the igrid 4.7



iGrid 5.0 with great new improvements was published, so we'd recommend that you use it for your development ๐Ÿ™‚
nirz
  • nirz
  • Newbie Topic Starter
2011-11-24T05:40:55Z
I am talking about combobox cells inside iGrid...
Igor/10Tec
2011-11-24T06:30:09Z
In iGrid ActiveX, you can only use the values from the drop-down lists attached to cells if talk about the built-in cell types.

To do what you need, you should use an external control to edit the iGrid cells. An example of that is in our online extra samples library for iGrid:

http://www.10tec.com/Products/ActiveX/iGrid/Extra_Samples.aspx 

See the Custom Editing with DateTimePicker sample - it gives you the main idea of how to use external controls to edit the iGrid cells.
nirz
  • nirz
  • Newbie Topic Starter
2011-11-27T13:10:03Z
Thanks for the replay,
but the example given is for Visual Studio, and i'm using excel...
How can i implement the same thing in VB?

thanks
Igor/10Tec
2011-11-28T08:05:14Z
Now clear.
You can see the source code of the sample if you open the form module (Form1.frm) like a text file in any editor like Notepad. In fact, all the main work is done in the RequestEdit event of the grid. You simply prohibit the built in editing and place your custom control over the current cell:

Private Sub iGrid1_RequestEdit(ByVal lRow As Long, ByVal lCol As Long, ByVal iKeyAscii As Integer, bCancel As Boolean, sText As String, lMaxLength As Long, eTextEditOpt As iGrid300_10Tec.ETextEditFlags)
   Dim lLeft As Long, lTop As Long, lWidth As Long, lHeight As Long
   
   m_lEditRow = lRow
   m_lEditCol = lCol
   
   ' Disabling the built-in editor
   bCancel = True
   
   ' Calculating the position of the current cell
   iGrid1.CellBoundary lRow, lCol, lLeft, lTop, lWidth, lHeight
   
   ' Moving DateTimePicker to the current cell
   ' Important! CellBoundary returns coordinates in pixels.
   ' We add 2 pixels to take into account iGrid border
   ' (2 pixels from each side for the default 3D border)
   DTPicker1.Move _
      iGrid1.Left + (lLeft + 2) * Screen.TwipsPerPixelX, _
      iGrid1.Top + (lTop + 2) * Screen.TwipsPerPixelY, _
      (lWidth - 1) * Screen.TwipsPerPixelX, _
      (lHeight - 1) * Screen.TwipsPerPixelY
   
   ' Setting the value of the external control
   DTPicker1.Value = iGrid1.CellValue(lRow, lCol)
   
   ' Activating the DateTimePicker control
   DTPicker1.Visible = True
   DTPicker1.SetFocus
End Sub

If you encounter any troubles with implementing this in Excel, you can send us your project to the tech support address, and we'll help you to finish it.