Link to home
Start Free TrialLog in
Avatar of ocaccy
ocaccyFlag for Japan

asked on

C# - How to Removing Not Visible Rows From DataGridView

Hello everyone.

My environment: Windows 7 Ultimate, C#, VS2010 Ultimate, WinForm.
Target: Windows from XP to 7.
My application adds a line to a DataGridView in 1 minute intervals.
My DataGridView has 15 rows and 8 columns.
In the 16th to add data; first the DataGridView will roll up, insert a blank line and then add the data in this new line.
My question: The rolled up line of DataGridView is still in memory?
If yes, how to remove this line of the DataGridView, keeping in DataGridView memory only the data that are visible?

Thanks in advance, ocaccy
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Hi,

Can you tell us how do you bind the data/new line to DataGridView?
Avatar of ocaccy

ASKER

Hi,

private void tmr_GET_Tick(object sender,EventArgs e)
	{
	string[] row= { a_i_ler[i_C_AR, 0], a_i_ler[i_C_AR, 1], a_i_ler[i_C_AR, 2], a_i_ler[i_C_AR, 3], a_i_ler[i_C_AR, 4], a_i_ler[i_C_AR, 5], a_i_ler[i_C_AR, 6], a_i_ler[i_C_AR, 7]};
	dataGridView1.Rows.Add(row);
	}

Open in new window

Thank you,
ocaccy
ASKER CERTIFIED SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ocaccy

ASKER

Hi, Then those rows that are not seen and have no scrollbar have been deleted freeing memory?
Hi,

I did not get your last point. Can you clarify?
Avatar of ocaccy

ASKER

Thank you dear friend.