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

SelectedIndexChanged event

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ghadeer
Top achievements
Rank 1
ghadeer asked on 04 Jan 2009, 06:24 AM
Hi All,

I am trying to used SelectedIndexChanged to call a method that take a value from the databoundfield as parameter 

my question is how can I get that value from this event???
 
thanks
ghadeer

1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 05 Jan 2009, 04:21 AM
Hi Ghadeer,

I hope you are trying to access cell value of a selected row in the SelectIndexChanged event. If so give a try with the following code snippet and see if it helps.

CS:
 protected void RadGrid1_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (item.Selected) 
            { 
                string strTxt = item["ProductName"].Text; 
            } 
        } 
         
    } 


Set EnablePostBackOnRowClick property to true in the client settings.

ASPX:
<ClientSettings EnablePostBackOnRowClick="true"   > 
             </ClientSettings> 


Thanks
Shinu
Tags
Grid
Asked by
ghadeer
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or