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

    Hello,

    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

    CS
  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"  
            onitemcommand="RadGrid1_ItemCommand"
            <MasterTableView> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="Column1" HeaderText="Bound Column"
                    </telerik:GridBoundColumn> 
                    <telerik:GridHTMLEditorColumn DataField="Column2" HeaderText="HTML Editor Column"
                    </telerik:GridHTMLEditorColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 

    protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
        { 
            DataTable table = new DataTable(); 
            table.Columns.Add("Column1"); 
            table.Columns.Add("Column2"); 
            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,
    Johny






  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top