Subject: Probelm in DataGrid Display
Posted By: su Post Date: 12/6/2006 12:12:43 AM
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!
Reply By: bijgupt Reply Date: 12/8/2006 4:00:37 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

Go to topic 53205

Return to index page 99
Return to index page 98
Return to index page 97
Return to index page 96
Return to index page 95
Return to index page 94
Return to index page 93
Return to index page 92
Return to index page 91
Return to index page 90