473,765 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid AllowSorting property

I want to prevent my user from clicking on a column header and sorting the
items in my datagrid. I have tried setting the AllowSorting property to
false both in the property pages and in code (in the Form.Load event) but
still, when program runs user can click column header and list re-sorts!!

Thanks,
-Carl
Nov 21 '05 #1
2 2160
Hi,

If you add a tablestyle to your grid set the tablestyles
allowsorting to false.

http://msdn.microsoft.com/library/de...rtingtopic.asp

Ken
--------------------
"Carl Tribble" <ca*********@sb cglobal.net> wrote in message
news:OL******** ******@TK2MSFTN GP14.phx.gbl...
I want to prevent my user from clicking on a column header and sorting the
items in my datagrid. I have tried setting the AllowSorting property to
false both in the property pages and in code (in the Form.Load event) but
still, when program runs user can click column header and list re-sorts!!

Thanks,
-Carl

Nov 21 '05 #2
That's it! Thanks, Ken!!!

-Carl
"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:OX******** ******@TK2MSFTN GP11.phx.gbl...
Hi,

If you add a tablestyle to your grid set the tablestyles
allowsorting to false.

http://msdn.microsoft.com/library/de...rtingtopic.asp
Ken
--------------------
"Carl Tribble" <ca*********@sb cglobal.net> wrote in message
news:OL******** ******@TK2MSFTN GP14.phx.gbl...
I want to prevent my user from clicking on a column header and sorting the
items in my datagrid. I have tried setting the AllowSorting property to
false both in the property pages and in code (in the Form.Load event) but
still, when program runs user can click column header and list re-sorts!!

Thanks,
-Carl

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1570
by: Job Lot | last post by:
I have an Expense Data Entry form which contains a DataGrid showing various expense categories. There are three columns Description, Cash Exp, Credit Exp, where Description column is readonly. Users have to press a checkbox to specify whether they want to use DataGrid to provide break-up or provide total value in textbox. Now when checkbox is unchecked I am setting the Enabled property of DataGrid to False and vice versa. The problem is...
6
5896
by: Eric | last post by:
Dear All, I want to export datagrid content to a Excel file, the code just like below: Response.ContentType = "application/vnd.ms-excel" Response.Charset = "" Me.EnableViewState = False Dim tw As New System.IO.StringWriter() Dim hw As New System.Web.UI.HtmlTextWriter(tw) gridList.Columns(0).Visible = False
7
5689
by: Dave | last post by:
Are there any add-on products or samples available that can do the following in an vb.net datagrid I want to compare 2 rows in a datagrid - one row from one database and another row for another database. So all the even rows would be from database one. All the odd rows would be from database two. Row one and two will have different formats and colors.
2
1007
by: John R. Dougherty | last post by:
The program was written by a different developer who never finished it. Basically, it is a front-end to an Access database that probably should have been done in Access itself. My question concerns the DataGrid control. This control is used on about 30 different forms. The user wants to be able to sort the data in a grid by clicking a column header. The AllowSorting property is turned off on every grid in the project. I thought the fix...
3
1471
by: Gidi | last post by:
Hi, I've a dataGrid, and When I click with the mouse on one of it's header the DataGrid_Click event is called. I don't have problem with the event, but strange things happen to the dataGrid after I click on one of the headers. I have DataSet that bounded to this DataGrid so i could write into the dataGrid, but when i click on the headers new rows are suddenly added, sometime as a first row, sometimes between two exsisting rows. I change...
0
1338
by: rn5a | last post by:
A DataGrid control displays records from a SQL Server 2005 DB table. The AllowSorting property of the DataGrid has been set to True & the SortExpressions of the BoundColumns have been set to the different columns so that users can sort the DataGrid by clicking the headers in the DataGrid. The DataGrid can be sorted using all the headers in the DataGrid except for the first column header. <asp:DataGrid ID="dg1" AllowSorting="true"...
1
7138
by: ECD | last post by:
Hello all, I can usually find solutions to my .NET problems by searching these groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0 framework). I want to disable sorting on the first column in the grid only. I havent found a way to reliably do this yet. I tried putting the following code in the datagrid's mouse down event Dim hti As DataGrid.HitTestInfo
3
7379
by: rn5a | last post by:
A DataGrid has the following TemplateColumn: <asp:DataGrid ID="dgCart"...OnSortCommand="SortGrid" AllowSorting="true"....> <Column> <asp:TemplateColumn HeaderImageUrl="Images\Up.gif" HeaderText="ID" SortExpression="PID"> <ItemTemplate> <asp:Label ID="lblPID" Text=<%# Container.DataItem("PID") %> runat="server"/>
0
2090
by: rupalirane07 | last post by:
Both grids displays fine. But the problem is only parent datagrid sorting works fine but when i clik on child datagrid for sorting it gives me error: NullReferenceException error Any help........pls urgent ========================================================= <%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm3.aspx.vb" Inherits="TestDatagrids.WebForm3"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">...
0
10156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9951
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5275
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.