views:

199

answers:

2

Details:

I'm basically trying to implement the functionality of the example here (http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/editondblclick/defaultvb.aspx) on my own site, but instead of using a data source control located in the page markup (like in the example: SessionDataSource), I'm using a dataset that I get from some server code-behind. I am able to successfully get my double-clicked row into edit mode with my dropdowns successfully populated, however when clicking onto another row to update the one in edit mode, no-dice.

I've discovered that apparently the client-side JavaScript function updateItem() does not initiate an AJAX callback like I originally thought, so I've been trying to work my way around that. Currently I'm using my RadAjaxManager to perform an AJAX callback with the row index number like so:

        function RowClick(sender,eventArgs)
        {
            if(editedRow && hasChanges)
            {
                hasChanges = false;
                $find("<%= RAM.ClientID %>").ajaxRequest(editedRow);
            }
        }

This gets me to my server code. Awesome. But,

Problem: I must be accessing something wrong, because the GridDataItem cell text that I'm trying to obtain for the edited row all has the value "&nbsp;".

    Dim gdi As GridDataItem = FieldOpsScheduler.Items(rowIndex)
    Dim d As DateTime = DateTime.Parse(gdi.Item("EndDate").Text) //<--FAIL

I've been scouring the Internet for hours now trying to find how I can pull off what I'm trying to do, but to no avail.

Additional Info: I'm using GridDropDownListColumnEditors on the front-side to do the editing for my table, declared like so:

<telerik:GridDropDownListColumnEditor ID="ddlce_SunAct" runat="server" DropDownStyle-Width="60px"></telerik:GridDropDownListColumnEditor>

So does anybody have any ideas on what I have to do to access the values that have been changed in my RadGrid?? Is the problem that I somehow need to rebind my RadGrid when clicking on a new row? If so how do I do that? Any solutions or ideas would be greatly appreciated. (Also although I'm doing this in VB.NET, feel free to write responses in C# if you wish as I understand that too. :-) ) Thank you in advance.

+1  A: 

With manual binding updateItem() should still raised the UpdateCommand server event of the grid, but you will have to update the grid source by hand. Modify the local version of the online demo where you Telerik AJAX controls installation is and go from there.

Dick

Dick Lampard
+1 For helping me realize this as that cuts out the need for me to use my RadAjaxManager.ajaxRequest function. However the problem of accessing the changed values still remains, although I think I've found how to do that from this: http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html - There's a section on how to access cells in edit mode. Thank you for the insight though as I thought it was really weird that updateItem() didn't generate SOME sort of detectable event on the server..
KSwift87
A: 

http://www.telerik.com/help/aspnet-ajax/grdaccessingcellsandrows.html

If anyone else has the same problem as I did, go to the above link and scroll down to the section titled "Accessing the value of cells in edit mode".

KSwift87