Attached is a screen snapshot that shows the "click to sort" feature I want to disable.
Also attached is a zipped project which demonstrates that all I did was add the grid and it is giving me the "click to sort" feature automatically. I don't wan the users to be able to sort the grid.
How do I get rid of the "click to sort"?
Here is the .asp:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="dynamicAsposeGridWeb.WebForm1" %>
<%@ Register Assembly="Aspose.Cells.GridWeb" Namespace="Aspose.Cells.GridWeb" TagPrefix="acw" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<acw:gridweb ID="gridWeb1" runat="server"></acw:gridweb>
</div>
</form>
</body>
</html>
Here is the code behind:
using System;
using System.Data;
using System.Data.OleDb;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Aspose.Cells.GridWeb;
using Aspose.Cells.GridWeb.Data;
namespace dynamicAsposeGridWeb
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack == true)
{
License license = new License();
license.SetLicense("Aspose.Cells.lic");
String connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Program Files\\Aspose\\Aspose.Cells for .NET\\Demos\\Common\\Database\\demos.mdb";
OleDbConnection conn = new OleDbConnection(connString);
//OleDbCommand cmd = new OleDbCommand("SELECT *, +1 FROM PRODUCTS", conn);
OleDbCommand cmd = new OleDbCommand("SELECT *, -1 FROM PRODUCTS", conn); //<-- this was crashing with previous dll
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
DataSet ds = new DataSet();
conn.Open();
da.Fill(ds, "PRODUCTS");
conn.Close();
WebWorksheet ws = gridWeb1.WebWorksheets[0];
ws.Cells.Clear();
ws.EnableCreateBindColumnHeader = true;
ws.DataSource = ds.Tables[0];
ws.CreateAutoGenratedColumns();
ws.DataBind();
}
}
}
}