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

lookup in data column

7 Answers 39 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Avi Avni
Top achievements
Rank 1
Avi Avni asked on 19 Dec 2010, 01:55 PM

Hello

I need to implement this scenario:

There is int in the data item that represents value in data base table.

In the grid there is data column that binding to this int.

When the Create Cell Element method called I take the int and go to service that return the value from DB.

This is the issues:

1.

 I need to show the string that returns form the service in this column instead of the int.

This is extra data that not in the data item of the column.

How can I add this data to the column?

2.

The filter knows the int in the data member binding.

 I need to give the filter the same data that shown in the column.

 

I don’t want to use combo box column.

What is the solution for this scenario?

Best regards

Ehud

 

7 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 20 Dec 2010, 09:16 AM
Hello Ehud Pinchas,

I suppose you have created a custom column. What you can do is to subscribe to the LoadingDistinctValues event of the gridview and manually populate the distinct values listbox (by setting the e.ItemsSource property).


All the best,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Avi Avni
Top achievements
Rank 1
answered on 20 Dec 2010, 05:09 PM

Thanks

This help for the second question.

How can I solve the first issue?

Best regard

Ehud.

0
Veselin Vasilev
Telerik team
answered on 21 Dec 2010, 10:35 AM
Hi Ehud Pinchas,

Can you please give us some more information about your scenario so we can advise you more adequately.


Kind regards,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Avi Avni
Top achievements
Rank 1
answered on 21 Dec 2010, 02:27 PM

Hello Veselin Vasilev

Thank You for your help

This is the scenario:

One of the columns in the grid is bound to ID in the entity.

 This ID represents value in DB table, For example ID of city.

When the cell created there is service that takes this ID and returns the city value.

I need to show in the column the city name from the value.      

The problem is that this value is not in the entity that bound to the column.

How can I solve this?

Best regards

Ehud

0
Veselin Vasilev
Telerik team
answered on 21 Dec 2010, 04:29 PM
Hello Ehud Pinchas,

Cann't you transfer the table with the Cities as well? Here is a sample project which shows how to transfer the data from both the Orders and the Order_Details tables.


All the best,
Veselin Vasilev
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
Avi Avni
Top achievements
Rank 1
answered on 22 Dec 2010, 09:32 AM

Hello Veselin Vasilev

Thank you for the demo.

Unfortunately I can't past the table because the data stored in local service.

And I don’t know the specific data; I get some indication from the entity that tells the service what data to receive.

How can I solve this issue?

Best Regards

Ehud  

0
Avi Avni
Top achievements
Rank 1
answered on 23 Dec 2010, 07:38 AM

Hello Veselin Vasilev

I solved the issue thank you for your help

Best Regards

Ehud

Tags
GridView
Asked by
Avi Avni
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Avi Avni
Top achievements
Rank 1
Share this question
or