Jhan Zaib

Hi,
i need a feature in DataGridView as other third party grids have like Flex Grid of Component One has.
So, if anyone knows its solution or any idea please reply

Thanks & Regards
Jhan Zaib



Re: Windows Forms Data Controls and Databinding KeyDown Search in DataGridView


Re: Windows Forms Data Controls and Databinding KeyDown Search in DataGridView

Jhan Zaib

Hi,
Yes, its also helpful... but i am looking just searching in the grid not filteration...

KeyDown Search

In this kind of search cursor just reach at matched position in selected column.
For achieving this i am working on writing an algorithm needed on which keydown event
combine typed characters and search it in selected column and jump at matched position either by scrolling or not. It just match string from left or start not in between.

So anyone, already done work for such kind.. please share.

Thanks and Regards
Jhan Zaib






Re: Windows Forms Data Controls and Databinding KeyDown Search in DataGridView

Zhi-Xin Ye - MSFT

try:

Code Snippet

DataTable dt = new DataTable();

BindingSource bs = new BindingSource();

private void Form1_Load(object sender, EventArgs e)

{

dt.Columns.Add("ID");

dt.Columns.Add("Name");

dt.Rows.Add(0, "ddd");

dt.Rows.Add(0, "aaa");

dt.Rows.Add(0, "adsd");

dt.Rows.Add(0, "dfdg");

dt.Rows.Add(0, "vdesd");

bs.DataSource = dt.DefaultView;

this.dataGridView1.DataSource = bs;

this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

}

private void button1_Click(object sender, EventArgs e)

{

this.bs.Position = bs.Find("Name", this.textBox1.Text);

}






Re: Windows Forms Data Controls and Databinding KeyDown Search in DataGridView

Jhan Zaib

Hi,
No doubt, you suggest a better solution, but as i stated in the beginning of the post, i am finding a solution for key down search (available C1 Flex Grid) this is very helpful for any kind of search in the grid. I also try your solution on keydown event of DataGridView but no success.
So please find solution in this regard

Thanks & Regards
Jhan Zaib