Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
920
TemplateAddRow Combobox data source different than combobox for existing rows
posted

Hi,

 (Windows Forms application)

 I was wondering if a Combobox data source for the TemplateAddRow can be different than the corresponding column’s combo box for existing rows in the grid.  Ideally, I would like the combo box for each row in the grid to have a different datasource.

 Here is the scenario.  There are two combo boxes in the grid and other related columns.  One is filled with choices of Companies and the other is filled with choices of Contacts at Companies.

 I am using a TemplateAddRow positioned at the top of the grid.

 Adding new Records:

My first question is, can the combo box for the Template Add Row have a data source that is different than the DataSource for the existing rows in the grid.  The scenario would be for a new record, the user selects a company and the ContactID combo box in the TemplateAddRow would be populated based on the selected company.

 

Editing Existing Records:

The ideal would be for each existing row to only show the Contacts at the selected company in that row so the Editor Component would be different for each row if the company is different.

 My initial thought is to have a text box cell in the grid for the Contact Name.  When that cell gets focus, show a combo box that is filled with contacts and position that combo box over the current row / cell.  If the user selects a different contact, then I would assign the text value of the combo box to the grid cell with the contact name and finally hide the combo box.

 Is there a more straight forward way to do this with a combo box bound to the cell in the grid?

 Thanks,

NormD

 

Parents Reply Children
No Data