Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
AnswerRe: ListBox with LARGE Rows Pin
Luc Pattyn19-Jul-07 2:26
sitebuilderLuc Pattyn19-Jul-07 2:26 
GeneralRe: ListBox with LARGE Rows Pin
Sukhjinder_K19-Jul-07 2:28
Sukhjinder_K19-Jul-07 2:28 
QuestionHttpWebResponse Pin
nasambur19-Jul-07 2:12
nasambur19-Jul-07 2:12 
QuestionControl updating is slow Pin
Geert van Horrik19-Jul-07 2:05
Geert van Horrik19-Jul-07 2:05 
AnswerRe: Control updating is slow Pin
Martin#19-Jul-07 2:14
Martin#19-Jul-07 2:14 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 2:26
Geert van Horrik19-Jul-07 2:26 
GeneralRe: Control updating is slow Pin
Luc Pattyn19-Jul-07 2:31
sitebuilderLuc Pattyn19-Jul-07 2:31 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 2:48
Geert van Horrik19-Jul-07 2:48 
Indeed, that's why the splash screen is show first and uses a thread in the background to initialize all information.

It seems the control doesn't know any SuspendLayout function, but I already use the BeginUpdate and EndUpdate functions:

<br />
        public void ListData()<br />
        {<br />
            // Check if we have a valid connection string<br />
            if ((_connectionString == "") || DesignMode)<br />
            {<br />
                // Exit<br />
                return;<br />
            }<br />
<br />
            // Begin update<br />
            BeginUpdate();<br />
<br />
            // Clear current list<br />
            Items.Clear();<br />
<br />
            // Declare variables<br />
            MySqlConnection connection = null;<br />
            MySqlDataReader reader = null;<br />
<br />
            // Search for all patients<br />
            try<br />
            {<br />
                ... some code to get the reader ...<br />
<br />
                // Fill dataset with adapter<br />
                reader = command.ExecuteReader();<br />
            }<br />
            catch (Exception)<br />
            {<br />
            }<br />
<br />
            // Check if we have a valid reader<br />
            if (reader != null)<br />
            {<br />
                // Check if we found at least one patient<br />
                if (reader.HasRows)<br />
                {<br />
                    // Add all records<br />
                    while (reader.Read())<br />
                    {<br />
                        Items.Add(reader["primaryKey"].ToString());<br />
                    }<br />
                }<br />
<br />
                // Close reader<br />
                reader.Close();<br />
            }<br />
<br />
            // Check if we have a connection<br />
            if (connection != null)<br />
            {<br />
                // Close connection<br />
                connection.Close();<br />
            }<br />
<br />
            // End update<br />
            EndUpdate();<br />
        }<br />


Still, the code is way to slow (why doesn't the thing already draw itself when I ask it to).

-----
Geert

Need an advanced auto-update feature for your software? Try Updater!
Visit my website: http://www.catenalogic.com

GeneralRe: Control updating is slow Pin
Martin#19-Jul-07 3:04
Martin#19-Jul-07 3:04 
GeneralRe: Control updating is slow Pin
Luc Pattyn19-Jul-07 3:20
sitebuilderLuc Pattyn19-Jul-07 3:20 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 3:22
Geert van Horrik19-Jul-07 3:22 
GeneralRe: Control updating is slow Pin
Martin#19-Jul-07 3:24
Martin#19-Jul-07 3:24 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 3:28
Geert van Horrik19-Jul-07 3:28 
GeneralRe: Control updating is slow Pin
Martin#19-Jul-07 3:38
Martin#19-Jul-07 3:38 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 3:39
Geert van Horrik19-Jul-07 3:39 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 4:01
Geert van Horrik19-Jul-07 4:01 
GeneralRe: Control updating is slow Pin
Martin#19-Jul-07 4:13
Martin#19-Jul-07 4:13 
GeneralRe: Control updating is slow Pin
Martin#19-Jul-07 4:44
Martin#19-Jul-07 4:44 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 5:06
Geert van Horrik19-Jul-07 5:06 
GeneralRe: Control updating is slow Pin
Martin#19-Jul-07 7:02
Martin#19-Jul-07 7:02 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 21:18
Geert van Horrik19-Jul-07 21:18 
GeneralRe: Control updating is slow Pin
Martin#19-Jul-07 21:23
Martin#19-Jul-07 21:23 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 21:35
Geert van Horrik19-Jul-07 21:35 
GeneralRe: Control updating is slow Pin
Geert van Horrik19-Jul-07 21:47
Geert van Horrik19-Jul-07 21:47 
GeneralRe: Control updating is slow Pin
Martin#19-Jul-07 21:58
Martin#19-Jul-07 21:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.