I have created a dataGrid on a web form using VB.Net. Here is what I am trying to do...
The first column in the dataGrid I have created an ItemTemplate. What I would like for it to do is either display a textbox or a label. Basically, if there is a name in the recordset I pulled from my stored procedure, print it out. If not, I want a textbox to display with the text Vacant Slot. I am getting it to either print the name or the words "Vacant Slot" but I can't get it to show up in a textbox. Any suggestions?? Thanks in advance.
this is from my html page.....
<%# RenderNameField(Databinder.Eval (Container, "DataItem.vacancy_flag"),Databinder.Eval
(Container, "DataItem.Name")) %>
this is from my codebehind page......
Function RenderNameField(ByVal sVacantFlag As String, ByVal sText As
String) As String
If Not Convert.ToBoolean(Byte.Parse(sVacantFlag)) Then
Return "" & sText & ""
Return "Vacant Slot"