conditional statement inside a Datagrid ItemTempla

penguin14

New Member
I can't quit figure out how to put a conditional staement inside an ItemTemplate.<BR><BR>Example : I want to have the record in a column be a link by using the value in another column as the HREF value in the link - only if there is a value in the column I'm using for the href.<BR><BR>In traditional ASP I would use an IF statement to control this. How could that be done here?I dont use datagrids. Only repeaters. But in repeaters there is an event called item_databound. It fires everytime an item is databound. From there I use findcontrol to locate the control im trying to modify. Read up on the events for the datagrid in the .net framework sdk Im sure there is tons of ways to do what you want.I had the same problem while using repeaters..I want to display a row if there exists a record in the database. eg<BR><BR><%if Container.DataItem("Authors") NOT NULL THEN%><BR><tr> <td> Container.DataItem("Authors")</td></tr><BR><%end if%><BR><BR>DO u know how to implement this using the Item_databound event<BR>Thanx<BR>shreekSorry, no.
 
Back
Top