p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# (http://p2p.wrox.com/forumdisplay.php?f=22)
-   -   Probelm in DataGrid Display (http://p2p.wrox.com/showthread.php?t=51190)

su December 6th, 2006 01:12 AM

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!

bijgupt December 8th, 2006 05:00 AM

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


All times are GMT -4. The time now is 11:53 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.