Click here to Skip to main content
15,886,769 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Want to show dropdownlist in Jgrid in add and edit.help me please


Jquery:

C#
{
                         name: 'CatagoryName', index: 'CatagoryId', width: 200,
                         sortable: true,
                         align: 'center',
                         editable: true,
                         cellEdit: true,
                         edittype: 'select',

                         editoptions: {
                             value : getSequenceNumbers()

                         },
                         editrules:{required:true}

                         },


PHP
function getSequenceNumbers() {
          $.getJSON("/api/SubCatagory/GetCatagory", null, function (data) {
              if (data != null) {
                  $.each(data, function (i) {
                      alert(data[i].CatagoryName);
                      data[i].CatagoryId + ':' + data[i].CatagoryName;


                  })
              }
          });
      }




ApiController:

SQL
public SelectList GetCatagory()
      {
          SelectList lstcatagory = ObjRespository.GetListOfCatagory();
          return lstcatagory;

      }
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900