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

GrideditableItem not picking up new values

5 Answers 333 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 08 Nov 2011, 04:46 PM
On the update event, i am trying to populate myu object with the new values entered:

GridEditableItem UpdateItem = (GridEditableItem)e.Item;

I then do the following to try and get the new value (this works on other pages) from the input control, in this case in column "SDTest"

fmsdupdate.SD = Convert.ToDecimal((UpdateItem["SDtest"].Controls[0] as TextBox).Text.Trim());


This only returns me the original value in the field, not the updated one that i have just input. Any help would be greatly appreciated.
Michael

5 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 08 Nov 2011, 05:25 PM
Hello Michael,

The new values which the user entered before triggering the Update command can be fetched calling the ExtractValuesFromItem method. Please refer to the help article below for additional information.
http://www.telerik.com/help/aspnet-ajax/grid-retrieve-original-values-for-edited-item.html

Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Michael
Top achievements
Rank 1
answered on 08 Nov 2011, 05:29 PM
When i use the ExtractValuesFromItem method it only brings me back the original values. I want to be able to pick up the new values that have been input but the only values i ever get back are the original values.
0
Pavlina
Telerik team
answered on 08 Nov 2011, 06:12 PM
Hi Michael,

Please examine the attached project and see if it helps to resolve the problem you are facing.

Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
Michael
Top achievements
Rank 1
answered on 08 Nov 2011, 06:41 PM
Pavlina, thank you. I can get that solution working, but when i try and copy the functionality both the newValues and editedItem objects contain the same info i.e. none of the updated info appears. My columns have been built from the code behind as this what i prefer, this is my table declaration in the front end, if there is anything untoward in here could you please let me know?

<telerik:RadGrid ID="grdFixedMeanAndSd" runat="server" AutoGenerateColumns="False"
                    AllowPaging="True" GridLines="None" OnNeedDataSource="grdFixedMeanAndSd_NeedDataSource"
                    PageSize="5" EnableEmbeddedSkins="False" Skin="247"
                     CellSpacing="0" onitemcommand="grdFixedMeanAndSd_ItemCommand"
                    onitemdatabound="grdFixedMeanAndSd_ItemDataBound">
                    
                    
                    <MasterTableView EditMode="InPlace" DataKeyNames="LotDetail.LotNumber">
                        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
 <EditFormSettings>
                            <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column">
                            </EditColumn>
                        </EditFormSettings>
                    </MasterTableView>
                     <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Hay">
                    </HeaderContextMenu>
                     
                </telerik:RadGrid>

This is very frustrating as it is working on other pages in my solution, but for some reason this one does not.
Michael
0
Pavlina
Telerik team
answered on 09 Nov 2011, 04:17 PM
Hello Michael,

I suppose that the following help article will help you resolve the problem:
http://www.telerik.com/help/aspnet-ajax/grid-updating-inplace-and-editforms.html

Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Michael
Top achievements
Rank 1
Share this question
or