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

ExtractValues & hotfix 1425

5 Answers 121 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Piyush Bhatt
Top achievements
Rank 2
Piyush Bhatt asked on 05 Mar 2008, 08:56 PM
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

5 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 06 Mar 2008, 11:19 AM
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
0
Piyush Bhatt
Top achievements
Rank 2
answered on 06 Mar 2008, 02:27 PM
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?
0
Sebastian
Telerik team
answered on 06 Mar 2008, 02:36 PM
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
0
Piyush Bhatt
Top achievements
Rank 2
answered on 06 Mar 2008, 03:46 PM
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
0
Sebastian
Telerik team
answered on 10 Mar 2008, 03:45 PM
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
Tags
Grid
Asked by
Piyush Bhatt
Top achievements
Rank 2
Answers by
Sebastian
Telerik team
Piyush Bhatt
Top achievements
Rank 2
Share this question
or