Click here to Skip to main content
15,887,264 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
function BindGrid() {

                   var TableView = $find("<%=RadGridCompany.ClientID %>").get_masterTableView();
               var currentPageIndex = TableView.get_currentPageIndex();
               var pagesize = TableView.get_pageSize();
               PageMethods.ListOrgLicense(OnsucessGetLicense);
           }
           function OnsucessGetLicense(result) {

               var RadGrid = $find("<%=RadGridCompany.ClientID %>").get_masterTableView();
               RadGrid.set_dataSource(result);
               if (result.length > 0) {
                   RadGrid.set_virtualItemCount(result.length);
                   $("#divSetConfig").hide();
                   $("#divGrid").show();
               }
               else {
                   RadGrid.set_virtualItemCount("0");
                   $("#divSetConfig").show();
                   $("#divGrid").hide();
               }

               RadGrid.dataBind();
           }


What I have tried:

bind gridview using jquery
Posted
Comments
jerin_shalini 25-May-18 4:14am    
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using System.Configuration;

public partial class Database_Operations : System.Web.UI.Page
{
#region Private fields

private SqlConnection SqlCon=new SqlConnection();
public SqlCommand SqlCmd=new SqlCommand();
#endregion

#region Public methods

public Database_Operations(ref StringBuilder Query, bool Isprocedure)
{
SqlCmd = new SqlCommand(Query.ToString());
// SqlCmd.CommandTimeout = 50000;
if (Isprocedure)
SqlCmd.CommandType = CommandType.StoredProcedure;
}
public Database_Operations(string Query, bool Isprocedure)
{
try
{
SqlCmd = new SqlCommand(Query);
// SqlCmd.CommandTimeout = 50000;
if (Isprocedure)
SqlCmd.CommandType = CommandType.StoredProcedure;
}
catch (Exception ex)
{
HttpContext.Current.Response.Write(ex.Message);
}
}


public DataTable GetDataTable_Back()
{
DataTable Dt = new DataTable();
try
{

DataSet Ds = FillDataSet(1);
if (Ds.Tables.Count != 0)
{
Dt = Ds.Tables[0];
return Dt;
}
//else
// Dt = null;
}
catch
{
}

return Dt;
}

public DataSet FillDataSet(int value)
{
if (value==0)
SqlCon = new SqlConnection(ConfigurationManager.ConnectionStrings["SQL_CONNECTION"].ToString());
else
SqlCon = new SqlConnection(ConfigurationManager.ConnectionStrings["SQL_CONNECTIONBACKUP"].ToString());

using (SqlCon)
{
DataSet Ds = new DataSet();
try
{
SqlCon.Open();
SqlCmd.Connection = SqlCon;
SqlDataAdapter SqlAd = new SqlDataAdapter(SqlCmd);
SqlAd.Fill(Ds);
}
catch (Exception ex)
{
//Response.Write(ex.Message);
HttpContext.Current.Response.Write(ex.Message);

}
finally
{
SqlCon.Close();
SqlCon.Dispose();
}
return (Ds);
}
}
public DataTable GetDataTable()
{
DataTable Dt=new DataTable();
try
{

DataSet Ds = FillDataSet(0);
if (Ds.Tables.Count != 0)
{
Dt = Ds.Tables[0];
return Dt;
}
//else
// Dt = null;
}
catch
{
}

return Dt;
}

public DataSet GetDataSet()
{
DataSet Ds = new DataSet();
try
{

Ds = FillDataSet(0);
if (Ds.Tables.Count != 0)
{
//Dt = Ds.Tables[0];
return Ds;
}
// else
//Dt = null;
}
catch
{
}

return Ds;
}

public DataRow GetDataRow()
{
DataRow Dr;
DataSet Ds = FillDataSet(0);
if (Ds != null && Ds.Tables.Count != 0 && Ds.Tables[0].Rows.Count == 1)
jerin_shalini 25-May-18 5:06am    
public DataTable HR_Car_Pickup_S()
{
Database_Operations obj_Db_Operations = new Database_Operations("HR_Car_Pickup_S", true);
obj_Db_Operations.AddParameter("@id", id);
obj_Db_Operations.AddParameter("@Flight_ID", Employee_ID);
return obj_Db_Operations.GetDataTable();
}


public int HR_Car_Pickup_IU(string XML)
{
Database_Operations obj_DO_INSERT = new Database_Operations("HR_Car_Pickup_IU", true);
obj_DO_INSERT.AddParameter("@id", id);

obj_DO_INSERT.AddParameter("@From_Date", From_Date);
obj_DO_INSERT.AddParameter("@Start_Time", Start_Time);
obj_DO_INSERT.AddParameter("@End_Date", End_Date);
obj_DO_INSERT.AddParameter("@Back_Time", Back_Time);
obj_DO_INSERT.AddParameter("@Take_From", Take_From);
obj_DO_INSERT.AddParameter("@Take_To", Take_To);
obj_DO_INSERT.AddParameter("@Responsible_Person", Responsible_Person);
obj_DO_INSERT.AddParameter("@Comments", Comments);
obj_DO_INSERT.AddParameter("@User_ID", User_ID);
obj_DO_INSERT.AddParameter("@XML_DATA_CANDIDATE", XML);
obj_DO_INSERT.AddOutputParameter("@Result");

obj_DO_INSERT.ExecuteQuery();
return Convert.ToInt32(obj_DO_INSERT.SqlCmd.Parameters["@Result"].Value);
}

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