Wrox Programmer Forums
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 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 Professional 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 28th, 2007, 01:59 AM
Authorized User
 
Join Date: May 2007
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default GridView

hello every one,

i have gridview GridView2 and i use this method,

protected void GridView2_RowDataBound(object sender, GridViewRowEventArgs e)

{

     if (e.Row.RowType == DataControlRowType.DataRow)

     {
         //int i=(int)e.Row.Cells[10].Text;
         if (Decimal.Parse(e.Row.Cells[10].Text)<24)

            {

                   e.Row.Cells[10].Style.Add("background-color","orange");

             }

     }

}


But it destroyed the sort option.
so when i click to sort by any column ,there was a runtime error like:

Input string was not in a correct format.
Line 431: {
Line 432: //int i=(int)e.Row.Cells[10].Text;
Line 433: if (Decimal.Parse(e.Row.Cells[10].Text)<24)
Line 434:
Line 435: {



I need help ASAP






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 user007 ASP.NET 2.0 Basics 2 June 22nd, 2008 09:30 AM
Gridview Thinlizzy ASP.NET 2.0 Basics 2 July 20th, 2007 08:33 AM
GridView Sheraz Khan ASP.NET 2.0 Basics 1 July 19th, 2007 10:28 AM
GridView simonwilbert ASP.NET 2.0 Basics 4 August 12th, 2006 02:40 AM





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