Click here to Skip to main content
15,888,803 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionCopy Content from Word Docuemnt to RichBox Pin
Peace4all2-Feb-12 17:50
Peace4all2-Feb-12 17:50 
AnswerRe: Copy Content from Word Docuemnt to RichBox Pin
Wayne Gaylard2-Feb-12 19:19
professionalWayne Gaylard2-Feb-12 19:19 
Questionshow/hide datagridview rows by setting trackbar value Pin
bezkintos2-Feb-12 14:09
bezkintos2-Feb-12 14:09 
AnswerRe: show/hide datagridview rows by setting trackbar value Pin
Luc Pattyn2-Feb-12 15:07
sitebuilderLuc Pattyn2-Feb-12 15:07 
GeneralRe: show/hide datagridview rows by setting trackbar value Pin
bezkintos3-Feb-12 11:51
bezkintos3-Feb-12 11:51 
GeneralRe: show/hide datagridview rows by setting trackbar value Pin
Alan N3-Feb-12 13:01
Alan N3-Feb-12 13:01 
GeneralRe: show/hide datagridview rows by setting trackbar value Pin
bezkintos3-Feb-12 14:43
bezkintos3-Feb-12 14:43 
AnswerRe: show/hide datagridview rows by setting trackbar value Pin
Luc Pattyn4-Feb-12 3:30
sitebuilderLuc Pattyn4-Feb-12 3:30 
Hi,

I looked somewhat closer, and I now think the bottleneck is you store your data as text inside TextBoxes, so all filtering requires a continuous stream of string-to-long conversions.

I performed an experiment (in C#) with a proper DataTable+DataGridView+BindingSource setup, and it works fluently. Here is the gist of it:

namespace WindowsFormsApplication1 {
	public partial class Form1 : Form {
		BindingSource binding;
		public Form1() {
			InitializeComponent();
		}

		private void Form1_Load(object sender, EventArgs e) {
			DataTable table=new DataTable();
			table.Columns.Add("Date", typeof(DateTime));
			table.Columns.Add("Long", typeof(long));
			Random r=new Random();
			for(int i=0; i<5000; i++) {
				table.Rows.Add(new DateTime(2011, r.Next(1,12), r.Next(1,28)), r.Next(0,40));
			}
			binding=new BindingSource();
			binding.DataSource=table;
			dgv.DataSource=binding;
		}

		private void trb_ValueChanged(object sender, EventArgs e) {
			long min=trb.Value;
			binding.Filter="Long >= "+min;
			label1.Text = "Only rows with Long >= " + min + " are visible";
		}
	}
}


Also, by using the BindingSource, it is Microsoft's responsibility to make it snappy, and I guess they did it right.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.

GeneralRe: show/hide datagridview rows by setting trackbar value Pin
bezkintos4-Feb-12 6:22
bezkintos4-Feb-12 6:22 
AnswerRe: show/hide datagridview rows by setting trackbar value Pin
Luc Pattyn4-Feb-12 6:43
sitebuilderLuc Pattyn4-Feb-12 6:43 
GeneralRe: show/hide datagridview rows by setting trackbar value Pin
bezkintos4-Feb-12 7:51
bezkintos4-Feb-12 7:51 
AnswerRe: show/hide datagridview rows by setting trackbar value Pin
Luc Pattyn4-Feb-12 8:02
sitebuilderLuc Pattyn4-Feb-12 8:02 
GeneralRe: show/hide datagridview rows by setting trackbar value Pin
bezkintos4-Feb-12 8:34
bezkintos4-Feb-12 8:34 
AnswerRe: show/hide datagridview rows by setting trackbar value Pin
Luc Pattyn4-Feb-12 9:19
sitebuilderLuc Pattyn4-Feb-12 9:19 
Questionhaving trouble replacing Trademark and Registered symbol with Regex Pin
David Mujica2-Feb-12 6:18
David Mujica2-Feb-12 6:18 
AnswerRe: having trouble replacing Trademark and Registered symbol with Regex Pin
Luc Pattyn2-Feb-12 9:05
sitebuilderLuc Pattyn2-Feb-12 9:05 
QuestionADO.net Pin
Amanjot1-Feb-12 12:09
Amanjot1-Feb-12 12:09 
AnswerRe: ADO.net Pin
Eddy Vluggen1-Feb-12 12:21
professionalEddy Vluggen1-Feb-12 12:21 
QuestionCreate a unique Id for each row of table Pin
Seema Bawa1-Feb-12 8:19
Seema Bawa1-Feb-12 8:19 
AnswerRe: Create a unique Id for each row of table Pin
Simon_Whale1-Feb-12 12:16
Simon_Whale1-Feb-12 12:16 
JokeRe: Create a unique Id for each row of table Pin
Eddy Vluggen1-Feb-12 12:30
professionalEddy Vluggen1-Feb-12 12:30 
GeneralRe: Create a unique Id for each row of table Pin
Simon_Whale1-Feb-12 21:58
Simon_Whale1-Feb-12 21:58 
AnswerRe: Create a unique Id for each row of table Pin
RobCroll1-Feb-12 16:14
RobCroll1-Feb-12 16:14 
QuestionCreate a unique Id for Rows Pin
Seema Bawa1-Feb-12 7:58
Seema Bawa1-Feb-12 7:58 
AnswerRe: Create a unique Id for Rows Pin
Eddy Vluggen1-Feb-12 8:16
professionalEddy Vluggen1-Feb-12 8:16 

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.