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

Iterate over Selected Rows (Server Side)

1 Answer 126 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nathan
Top achievements
Rank 2
Nathan asked on 23 Jan 2012, 11:10 PM
Hello,

I currently have a grid that contains a select column, then all other columns are loaded programmatically during runtime. In my grid I have a "CommandItemTemplate" section where certain buttons are located - one being "Submit". When a user selects rows, and clicks "Submit", I need to retrieve the users selections on server side. 

Using the following code, I can access the data key value, but no other row data. In the example below, "myId" is correct, but the other variables are blank strings. I'm not reloading the grid on this postback, although I tried this and the same issue occurred.  I tried reloading my grid on page_init and page_load - both times I still cannot access my row data. Any suggestions?

foreach (GridDataItem item in this.grdSummary.SelectedItems)
{
    string myID = item.GetDataKeyValue("UidInt").ToString();
    string myOplockColumn = item["opLock"].Text;
    string myOrderColumn = item["order"].Text;
}

** One more thing, the "Submit" button opens a confirmation box (RadWindow) which then causes an ajax request if the user clicks "OK". Clicking "OK" calls "SetSubmitConfirmation". The button click does not fire an "ItemCommand" event, but instead, an ajax request passing an argument - InitiateAsyncRequest 


function InitiateAsyncRequest(argument) {
    var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");
    ajaxManager.ajaxRequest(argument);
    return false;
}
 
function SetSubmitConfirmation(comment) {
    document.getElementById('<%=hdnComment.ClientID %>').value = comment;
    InitiateAsyncRequest('submit');
}


1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 24 Jan 2012, 12:18 PM
Hello Nathan,

can you please provide your code so we can able to find issue/problem in your code ??

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Nathan
Top achievements
Rank 2
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or