Forum


23:58

18/07/2012

Here is my problem. I can populate data into the jqGrid via a Objectdatasource on page load. I also have a dropdownlist that has 4 options to choose from. When I try to code the Grid to reload the data when a dropdownlist select is made, the data remains. I want to be able to make a selection in the dropdown and that will reload the grid with different data. It works fine in a normal grid, but for some reason jqGrid doesn't like to work. Any ideas????
Here is the code I'm working with...
public partial class Employees : System.Web.UI.Page
{
Employee newEmp = new Employee();
protected void Page_Load(object sender, EventArgs e)
{
empGrid.DataSource = employeeODS;
empGrid.DataBind();
}
protected void siteDropDownList_SelectedIndexChanged1(object sender, EventArgs e)
{
empGrid.DataSource = ObjectDataSource1;
empGrid.DataBind();
}
and my jqGrid code...
<cc1:JQGrid ID="empGrid" runat="server" Width="484px" Height="241px">
<Columns>
<cc1:JQGridColumn DataField="DisplayName" HeaderText="Employee Name" Width="115"></cc1:JQGridColumn>
<cc1:JQGridColumn DataField="EmployeeID" HeaderText="MyID" Width="50"></cc1:JQGridColumn>
<cc1:JQGridColumn DataField="Title" HeaderText="Title" Width="115"></cc1:JQGridColumn>
</Columns>
<SearchToolBarSettings SearchToolBarAction="SearchOnKeyPress" />
<PagerSettings ScrollBarPaging="true" PageSize="100" />
<ToolBarSettings ShowSearchToolBar="true" ></ToolBarSettings>
<AppearanceSettings HighlightRowsOnHover="true" ScrollBarOffset="16" />
</cc1:JQGrid>
my Objectdatasource....
<asp:ObjectDataSource ID="employeeODS" runat="server"
SelectMethod="GetEmployeeInfo" TypeName="Website.Employee">
</asp:ObjectDataSource>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetEmployeeBySite" TypeName="Website.Employee">
<SelectParameters>
<asp:ControlParameter ControlID="siteDropDownList" Name="Location"
PropertyName="SelectedValue" Type="String" />
</SelectParameters>
</asp:ObjectDataSource>
Most Users Ever Online: 715
Currently Online:
46 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66