Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Issue Populating Data in jqGrid when DropDownList Selection is made
18/07/2012
23:58
Avatar
Jordy1234
New Member
Members
Forum Posts: 1
Member Since:
18/07/2012
sp_UserOfflineSmall Offline

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>

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information