Arsip: Sorting pada Stringgrid????

more 15 years ago
akudana
Bagaimana caranya untuk sorting pada stringgrid?? contoh programnya.... mohon bantuannya...

more 15 years ago
elva_ivana
Code ini diambil dari salah satu tutorial ... monggo di kembangkan lagi sesuai keinginan
procedure SortStringGrid(var GenStrGrid: TStringGrid; ThatCol: integer);
const
// Define the Separator
TheSeparator = '@';
var
CountItem, I, J, K, ThePosition: integer;
MyList: TStringList;
MyString, TempString: string;
begin
// Give the number of rows in the StringGrid
CountItem := GenStrGrid.RowCount;
//Create the List
MyList := TStringList.Create;
MyList.Sorted := False;
try
begin
for I := 1 to (CountItem - 1) do
MyList.Add(GenStrGrid.Rows[I].Strings[ThatCol] + TheSeparator +
GenStrGrid.Rows[I].Text);
//Sort the List
Mylist.Sort;
for K := 1 to Mylist.Count do
begin
//Take the String of the line (K – 1)
MyString := MyList.Strings[(K - 1)];
//Find the position of the Separator in the String
ThePosition := Pos(TheSeparator, MyString);
TempString := '';
{Eliminate the Text of the column on which we have sorted the StringGrid}
TempString := Copy(MyString, (ThePosition + 1), Length(MyString));
MyList.Strings[(K - 1)] := '';
MyList.Strings[(K - 1)] := TempString;
end;
// Refill the StringGrid
for J := 1 to (CountItem - 1) do
GenStrGrid.Rows[J].Text := MyList.Strings[(J - 1)];
end;
finally
//Free the List
MyList.Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
// Sort the StringGrid1 on the second Column
SortStringGrid(StringGrid1, 1);
end;

more 15 years ago
elva_ivana
walah... pengen instant to' ....
pake ADVStringgrid dari TMS atau QuantumGrid dari DevEx ....

more 15 years ago
DelphiExpert
@akudana: rumit mas yang simpel ada nggak........haha seperti biasa... yang simple bayar programmer aja wakaka... simple tinggal pencet tombol kombinasi key-dongle :mrgreen:

more 15 years ago
elva_ivana
@DelphiExpert:wakkakakak.. serahin aja ama mbah @DE, pasti lebih simple and cepet ... wakakakak trus jangan lupa bilang Terima kasih Mamah,kakak,bapak semua@akudana: rumit mas yang simpel ada nggak........haha seperti biasa... yang simple bayar programmer aja wakaka... simple tinggal pencet tombol kombinasi key-dongle :mrgreen:
more ...
- Pages:
- 1
reply |
Report Obsolete
AI Forward

🚀 We're thrilled to partner with Alibaba Cloud for "AI Forward - Alibaba Cloud Global Developer Summit 2025" in Jakarta! Join us and explore the future of AI. Register now:
https://int.alibabacloud.com/m/1000400772/
#AlibabaCloud #DeveloperSummit #Jakarta #AIFORWARD
Last Articles
Last Topic
- PascalTalk #6: (Podcast) Kuliah IT di luar negeri, susah gak sih?
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #5: UX: Research, Design and Engineer
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #4: Obrolan Ringan Seputar IT
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #2: Membuat Sendiri SMART HOME
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #3: RADically Fast and Easy Mobile Apps Development with Delphi
by LuriDarmawan in Tutorial & Community Project more 4 years ago - PascalTalk #1: Pemanfaatan Artificial Intelligence di Masa Covid-19
by LuriDarmawan in Tutorial & Community Project more 4 years ago - Tempat Latihan Posting
by LuriDarmawan in OOT more 5 years ago - Archive
- Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - [ask] koneksi ke ODBC user Dsn saat runtime dengan ado
by halimanh in FireBird more 12 years ago - Validasi menggunakan data tanggal
by mas_kofa in Hal umum tentang Pascal Indonesia more 12 years ago
Random Topic
- Bagaimana cara menghapus informasi window dari memory ?
by stoopid in Tip n Trik Pemrograman more 18 years ago - MASA DEPAN DELPHI
by rusli_chow in Hal umum tentang Pascal Indonesia more 17 years ago - Tanya: Membuat Angka Terbilang ?
by cyber_hecker in Tip n Trik Pemrograman more 19 years ago - Mikrokontroller + Delphi program
by Byanto in Enginering more 17 years ago - Looping lagi...
by idhiel in Hal umum tentang Pascal Indonesia more 12 years ago - transparant form
by unknown in Form Enhancement & Graphical Controls more 16 years ago - database (suspect) ???
by flamade in MsSQL more 17 years ago - buat program chatting
by rahul_cayang in Hal umum tentang Pascal Indonesia more 17 years ago - [?] Bagaimana Cara Remote MySQL
by babypigs in MySQL more 17 years ago - Delphi 2007 for PHP
by juan81 in Delphi.NET more 17 years ago