Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 December 1st, 2006, 02:21 PM
su su is offline
Authorized User
 
Join Date: Nov 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem in binding DataBound Column of DataGrid

I am using C#.net, Visual Web Developer 2005, SQL Server 2000.

I have a datagrid in my WebForm which has some Template Columns and DataBound Columns.

Now in One of my Bound Column, I would like to display database results based on my SQL query.

I know that I can display it using following code in HTML(.aspx file).

<asp:BoundColumn DataField="OSP_FSD" HeaderText="ETD Date" DataFormatString ="{0:MM/dd/yyyy}"></asp:BoundColumn>

Where OSP_FSD is one of the Database column name.

But My problem is I can not put DataField = "OSP_FSD" as it refers to only one column of database.

I have to bind ETD Date Column based on following cirteria. Split is one of the result of a main SQL query.

If Split = 1

{

// OSP_FSD is Database Column name

Bind it with OSP_FSD

}

else

{

// ORD_ETD is database column name

Bind it with ORD_ETD

}

I think I can not use DataItemBound Event has it just allows to play with binded data. and in my case I have to play with data before it binds the datagrid.

Please HELP!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding A Databound Column Dynamically in DataGrid Theone84 ASP.NET 2.0 Professional 0 July 30th, 2008 11:26 PM
Problem with binding data in Datagrid Samatha ASP.NET 1.0 and 1.1 Professional 6 December 6th, 2006 09:13 AM
Probelm in DataBound Column of DataGrid su C# 0 December 4th, 2006 08:39 PM
Datagrid template column problem sonurijs ASP.NET 1.0 and 1.1 Professional 1 September 27th, 2005 12:53 PM
changing values in a column on a databound datagri mischa78 C# 1 May 25th, 2004 07:47 AM





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