Hello,
I'm doing a Windows c# app and I on the FormLoad() event I need to set a combo boxes selected item based on a value I pass it. I load the value from the database, it exists in the combo box as a value, so I need to set the combo box to display this value without it being manually selected.
I've done this before in VB.NET, but can't seem to make it work in C#. Here is the vb code that maybe one of you could translate into the C# version:
dim intVal as Int16 = (value)
Me.cboRPSDept.Items.Item(cboRPSDept.Items.IndexOf(cboRPSDept.Items.FindByValue(intVal))).Selected() = True
Any help with this would be appreciated.
John
I'm doing a Windows c# app and I on the FormLoad() event I need to set a combo boxes selected item based on a value I pass it. I load the value from the database, it exists in the combo box as a value, so I need to set the combo box to display this value without it being manually selected.
I've done this before in VB.NET, but can't seem to make it work in C#. Here is the vb code that maybe one of you could translate into the C# version:
dim intVal as Int16 = (value)
Me.cboRPSDept.Items.Item(cboRPSDept.Items.IndexOf(cboRPSDept.Items.FindByValue(intVal))).Selected() = True
Any help with this would be appreciated.
John