Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
ZTE MF283U 4G Unlocked Router (Used)
ayanthamaxi
Updated:
Sunday at 8:26 PM
ලංකාවේ හොඳම උපකාරක පන්ති සහ ගුරුවරුන් එකම තැනකින් - TopTuition.lk
dulithapathum
Updated:
Saturday at 8:07 AM
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Jul 15, 2026
Ad icon
Colombo
PXN V10 Pro Direct Drive Racing Wheel (Under Warranty)
Abdur Rahman
Updated:
Jul 15, 2026
Ad icon
USDT ණය සේවාව - USDT Loan Service
පුරවැසියා
Updated:
Jul 15, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
C#
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="BoraluGoda" data-source="post: 16699665" data-attributes="member: 332053"><p><strong><span style="font-size: 15px">can anyone tell me how use bubble sorting algorithm to sort data dataGridView.</span></strong></p><p></p><p>below shown my code which i use to add data to grid.<img src="/styles/default/xenforo/smilies/default/happy.gif" class="smilie" loading="lazy" alt=":)" title="Happy :)" data-shortname=":)" /></p><p></p><p>[CODE]List<STUDENT> student_list = new List<STUDENT>(); </p><p> private void btnAddToGroup_Click(object sender, EventArgs e)</p><p> {</p><p> if (dataGridView1.SelectedRows.Count > 4 || dataGridView1.SelectedRows.Count < 2)</p><p> {</p><p> MessageBox.Show( "The Selected row count should be < 4 or > 2,\n Please try again");</p><p> }</p><p> else</p><p> {</p><p> //gridDesignGroup();</p><p> for (int i = 0; i < dataGridView1.SelectedRows.Count; i++)</p><p> {</p><p> STUDENT stuObj = new STUDENT();</p><p> stuObj.groupID = txtGID.Text;</p><p> stuObj.stuId = dataGridView1.SelectedRows[i].Cells[0].Value.ToString();</p><p> stuObj.stuFirstName = dataGridView1.SelectedRows[i].Cells[1].Value.ToString();</p><p> stuObj.stuLastName = dataGridView1.SelectedRows[i].Cells[2].Value.ToString();</p><p> stuObj.stuEmail = dataGridView1.SelectedRows[i].Cells[3].Value.ToString();</p><p> student_list.Add(stuObj);</p><p> BindingSource bind = new BindingSource();</p><p> bind.DataSource = student_list;</p><p> dataGridView2.DataSource = bind;</p><p></p><p> }</p><p></p><p> foreach (DataGridViewRow r in dataGridView1.SelectedRows)</p><p> {</p><p> dataGridView1.Rows.Remove(r);</p><p> }</p><p> </p><p> }</p><p> }[/CODE]</p></blockquote><p></p>
[QUOTE="BoraluGoda, post: 16699665, member: 332053"] [B][SIZE="4"]can anyone tell me how use bubble sorting algorithm to sort data dataGridView.[/SIZE][/B] below shown my code which i use to add data to grid.:) [CODE]List<STUDENT> student_list = new List<STUDENT>(); private void btnAddToGroup_Click(object sender, EventArgs e) { if (dataGridView1.SelectedRows.Count > 4 || dataGridView1.SelectedRows.Count < 2) { MessageBox.Show( "The Selected row count should be < 4 or > 2,\n Please try again"); } else { //gridDesignGroup(); for (int i = 0; i < dataGridView1.SelectedRows.Count; i++) { STUDENT stuObj = new STUDENT(); stuObj.groupID = txtGID.Text; stuObj.stuId = dataGridView1.SelectedRows[i].Cells[0].Value.ToString(); stuObj.stuFirstName = dataGridView1.SelectedRows[i].Cells[1].Value.ToString(); stuObj.stuLastName = dataGridView1.SelectedRows[i].Cells[2].Value.ToString(); stuObj.stuEmail = dataGridView1.SelectedRows[i].Cells[3].Value.ToString(); student_list.Add(stuObj); BindingSource bind = new BindingSource(); bind.DataSource = student_list; dataGridView2.DataSource = bind; } foreach (DataGridViewRow r in dataGridView1.SelectedRows) { dataGridView1.Rows.Remove(r); } } }[/CODE] [/QUOTE]
Insert quotes…
Verification
Hathara warak wissa keeyada? (Hathara wadi karanna 20)
Post reply
Top
Bottom