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

How to retrieve the value which has been typed in the CellEditTemplated mode of the column??????

5 Answers 33 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Tai
Top achievements
Rank 1
Tai asked on 16 Oct 2010, 12:07 AM
Hi
This is the task which i one to accomplish for a column in the gridview.
The user will be able to edit the value in that column. If that value is already available in the existing list, then after pressing tab to move to the next column , no popup search window will appear. However if the value typed isn't available in the existing list, a popup search gridview window will appear which show a list of available values. The user will pick one, Click ok and that value will be updated on that column.

For detail explanation. You can read my below description:


Assuming that i have a table of Accounts with fields: AccountId, AccountDescription, AccountNumber(string)
And in my main grid document, I will show the list of Documents. And the document includes a field AccountId, and other fields.

1.In the column AccountId of the documentgrid, I want to display AccountNumber instead of AccountId but its bounded value should be AccountId

My solution: I am not really sure which control can be accomplished that besides the Radcombobox in non edit mode. So i use it .But not sure whether it is the right way or not? any suggestion would be appreciated.
I am also thinking about the Navigation property Account.AccountNumber for the column of accountId. However, that one will make the column bound to AccountNumber not AccountId. Correct me if i am wrong.

2.the user will be able to type in the CellEditMode of the AccountId column(what he type will be AccountNumber). After pressing Tab button, if he types a value AccountNumber which exits in the list of account(will be retreived through service. If you have other way, plz give suggestion), then no need popup window. If he types something(AccountNumber) not available in the list of accounts, then a popup window will appear , which shows a gridview of all available items in the list so the user can pick up. After picking one that item will be updated in the corresponding column

My solution: right now i can implement the Tab feature which will make the pop up window appear . However, I don't know a way to retreive the value which has been typed in the column of AccountID. I really need help here. Because if i know how to retreive that value, then i can just call a service with a parameter to retrieve the list of available Account.

And how can we update that value of the AccountId column in document grid after user chooses the row in the Account gridview popup window




if you have a sample project for those features which i got stuck now, i will be appreciated

thank you

5 Answers, 1 is accepted

Sort by
0
Tai
Top achievements
Rank 1
answered on 18 Oct 2010, 06:23 PM
I need urgent help for this one plz.
I try to look at the online document but get no help at all because the document don't give any detail explanation to let me understand the functions at all
0
Tai
Top achievements
Rank 1
answered on 19 Oct 2010, 11:25 PM
I am still stuck

some help will be appreciated

thank you
0
Nedyalko Nikolov
Telerik team
answered on 20 Oct 2010, 03:12 PM
Hi Tai,

Generally there is no problem to bind to different properties inside CellTemplate and CellEditTemplate, actually these properties are designed for such cases.
You could use GridViewCell.GetEditingElement() method to retrieve the actual editing element (in default case this method will return the actual editing TextBox instance). I hope this will help.

Sincerely yours,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tai
Top achievements
Rank 1
answered on 21 Oct 2010, 11:55 PM
Hi

i still can't retrieve the typed value on the cell edit to do a pop up search basing on that value. I need to use that value for the filtering.
And validated what has been typed by the user on that cell(because what he types must exist in the list of available number in the database)

can you provide the code a little more detail ? or just a small sample project to demonstrate how to retrieve it?

thank you
0
Nedyalko Nikolov
Telerik team
answered on 27 Oct 2010, 03:22 PM
Hi Tai,

I'm attaching a sample project that demonstrates how to retrieve newly added value. In order to use the example:
1. Put first cell into edit mode.
2. Enter new value.
3. Press TAB key.
4. Message with the new value is shown by RadGridView.CellValidating event handler.

I hope this will help.

Sincerely yours,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Tai
Top achievements
Rank 1
Answers by
Tai
Top achievements
Rank 1
Nedyalko Nikolov
Telerik team
Share this question
or