Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / DataGrid / February 2006

Tip: Looking for answers? Try searching our database.

Sort() : JoinTextBoxColumn - DataGridTextBoxColumn

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
--=OpTyLeR=-- - 09 Jan 2006 15:11 GMT
Hello,

I'am using this class :
 http://support.microsoft.com/default.aspx?scid=kb;en-us;Q319076

and i want to sort the datagrid by the text obtained in feild 2 and not by
the id of the thirst column ...

thanx for reply.
Elton Wang - 10 Jan 2006 02:57 GMT
In order to sort a datagrid, you need sort the datagrid's underlying data
source, i.e. DataTable (actually DataView). Following code shows how to
sort:

DataView dv = datatable.DefaultView;
dv.Sort = "filed_name";
// or  descending
dv.Sort = "filed_name DESC";
datagrid.DataSource = dv;
datagrid.DataBind();

HTH
> Hello,
>
[quoted text clipped - 5 lines]
>
> thanx for reply.
--=OpTyLeR=-- - 27 Feb 2006 16:59 GMT
Thank's Elton for the reply,
but your answer don't solve my mistake :'(
the fact datas in the first dataView are IDs and not by Names don't sort the
list alphabetically ...

I take the names of columns with the DataGridTextBoxColumn class.

Sample of my code :
DataGridTableStyle tableStyleBilan = new DataGridTableStyle();
tableStyleBilan.MappingName =
_baseh.getTableHepato(Bilan.TABLE_NAME).tableName;
JoinTextBoxColumn colExamen = new
JoinTextBoxColumn(Bilan.EXAMEN_BILAN_RELATION,
_nouveaudataset.Tables["examen"].Columns["Nom"]);

colExamen.MappingName = "IdExamen";
colExamen.HeaderText = "Examen";
colExamen.Width = 150;
tableStyleBilan.GridColumnStyles.Add(colExamen);

thank's again  

"Elton Wang" a écrit :

> In order to sort a datagrid, you need sort the datagrid's underlying data
> source, i.e. DataTable (actually DataView). Following code shows how to
[quoted text clipped - 17 lines]
> >
> > thanx for reply.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.