Katalogerna
PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


phGantTimePackage FAQ 10160


How can I fill a comboBox for a Column? Please note that this article refers to the phGantTimePackage
Jump to article- 2006-09-29 11:54:00 - Email plexityHide

Question

I must provide custom values from DB to a grid columm, so my users can choose one. This list can change over time.
VCL edition.
Thanks.

Answer

The inplace-edit-combobox often must have different values depending on what column or row it pops up.

There is an event that fires just before the edit starts. In this event you may change the content in the combobox depending on focused cell.

In the phGantTimePackage OCX this event is called IphGantX3.OnBeforeCanEditGrid
You the call IphGantX3.GridEditComboClear and IphGantX3.GridEditComboAdd

In the phGantTimePackage VCL this event is called phGant.Grid.OnEditorCanModify, but there is another event that only fires when a combo edit is started: phGant.Grid.OnBeforeEditWithCombo.
You can then use phGant.Grid.InitEditCombo to update values

In GTP.NET the event is called Gantt.Grid.OnBeforeEditCell, and you can fill the combobox with data like this:

private void grid1_OnBeforeEditCell(PlexityHide.GTP.Grid grid, PlexityHide.GTP.BeforeEditEventArgs beforeEdit)
{

  if (beforeEdit.Cell.Content is ComboText)
  {
    (beforeEdit.Cell.Content as ComboText).EditBox.Items.Clear();
    (beforeEdit.Cell.Content as ComboText).EditBox.Items.Add("Item 1");
    (beforeEdit.Cell.Content as ComboText).EditBox.Items.Add("Item 2");
    (beforeEdit.Cell.Content as ComboText).EditBox.Items.Add("Item 3");
    (beforeEdit.Cell.Content as ComboText).EditBox.Items.Add("Item 4");
  }

}

 

 

Google
WWW plexityHide phGantTimePackage FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ general

Testimonials

"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%"
Gaurav Patole,
WebTechDevelopers
More testimonials...