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

[Solved] Custom Header Cell

2 Answers 150 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dario
Top achievements
Rank 1
Dario asked on 27 Aug 2009, 08:05 AM
Hi,
I have a fairly simple task that I find very hard to do with the telerik grid. I have been working on it for some time now, and I think that I came to a dead end :(
Heres my scenario:
I want to create a custom header that will have Header Text, sort functionality, and a textbox (below the Header Text) that will do the quick filter. 
My columns are custom implemented,  and added to a grid dynamically.
I also want to associate the textbox from the header with the column, so I can access it any time i need to.
The idea is when some expression is entered inside the quick search textbox, and enter is pressed, I want to be able to catch that key down in the column class, have an instance of the textbox, and do some filter logic then...
Another option is to catch the keyPress in my page code, but then, I want to be able to know the instance of the column in which the textbox that fired the event resides, and also I'll need to have access to textboxes at all time (which I find hard to acheive if the textboxes for quick filter are buried in some template..)
Anyway.. I have been on this for days and I am all out of ideas, any help is greatly appreciated.

2 Answers, 1 is accepted

Sort by
0
Accepted
Pavel Pavlov
Telerik team
answered on 27 Aug 2009, 11:09 AM
Hello Dario ,

Have you tried using the Header property of the column ? . It may be set to any UIElement while preserving the other functionality of the header cell.

When handling events you may use the following syntax :

sender.ParentOfType<GridViewHeaderCell>().Column

* Yo will need a "using Telerik.Windows.Controls" in your  cs file in order  to have  access to this extension method.



Let me know if you have troubles implementing such aproach into your scenario . I will gladly elaborate.

Best wishes,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Dario
Top achievements
Rank 1
answered on 27 Aug 2009, 11:51 AM
Hi Pavel,
Indeed this extension method is the thing I need. 
Thanks for your help :)
Tags
GridView
Asked by
Dario
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Dario
Top achievements
Rank 1
Share this question
or