Click here to Skip to main content
15,889,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi everyone
i useing devexpress tools
and i do allow selection single row = true
how i can in aspxgridview when user select row
get value of columns in this row and add to text box
when select
ok
thanks for any help
Posted

1 solution

Processed (Answered) by DevExpress Team at 04/03/2008 21:42:45

Hi Emmanuel,

You have found an article devoted to the old ASPxGrid and Editors Library Suite. Since you are using the ASPxGridView and Editors Library, you should use another approach.

The ASPxGridView provides the GetRowValues client side method which will allow you to obtain a certain row values. This method is described in our documentation:

ASPxClientGridView Members

Here is some sample code showing how to obtain a row value:

[JScript]
function Button1_onclick() {
ASPxGridView1.GetRowValues("CategoryID;CategoryName", OnGetRowValues);
}

function OnGetRowValues(result) {
for(var i = 0; i < result.length; i ++)
for(var j = 0; j <result[i].length; j++) {
alert(result[i][j]);
}
}

Thanks,
Plato
 
Share this answer
 
Comments
Mostafa Elsadany 3-Apr-11 11:46am    
thanks
but i think there is way by client side event
in selection changed
function(s, e) {
document.forms[0].txtm.value=e.GetRowValues(e.GetFocusedRowIndex(), 'id', OnGetRowValues);

}
but i have some error
thanks for your help
and i hope if you understand me and you know what is my error in this
client side event plz tell me
and thanks again for your help
Mostafa Elsadany 3-Apr-11 14:05pm    
do you know how i can add this code
to client side events
txt.Text = ASPxGridView1.GetSelectedFieldValues("id")[0].ToString();

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900