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

Evaluation questions

3 Answers 62 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 24 Jan 2013, 04:26 PM
Hi

1) I have a requirement to display numeric data in the grid (this must be read-only), and in the first cell of each column I need to display a "unit of measure" (e.g. "cm", mm", "m", etc). Additionally, when the user clicks on this cell it should display a combobox, allowing the user to change that column's measurement unit (selecting an item will involve recalculating the data that is bound to the grid). So my question is - is it possible to mix content in a column like this, i.e. numeric data in some cells, and a combobox in another cell? Can you suggest a way to achieve this?

2) I want the ability to right-click a cell and bring up some kind of popup or panel containing a simple form (various controls to manipulate that cell's contents). I've found how to select the cell that has been right-clicked, but is there a way that I can position the popup/panel over that cell? Or am I best just using a WPF Popup control with Placement="MousePoint"?

3) In some cells we need to provide a visual indication of the validity of the data, but rather than use colours to do this, we would like to display an image/icon alongside the numeric value. Is this possible?

Thanks in advance
Andrew

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 Jan 2013, 08:49 AM
Hello Andrew,


On your first question :
As it is not recommended to mix data in such way I may suggest the following approach :

1. Using the HeaderCellTemplate property you may place the measurement unit cells within the header cells ( e.g. under the header cell). Inside the template you may place an user control of yours that displays the unit and shows a combo on edit.

Another alternative would be to use secondary headers and place this above the regular headers ( if applicable to your case.

In short - Yes it would be possible.  I will be glad to assist you in the implementation of this one.


On your second question : Are you trying to implement some kind of context menu  ? Let me know the details and I am sure we can think of some descent solution.


Greetings,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Andrew
Top achievements
Rank 1
answered on 25 Jan 2013, 09:23 AM
Hi,

Thanks for your reply. Do you have a link to a sample or documentation regarding the "secondary headers"? I can't find anything about this feature.

Re the second question: it will be more complex than a context menu. More like a small form with controls like buttons, textboxes, dropdowns, etc. I can probably implement it using a WPF Popup control, but would welcome suggestions if there is a better way!

Thanks again.
0
Pavel Pavlov
Telerik team
answered on 30 Jan 2013, 09:52 AM
Hello Andrew,

You can have a look at this online demo. It is for Silverlight. however exactly the same approach should be applicable to WPF as well. You may find the WPF version of the demo inside your local WPF version of the QSF demos.

Regarding the second question - you can use the CellTemplate or the CellEditTemplate property of RadGridView in order to place your own user control inside the cell. It may have a popup and some logic to hide show it e.g. on mouse events. 

Let me know in case you meet any troubles during the implementation.

Greetings,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Andrew
Top achievements
Rank 1
Share this question
or