or
public List<Person> GetPersons() { return DataProvider.GetPeople(); }
var items = RadGrid1.SelectedItems; Person p = items[0].DataItem as Person;
<asp:SqlDataSource ID="dsLocations" runat="server" ConnectionString="<%$ ConnectionStrings:Database_DB1 %>" SelectCommand = "select * from GetLocations WHERE loc_User_ID = 44" ProviderName="System.Data.SqlClient" ></asp:SqlDataSource><asp:SqlDataSource ID="dsLocations" runat="server" ConnectionString="<%$ ConnectionStrings:Database_DB1 %>" ProviderName="System.Data.SqlClient" ></asp:SqlDataSource>protected void Page_PreRender(object sender, EventArgs e){ dsLocations.SelectCommand = "select * from GetLocations WHERE loc_User_ID = " + user.User_ID.ToString(); if (rgLocations.SelectedIndexes.Count == 0) { rgLocations.SelectedIndexes.Add(0); rgActivities.Rebind(); }}rgLocations.SelectedIndexes.Add(0); // failrgActivities.Rebind(); // fail