Subject: Problem in binding DataBound Column of DataGrid
Posted By: su Post Date: 12/1/2006 1:21:31 PM
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!
 
 

Go to topic 17359

Return to index page 105
Return to index page 104
Return to index page 103
Return to index page 102
Return to index page 101
Return to index page 100
Return to index page 99
Return to index page 98
Return to index page 97
Return to index page 96