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
230
WinGrid and EditorControls
posted
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0cm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}

Hello,

I'm trying to get a column in WinGrid to update based on the input of another column. Both of these columns are using a WinCombo box as the EditorControl. To explain further:

I have a winGrid with a CustomerNumber column and a CustomerName column. The each column uses a ComboBox as the EditorControl. What I want to do is, when the user selects the CustomerNumber, the winGrid will update the CustomerName.

Here is where I'm at with my code:

if (WinGrid1.ActiveRow.Cells["CustNumber"].Value != WinGrid1.ActiveRow.Cells["CustName"].Value)

{

                    WinGrid1.ActiveRow.Cells["CustName"].EditorResolved.Value = WinGrid1.ActiveRow.Cells["CustNumber"].Value;

}

When I tried this, I get an error saying that the Editor is not in edit mode...so...I am trying this

if (WinGrid1.ActiveRow.Cells["CustNumber"].Value != WinGrid1.ActiveRow.Cells["CustName"].Value)

{

                   WinGrid1.ActiveRow.Cells["CustName"].EditorResolved.EnterEditMode(I don't know what to enter here);

                   WinGrid1.ActiveRow.Cells["CustName"].EditorResolved.Value = WinGrid1.ActiveRow.Cells["CustNumber"].Value;

}

 

NOTE: Both ComboBoxes have thier Value property set to CustID