|
-
Feb 6th, 2006, 07:31 AM
#1
Thread Starter
Frenzied Member
combo box, datagrid problem
Hello
When l change the value of the combo box, as soon as the combo box loses focus the value will change to the value it was before. The new value does not remain. Has this got something to do with the edit options of the datagrid. I am not sure.
The only way l have solved this problem is to save the new value to the database, and then fill the datagrid from database again with the new. This has to be done everytime the user changes the combo box value.
The way l would like this to work is for the user to change the values in the combo boxes, and have the value remain. When they have finished, they can save everything to the database.
I hope you can help me with this project again. I have the code below that inserts the combo box into the datagrid.
Code:
if ( !this.grdCustomerProducts.TableStyles.Contains("Product") )
{
DataGridTableStyle grdTblStyle = new DataGridTableStyle();
grdTblStyle.MappingName = dt.TableName;
grdCustomerProducts.TableStyles.Add(grdTblStyle);
GridColumnStylesCollection colStyle;
colStyle = grdCustomerProducts.TableStyles["Product"].GridColumnStyles;
colStyle[0].Width = 150;
DataGridTextBoxColumn dgtb = (DataGridTextBoxColumn)grdCustomerProducts.TableStyles["Product"].GridColumnStyles[2];
dgtb.TextBox.Controls.Add(cmbQuantities);
}
Thanks for you help in advance,
Steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|