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

[Solved] Cannot get at edited value ...

3 Answers 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 21 May 2009, 03:24 PM
I cannot reach the edited value in a row using the following code:

 

foreach (GridEditableItem editedItem in gvEntityAttributes.EditItems)  
            {  
                Hashtable newValues = new Hashtable();  
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);  
                string cID = editedItem.GetDataKeyValue("ea_ID").ToString();  
            } 

If I edit the column, then change the value, from "Charles" to "Charles T." the newValues Hashtable only contains the entry for "Charles" not "Charles T." ... how do I get to the text entered by the user during the edit?

The row is not set to read only.

Thanks in advance,

Ryan

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 21 May 2009, 03:51 PM
Hello Ryan,

Try the following modification:
foreach (GridEditableItem editedItem in gvEntityAttributes.EditItems) 
    Hashtable newValues = new Hashtable(); 
    editedItem.ExtractValues(newValues); 
    ... 

I hope this helps.

Regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Ryan
Top achievements
Rank 1
answered on 21 May 2009, 04:05 PM
Sorry, that did not work, I still get "Charles" when I enter "Charles Thomas" and then press the update button.

        protected void gvEntityAttributes_UpdateCommand(object source, GridCommandEventArgs e)  
        {  
            foreach (GridEditableItem editedItem in gvEntityAttributes.EditItems)  
            {  
                Hashtable newnewValues = new Hashtable();  
                editedItem.ExtractValues(newValues);   
                e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);  
                string cID = editedItem.GetDataKeyValue("ea_ID").ToString();  
            }  
        } 

Got any other ideas as to why the changes entered into the grid are not showing up after the update button is pressed?

Thanks,

Ryan.
0
Daniel
Telerik team
answered on 25 May 2009, 04:33 PM
Hello Ryan,

Please let me know whether the sample project I attached to the support ticket helped to overcome the problem.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or