Wrox Programmer Forums
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 16th, 2007, 05:53 AM
Registered User
Join Date: Nov 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Bajrang
Default GridView Problems

Hi All,
I am working on GridView.
I used sorting on two columns ASC/DESC alternatively, as usually it is done.
Everything works fine but After changing the Sorting order GridView Displays the desired order but on GVMaterialMaster_SelectedIndexChanging Event,
protected void GVMaterialMaster_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
GridViewRow row = GVMaterialMaster.Rows[e.NewSelectedIndex];
string materialCode = row.Cells[0].Text;

the row.Cells[0].Text always have value of row.Cells[0] of GridView before Sorting. Means row.Cells[0] always have the same value whether sorting is changed or not

Example: GridView's first Row's first cell has value 'A' and Last Row's first cell has value 'X'
Now after sorting GridView is showing first Row's first Cell's value 'X' and Last Row's first cell has value 'A'. Its fine.
Now I Select First Row so It Shold show value of row.Cells[0] as 'X' but It is showing value of row.Cells[0] as 'A'.
I used DataView (creating views runtime according to GridView's DataSource). So Any Idea how to get row.Cells[0] in desird order?
Thanks in Advance.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get GridView Cell Value Based on GridView Column stublair C# 2008 aka C# 3.0 0 September 4th, 2008 08:30 AM
Gridview checkbox problems pauliehaha ASP.NET 2.0 Professional 1 May 3rd, 2007 04:14 AM
Multiple problems with Login system, GridView hindereduseless ASP.NET 2.0 Professional 0 May 3rd, 2006 01:13 AM
multiple problems with logins and gridview hindereduseless ASP.NET 2.0 Basics 0 May 3rd, 2006 01:01 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.