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

[Solved] Focus in custom row layout

3 Answers 75 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.
THOMAS
Top achievements
Rank 1
THOMAS asked on 27 Jul 2011, 09:40 AM

Dear Sir,

I use the Silverlight RadGridView with a custom row layout. In the layout is a TextBox. If I set focus to the TextBox, the RadGridView doesn’t select the row. What can I do, to select the actual row?

I saw the example in web for the custom row layout, but there are all controls read only. In the CustomRowLayoutWithDefinedSates example is the same situation.

Best Regards

3 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 27 Jul 2011, 09:54 AM
Hi Thomas,

 


In a custom row layout scenario everything is custom and you may see that you do not have any columns. Thinking in this way if you want to build some behavior in such layout you should do it by your side.
The reffered example from the referenced forum thread follows the online demo "Custom Row Layout" which purpose is to demonstrate how to construct such layout. The most elements used are TextBlock elements, you may always replace these controls such as TextBoxes, ComboBoxes and any other you need, which follow some custom logic. Regarding the selection you may implement it as it was proposed in the following forum thread


Please let me know how this works for you!


All the best,
Vanya Pavlova
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
THOMAS
Top achievements
Rank 1
answered on 27 Jul 2011, 10:50 AM

Hi Vanya,

thank you for your answer. I saw all the examples, but if you change a TextBlock there to a TextBox, you will see, that the row selection doesn’t works. If the TextBox in the custom row becomes focus, I’d like to have the selected row in my viewmodel. The problem is that, if I click in the TextBox, the RadGridView doesn’t react with changing the selected row (SelectedItem property).

Best Regards

0
Vanya Pavlova
Telerik team
answered on 27 Jul 2011, 11:36 AM
Hi Thomas,

 
The functionality you described is implemented internally on a GridViewCell level. You may achieve the desired result through handling some of the events related to the TextBox element within this layout, find its parent row using ParentOfType method and set GridViewRow's IsSelected Property to True. You may extend this in a variety of scenarios to achieve result similar to the one in a default GridViewRow.  

  
Hope this helps!

Best wishes,
Vanya Pavlova
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
THOMAS
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
THOMAS
Top achievements
Rank 1
Share this question
or