Bineesh  Viswanath

Bineesh Viswanath

  • NA
  • 1k
  • 777.4k

Telerik Virtual Grid Displays "Table" in GridView

Jan 16 2017 6:44 AM
Sir,
 
I am in work to load a huge amount of data into gridview in windows form. 
 
I using Telerik radGridView for this. 
 
Data is coming into dataset and the remaining work is only to display in proper order.
 
My  code is :-
 
SqlConnection sqlCon = new SqlConnection(strCon);
sqlCon.Open();
SqlCommand cmd = new SqlCommand("SearchCustomerbyMobile", sqlCon);
cmd.Parameters.Add("@asMobile", SqlDbType.NVarChar).Value = tbxMobileNo.Text;
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter adapter = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
adapter.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
this.dgvActiveCustomer.CellValueNeeded += new GridViewCellValueEventHandler(dgvActiveCustomer_CellValueNeeded);
this.dgvActiveCustomer.CellValuePushed += new GridViewCellValueEventHandler(dgvActiveCustomer_CellValuePushed);
dgvActiveCustomer.VirtualMode = true;
dgvActiveCustomer.ColumnCount = ds.Tables[0].Columns.Count;
this.dgvActiveCustomer.RowCount = ds.Tables[0].Rows.Count;
moBileDs = ds;
}
And in CellValueNeed event I worte like this:-
private void dgvActiveCustomer_CellValueNeeded(object sender, Telerik.WinControls.UI.GridViewCellValueEventArgs e)
{
e.Value = moBileDs.Tables[0];
}
 
Result ="Table" in entire rows and columns in the gridview.
 
 
 

Answers (1)