ORM with RadGrid

Thread is closed for posting
2 posts, 1 answers
  1. jon
    jon avatar
    33 posts
    Member since:
    Dec 2008

    Posted 15 Feb 2010 Link to this post

    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">
    <telerik:GridEditCommandColumn ButtonType="ImageButton">
    <ItemStyle CssClass="MyImageButton" Width="30px" />
    <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" />
    <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">
    <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>

  2. Answer
    Damyan Bogoev
    Damyan Bogoev avatar
    581 posts

    Posted 17 Feb 2010 Link to this post

    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.
Back to Top