473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Rename and sort datagrid columns

Hi, I'm new to datagrids and was hopping to get some help. I tried to bind
an arraylist to a datagrid but the columns seem to be displayed in a random
order for some reason. Is there someway that I can specify what order they
should be in and also give them new names? Also is there someway to hide
certain columns from the datagrid at all? Thanks.
Nov 21 '05 #1
3 1669
The HowTo to your question would depend on if you are building a Web or
window app.

I have examples of both on this link.

http://www.wizkil-webs.net/NET/DotNET_Code_Samples.htm
also
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp

BrianDH

"Marco" wrote:
Hi, I'm new to datagrids and was hopping to get some help. I tried to bind
an arraylist to a datagrid but the columns seem to be displayed in a random
order for some reason. Is there someway that I can specify what order they
should be in and also give them new names? Also is there someway to hide
certain columns from the datagrid at all? Thanks.

Nov 21 '05 #2
You need to create a DataGridTableStyle. Check out the link below for an
article from George Shepherd's Windows Forms FAQ on how to do this.

http://www.syncfusion.com/faq/winforms/search/818.asp

--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada
"Marco" <no****************@hotmail.com> wrote in message
news:uo**************@tk2msftngp13.phx.gbl...
Hi, I'm new to datagrids and was hopping to get some help. I tried to bind an arraylist to a datagrid but the columns seem to be displayed in a random order for some reason. Is there someway that I can specify what order they should be in and also give them new names? Also is there someway to hide
certain columns from the datagrid at all? Thanks.

Nov 21 '05 #3
Thanks for your help.

"BrianDH" <Br*****@discussions.microsoft.com> wrote in message
news:90**********************************@microsof t.com...
The HowTo to your question would depend on if you are building a Web or
window app.

I have examples of both on this link.

http://www.wizkil-webs.net/NET/DotNET_Code_Samples.htm
also
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp

BrianDH

"Marco" wrote:
Hi, I'm new to datagrids and was hopping to get some help. I tried to bind an arraylist to a datagrid but the columns seem to be displayed in a random order for some reason. Is there someway that I can specify what order they should be in and also give them new names? Also is there someway to hide certain columns from the datagrid at all? Thanks.

Nov 21 '05 #4

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

Similar topics

4
by: Bruce Pullum | last post by:
I have a datagrid that I am using a DataView with. All works great for the sorting of the columns. However, after I sort the column, and then try and select a data row to edit, the row selected...
1
by: Webgour | last post by:
Hi, I'm tring to add a column to a datagrid with a linkbutton as header that can be used to sort the column. The column and the linkbutton are added programmatically (see below). However the...
7
by: DC Gringo | last post by:
I have a datagrid that won't sort. The event handler is firing and return label text, just not the sort. Here's my Sub Page_Load and Sub DataGrid1_SortCommand: -------------------- Private...
4
by: yer darn tootin | last post by:
Does anyone know the sort expression for a column that's data has been returned in the format, eg '07 Jul 05'?? The sort expression {..:"dd mmm yy"} doesn't work ( if the column was returned as...
1
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting,...
4
by: Joe | last post by:
Hello, I have a datagrid in an nested html table (one table inside of another table) and have set the allowsSorting property to true. I've created in the code-behind a method (Sub - I'm using...
1
by: nate axtell | last post by:
In VB .NET I load the contents of an Excel or comma seperated values file into a dataGrid (via a datatable). One of the columns has a comma in the name of the column. So for the comma separated...
0
by: thomasp | last post by:
I have a datagridview that allows the user to sort the column by clicking on the header of the column the user wishes to sort. I did not code this, it had the ability when the datagrid was...
2
by: Scott | last post by:
I am trying to sort a datagrid which contains 5 checkbox columns. All other columns sort properly except these 5 checkbox columns which dont sort at all. I am using ASP.NET 1.1 and this code is...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.