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

ORM with RadGrid

1 Answer 69 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jon
Top achievements
Rank 1
jon asked on 15 Feb 2010, 08:34 PM

My radgrid is looking good, but the Edit/Insert functions are not being called.  I customized the radgrid sample so that I could programmatically use my ORM, so i'm thinking it has to do with ORM somehow.  When I click the pencil icon to "edit" a row, all the fields become editable, however when I hit the checkmark icon to "save" my changes my back-end functions are not being called:

protected void radgridGenotype_ItemInserted(object source, GridInsertedEventArgs e)
{
}

protected void radgridGenotype_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
GridEditableItem item = (GridEditableItem)e.Item;
String id = item.GetDataKeyValue("IdGenotype").ToString();
}

This is my radgrid:

<telerik:RadGrid ID="radgridGenotype" runat="server" Width="100%" Skin="Vista"
AllowAutomaticDeletes="true" AllowAutomaticInserts="false" AllowAutomaticUpdates="false"
OnNeedDataSource="radgridGenotype_NeedDataSource" OnDataBound="radgridGenotype_DataBound"
OnItemInserted="radgridGenotype_ItemInserted" OnItemUpdated="radgridGenotype_ItemUpdated"
AutoGenerateColumns="False" GridLines="None" AllowMultiRowEdit="true">
<MasterTableView DataKeyNames="IdGenotype" EditMode="InPlace" Width="100%" CommandItemDisplay="Bottom" HorizontalAlign="NotSet">
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton">
<ItemStyle CssClass="MyImageButton" Width="30px" />
</telerik:GridEditCommandColumn>
<telerik:GridBoundColumn DataField="GenotypeResultCode" HeaderText="Code" SortExpression="GenotypeResultCode"
UniqueName="GenotypeResultCode" ColumnEditorID="GridTextBoxColumnEditor1" />
<telerik:GridBoundColumn DataField="GenotypeResultDescription" HeaderText="Description" SortExpression="GenotypeResultDescription"
UniqueName="GenotypeResultDescription" ColumnEditorID="GridTextBoxColumnEditor1" />
<telerik:GridBoundColumn DataField="GenotypeTest" HeaderText="Test" SortExpression="GenotypeTest"
UniqueName="GenotypeTest" ColumnEditorID="GridTextBoxColumnEditor1" />
</Columns>
<EditFormSettings ColumnNumber="1" CaptionDataField="GenotypeResultCode" CaptionFormatString="Edit properties of Genotype {0}">
<EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
UniqueName="EditCommandColumn1" CancelText="Cancel edit">
</EditColumn>
<FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
<FormMainTableStyle CellSpacing="0" CellPadding="3" BackColor="White" Width="100%" />
<FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
<FormTableItemStyle Wrap="False"></FormTableItemStyle>
<FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
<FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Accepted
Damyan Bogoev
Telerik team
answered on 17 Feb 2010, 05:40 PM
Hello jon,

You should place the update logic inside the UpdateCommand event handler of the RadGrid. The UpdateCommand occurs when the Update button is clicked for an item in the Telerik RadGrid control. The ItemUpdated event fires when a RadGrid item has been updated.
I think that will help you.

Best wishes,
Damyan Bogoev
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
General Discussions
Asked by
jon
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
Share this question
or