ExtractValues & hotfix 1425

6 posts, 0 answers
  1. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 05 Mar 2008 Link to this post

    After applying hotfix 1425 - my code to extract values is failing. This is what I have:

    - A grid with few columns and a selection checkbox.
    - A button outside of grid.
    - I select the checkbox
    - click the button and on server side I do following in OnClick of button:

    GridEditableItem selRow = grid1.SelectedItems[0] as GridEditableItem;
            Hashtable rowValues = new Hashtable();
            //get row values
            selRow.ExtractValues(rowValues);

            //set values from the selected row
            DateTime date = MyConverter.ToDateTime(rowValues["Date"], DateTime.MinValue);

    ----
    the ExtractValues() function does not give error but all values inside the hashtable are null. The keys are correct, but no values!

    Why? This was working find in earlier version of release but started breaking after 1425. Please help us soon.

    Thanks,
    Piyush
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 06 Mar 2008 Link to this post

    Hello Piyush,

    Do you use InPlace editing for your grid? In case you use EditForms edit mode, note that you will need to invoke ExtractValues() method for the respective GridEditFormItem instead, namely:

    GridEditFormItem selRow = (grid1.SelectedItems[0] as GridDataItem).EditFormItem as GridEditFormItem;  
    Hashtable rowValues = new Hashtable();  
    //get row values  
    selRow.ExtractValues(rowValues); 

    Detailed explanation about the inplace and edit forms edit mode specifics can be found in the online help.

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 06 Mar 2008 Link to this post

    No I don't have Inplace editing in my grid. The grid is for readonly purpose and used only to select a row. What should I do in this case?
  5. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 06 Mar 2008 Link to this post

    Hello Piyush,

    Review the explanation/linked article from my previous reply and let me know whether this helps. The ExtractValues method is used to extract the data from the editable fields in the grid.

    Regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  6. Piyush Bhatt
    Piyush Bhatt avatar
    166 posts
    Member since:
    Nov 2007

    Posted 06 Mar 2008 Link to this post

    As I explained in the earlier mails, I am not doing this in any grid events. I am doing it outside of a grid events. So, none of the extractValues helped in that case.

    Finally I used
    DataItem selRow = RadGrid1.selectedItems[0] as GridDataItem;
    selRow["WhateverUniqueColumnName"].Text  - to get the value.

    Its working in 1425 - I hope you are not planning to stop this.

    Thanks,
    Piyush
  7. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 10 Mar 2008 Link to this post

    Hi Piyush,

    The ExtractValues(dictionaryObj) method fetches the data from editable grid rows only. If you want to get the values from the selected grid item, this can be done through the Text property of the corresponding cell.

    These topics from the online help provide further directions on this subject:

    http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/AccessingCellsAndRows/DefaultCS.aspx
    http://www.telerik.com/help/radcontrols/prometheus/?grdRetrievePrimaryKeyFieldValuesForItems.html
    http://www.telerik.com/help/radcontrols/prometheus/?grdAccessingCellsAndRows.html

    Best regards,
    Stephen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017