ExtractValuesFromItem doesn't work with GridHTMLEditorColumn

2 posts, 0 answers
  1. CSurieux
    CSurieux avatar
    465 posts
    Member since:
    Jan 2007

    Posted 19 Nov 2009 Link to this post


    I just discovered that I get nothing from this type of column updating the row ?
    Normal columns values are normally found in the Hashtable of newValues.
    Is there something special to do to get its value ?

    Thanks for help

  2. Johny
    Johny avatar
    80 posts
    Member since:
    Aug 2008

    Posted 25 Nov 2009 Link to this post

    Hi Christian,

    I tried this code and it works on my side:

    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1"></telerik:RadAjaxManager> 
        <telerik:RadGrid ID="RadGrid1" runat="server"  
            OnNeedDataSource="RadGrid1_NeedDataSource" AutoGenerateColumns="false" AutoGenerateEditColumn="true"  
                    <telerik:GridBoundColumn DataField="Column1" HeaderText="Bound Column"
                    <telerik:GridHTMLEditorColumn DataField="Column2" HeaderText="HTML Editor Column"

    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
            DataTable table = new DataTable(); 
            for (int i = 0; i < 5; i++) 
                table.Rows.Add(i, "<h3>Hello" + i + "</h3>"); 
            RadGrid1.DataSource = table; 
        protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
            if (e.CommandName == RadGrid.UpdateCommandName) 
                if (e.Item is GridEditableItem) 
                    GridEditableItem editedItem = e.Item as GridEditableItem; 
                    Hashtable newValues = new Hashtable(); 
                    e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem); 
                    foreach (DictionaryEntry entry in newValues) 
                        RadAjaxManager1.Alert("Key: " + entry.Key.ToString() + "\nValue: " + entry.Value.ToString()); 

    I hope this helps,

Back to Top