Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 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 6th, 2006, 01:12 AM
su su is offline
Authorized User
 
Join Date: Nov 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Probelm in DataGrid Display

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

I have a webform which has following stuff.

Textbox : Order# // represents ORD_Numer of database
Textbox : Start Date // represents Start_Date of database
Textbox : end date // represents END_Date of database
DDL : Show Image (yes/no)
Submit Button

Main SQL Query : SELECT ORD_ID, ORD_Number, Start_Date, End_Date FROM Orders

now here I am allowing user to either find order by order# or using Date Range. System takes default dates if User has not entered any date. Now in any case if Show Image DDL = No then DataGrid Does not show column of image. and if Show Image DDL = yes, DataGrid shows column of image with all images for corresponding order.

I will query the database to fetch image if DDL is YES.

Now my code is working without DDL selection. I dont know how to apply rule of DDL.

I was able to simply hide and show image column(i used templetecolumn) on index 0 of datagrid using ddlshowimage.visible == true/fals based on selection using onSelectedIndexChanged property of DDL.

Now my problem is I dont know how to show images (or add images in image column which is @ index 0 of datagrid). Images will be captured dyanmically from database based on ORD_ID.

Does Anybody has any idea how to add images after i bind datagrid based on selection of DDL (I will be able to capture value of DDL after submit button)?

PLEASE HELP!
 
Old December 8th, 2006, 05:00 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts
Default

delare a datatable dt with all requied column and image column.
According to selection of ddl fill dt .i.e. if ddl="yes" select with image column and if ddl="no" then fetch records without image column. and bind this dt to datagrid which already have image column.

Bijgupt





Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGrid Column Display degie C# 2005 0 May 28th, 2007 01:48 AM
Datagrid display Lovehead VB.NET 2002/2003 Basics 1 January 20th, 2007 05:12 PM
Probelm in DataBound Column of DataGrid su C# 0 December 4th, 2006 08:39 PM
to display an icon in datagrid deeraj ADO.NET 4 March 30th, 2005 02:00 AM
Datagrid display deadrocker .NET Web Services 1 February 12th, 2005 07:04 AM





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