Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8223457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:42:24+00:00 2026-06-07T14:42:24+00:00

In the jqwidget grid cellediting example(under jqxGrid left menu, open Editing/Editing), data is generated

  • 0

In the jqwidget grid cellediting example(under jqxGrid left menu, open Editing/Editing), data is generated at client. How can I bind dropdownlist to database inside a asp .net MVC3 project?(You can see dropdownlist under product column in demo tab)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:42:26+00:00Added an answer on June 7, 2026 at 2:42 pm

    When initializing dropdownlist with database, one should bind it to datasource(or dataadapter), and should set selectedIndex. Then, for row update the selected value should be kept on select.

    Column definition may be like:

    { text: 'Urun', columntype: 'dropdownlist', datafield: 'UrunAdi', width: 177,
                      initeditor: function (row, cellvalue, editor) {
                          var urunId = $('#jqxgrid').jqxGrid('getcellvalue', row, "UrunId");
                          editor.jqxDropDownList({ displayMember: 'UrunAdi', source: dropdownListAdapter, selectedIndex: urunId });
                          $(document).on('select', editor, function (event) {
                              selectedUrunId = editor.jqxDropDownList('getSelectedIndex');
                          });
                      }
    }
    

    The variable “selectedUrunId” should be defined globally, maybe like var selectedUrunId = -1; before jqxgrid initialization. Then in updaterow definition(it is in source definition) the selected value of dropdown should be used. It may be like:

    if (selectedUrunId != undefined && selectedUrunId != -1) {
                        rowdata.UrunId = selectedUrunId;
                        selectedUrunId = -1;
                    }
    

    The overall scene for this scenario is:

            // prepare the data
            var gridSource = {
                datatype: "json",
                datafields: [{ name: 'KargoId' }, { name: 'UrunAdi' }, { name: 'UrunId', type: 'int' }],
                url: 'BindGrid',
                updaterow: function (rowid, rowdata) {
                    // synchronize with the server - send update command  
                    if (selectedUrunId != undefined && selectedUrunId != -1) {
                        rowdata.UrunId = selectedUrunId;
                        selectedUrunId = -1;
                    }                   
    
                    var data = $.param(rowdata);
    
                    $.ajax({
                        dataType: 'json',
                        url: 'UpdateEditGrid',
                        data: data,
                        success: function (data, status, xhr) {
                            gridDataAdapter.dataBind();                            
                        },
                        error: function (xhr, status, error) {
                            alert(JSON.stringify(xhr));
                        }
                    });
                }
            };
    
            var gridDataAdapter = new $.jqx.dataAdapter(gridSource);
    
            var dropdownSource = {
                datatype: "json",
                datafields: [{ name: 'UrunId' }, { name: 'UrunAdi'}],
                url: 'BindDropdown'
            };
    
            var selectedUrunId = -1;
            var dropdownListAdapter = new $.jqx.dataAdapter(dropdownSource);
    
            // initialize jqxGrid
            $("#jqxgrid").jqxGrid(
            {
                width: 670,
                source: gridDataAdapter,
                editable: true,
                theme: theme,
                selectionmode: 'singlecell',
                columns: [
                  { text: '#', datafield: 'KargoId', width: 40 },                  
                  { text: 'Urun', columntype: 'dropdownlist', datafield: 'UrunAdi', width: 177,
                      initeditor: function (row, cellvalue, editor) {
                          var urunId = $('#jqxgrid').jqxGrid('getcellvalue', row, "UrunId");
                          editor.jqxDropDownList({ displayMember: 'UrunAdi', source: dropdownListAdapter, selectedIndex: urunId });
                          $(document).on('select', editor, function (event) {
                              selectedUrunId = editor.jqxDropDownList('getSelectedIndex');
                          });
                      }
                  }]
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying jqwidget grid with json data inside a mvc project. Grid cell formatting
Jqwidget checkbox in grid cell is allways checked even if its value coming from
i am using jqwidgets to bind the gird like mentioned below: var url =
I'm using jqWidgets with ASP.MVC. I am populating a dropdown list, when the form
I am struggling to see where I am getting an error of 'rowdata is
I have fullcalendar placed inside a tab based on the jqwidgets . When I
If the goal is to develop a web app that will currently be used
So something weird is happening for me here... i have had borders on my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.