This is a migrated thread and some comments may be shown as answers.

Focus a filter box by program

15 Answers 305 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pedro Valero Matas
Top achievements
Rank 1
Pedro Valero Matas asked on 08 Nov 2010, 03:59 PM
I use RadGridView ver 8.2.0.0 (2008 Q3) with VB.NET 2010 and i need set the focus in a filter box for a column. How i make this?

Sorry for my english, i'm spanish

15 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 08 Nov 2010, 04:09 PM
Hola Pedro,

Hay una pagina aqui que espero que te ayuda
richard

--------------------------------
Hi Pedro,

There is a link here that should help
Let me know if you need further help

richard
0
Pedro Valero Matas
Top achievements
Rank 1
answered on 08 Nov 2010, 04:37 PM
Solucionado. Muchas gracias :-)
0
Richard Slade
Top achievements
Rank 2
answered on 08 Nov 2010, 04:57 PM
Glad this helped, Pedro.

Please remember to mark as answer so others can find the solution too.

Saludos,
Richard
0
Andrew Shyliuk
Top achievements
Rank 1
answered on 16 Nov 2010, 04:45 PM
Hello,

I have a same problem in version Q3 2010. This code
this.radGridView1.MasterGridViewInfo.TableFilteringRow.Cells[0].BeginEdit();
doesn't solve problem in general:
1) Cursor for editing does not move me in the right filter cell. Only when I start typing cursor moves.
2) This doesn't work at all if grid has many cells and filter cell is outside the scope (for example when I scroll to the opposite part of the form).

Have any more ways to solve this problem?

Best regards,
Andrew Shyliuk
0
Richard Slade
Top achievements
Rank 2
answered on 16 Nov 2010, 04:58 PM
Hello Andrew,

the same code for the later version of RadGridView is:
this.radGridView1.TableElement.ViewInfo.TableFilteringRow.Cells[0].BeginEdit();

Have you already tried this?
Richard
0
Andrew Shyliuk
Top achievements
Rank 1
answered on 16 Nov 2010, 06:26 PM
Hello, Richard

Yes I tried it just now and got the same result. It doesn't work as I need.

Best regards,
Andrew Shyliuk.
0
Richard Slade
Top achievements
Rank 2
answered on 16 Nov 2010, 06:29 PM
Hi Andrew,

To confirm what you wish to do:
+ After setting a filter cell to edit, you wish to place the cursor in that cell
+ When you set to filter, you wish to auto scroll back to the top of the form

Is this correct?
Thanks
Richard
0
Andrew Shyliuk
Top achievements
Rank 1
answered on 17 Nov 2010, 09:38 AM
Hello, Richard

>+ After setting a filter cell to edit, you wish to place the cursor in that cell
Yes

>+ When you set to filter, you wish to auto scroll back to the top of the for
Not to the top. I updating data source when user change filter and I want to scroll horizontally back to the cell.

Best regards,
Andrew Shyliuk
0
Richard Slade
Top achievements
Rank 2
answered on 17 Nov 2010, 10:18 AM
Hi Andrew,

Where are you calling the code from to put the filter cell into edit mode? Please can you try this (if you haven't already) from, for exmaple a button click event. The cursor should be placed in the filter cell correctly.

Please also take a look at this link regarding scrolling in the RadGridView programatically

Thanks
Richard
0
Andrew Shyliuk
Top achievements
Rank 1
answered on 17 Nov 2010, 11:28 AM
Hello, Richard

Cursor is works, thanks. I have 1 more question. How can I remember old scroll position to back it to this position? Fro example this.radGridView1.GridElement.ScrollTo(oldRowPosition, oldColumnPosition);

Best regards,
Andrew Shyliuk
0
Richard Slade
Top achievements
Rank 2
answered on 17 Nov 2010, 12:20 PM
Hi Andrew,

You could capture the row index on the SelectionChanged event using
Me.RadGridView.CurrentRow
store this in a local variable and then scroll back to that row, column 0

Hope that helps
Richard
0
Andrew Shyliuk
Top achievements
Rank 1
answered on 17 Nov 2010, 02:26 PM
Hello, Richard

This is not quite. User is editing 18 column for example and CurrentColumn property is 18, but first column in the scope is 9 (column 18 is on the middle of the scope). After editing I update data source and need scroll grid to old position (first column in the scope is 9, column 18 in the middle of the scope), but after this operation
this.grid.TableElement.ScrollTo(0, 18)
first column in the scope is 18. It is not correct.

Best regards,
Andrew Shyliuk
0
Andrew Shyliuk
Top achievements
Rank 1
answered on 18 Nov 2010, 12:28 PM
Hello, Richard

Sorry, but what about my problem. Is it possible to do via Telerik controls?

Best regards,
Andrew Shyliuk
0
Richard Slade
Top achievements
Rank 2
answered on 18 Nov 2010, 12:36 PM
Hello Andrew,

My apologies for the delay in getting back to you. I think the issue here will be that when you scroll, you may not have a row selected, so as far as I'm aware, you can't hook into anything to find out the place where you wish to scroll back to. You will only know what row you are on, that you wish to scroll back to once a row is selected.

There may be a way to do this, but I am not aware of any at the moment. I'll continue to look into this for you and I'll let you know if I can sort out a suitable solution for you.

All the best
Richard

0
Andrew Shyliuk
Top achievements
Rank 1
answered on 18 Nov 2010, 02:02 PM
Hello, Richard

Ok. I'm waiting for solving of this problem.

Best regards,
Andrew Shyliuk
Tags
GridView
Asked by
Pedro Valero Matas
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Pedro Valero Matas
Top achievements
Rank 1
Andrew Shyliuk
Top achievements
Rank 1
Share this question
or