Advertisement
ASP_Volume3 Files/ File Controls/ Input/ Output #47142

DataGridView sort correctly

This code shows how to keep the current row position highlighted after a sort is done by a user on a DataGridView by clicking one of the column headers.

AI

Riepilogo AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Codice sorgente
original-source
<p><font size="1"><font size="3">Pretty much just copy and paste these functions 
in your file, I would've made a header file but don't know how yet.</font></font></p>
<p><font size="3" color="#FF0000">Note: Make sure you include the string.h or 
just #include</font></p>
<p><font size="3" color="#0000FF">Function Prototypes:<br>
</font><font size="3">string mid( int, int, string);<br>
int instr( int, string, string );<br>
string sleft( string, int );<br>
string sright( string, int );</font></p>
<p><font size="3" color="#0000FF">Function Definitions:<br>
</font><font size="3">string mid( int posStart, int intLen, string strSearch )<br>
{<br>
return strSearch.substr(posStart, intLen);<br>
}<br>
<br>
int instr(int startPOS, string strSearch, string strFind)<br>
{<br>
//return strSearch.find(strFind);<br>
return strSearch.find(strFind, startPOS);<br>
}<br>
<br>
string sleft(string strSearch, int intLen)<br>
{<br>
return strSearch.substr(0, intLen);<br>
}<br>
<br>
string sright(string strSearch, int intLen)<br>
{<br>
return strSearch.substr(strSearch.length() - intLen, intLen);<br>
}</font></p>

Upload
Commenti originali (3)
Recuperato da Wayback Machine