Raj,
The combobox will not fill if it has 'sorted' preselected in the design
process.
--------------------
Thread-Topic: I can't sort my combo box. Please Help!
thread-index: AcS/xvw8xLfcJGSzQJKvGzE1Rk/XNQ==
X-WBNR-Posting-Host: 203.28.214.209
From: =?Utf-8?B?cmFq?= <ra*@discussions.microsoft.com>
Subject: I can't sort my combo box. Please Help!
Date: Sun, 31 Oct 2004 19:58:02 -0800
Lines: 24
Message-ID: <0F**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.general
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.general:150745
X-Tomcat-NG: microsoft.public.dotnet.general
When I try to sort my combo box I get the following error.
"Cannot sort a ComboBox that has a DataSource set. Sort the data using the
underlying data model."
--------------------------------THe code is given below.
String strSQL;
strSQL = "SELECT .......... WHERE C.Client = '" +
this.cboClient.SelectedValue + "' ";
userTable = manager.GetDataTable(strSQL,"userList");
cmbUserList.DataSource = userTable;
cmbUserList.DisplayMember = "FollowUpPerson";
cmbUserList.ValueMember = "FollowUpPerson";
cmbUserList.SelectedIndex = -1;
cmbUserList.Sorted = true;
------------------------------------------------
I do really appreciate any ideas or sugessions.
Thanks
raj
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl {\f0\fnil\fprq2\fcharset0
MS Sans Serif;}{\f1\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.21.2500;}\viewkind4\uc1\pard\f0\fs20 Cheers,\par
\par
johnKn [MS-SDK]\par
\par
\par
\par
-Please do not send email directly to this alias. This alias is for \par
newsgroup purposes only\par
\par
-This posting is provided "AS IS" with no warranties, and confers no
rights.\par
\par
-To provide additional feedback about your community experience please send
\par
e-mail to:
sd*****@microsoft.com\par
\f1\par
}