Adding A Control to datagrid

asp.net United States
  • 18 years ago

    Hi,


    I want to add a control to a datagrid depending upon the value returned by a Stored Procedure.
    But i am not able to do so. Pls help me out.
    The code which i had written...


    In aspx.vb


    Public Function IsXMLNull(ByVal objXMLReport As Object, ByVal objScheduledDate As Object, ByRef blnLabel As Boolean) As Boolean
           Try
               If objXMLReport Is DBNull.Value Then
                   blnLabel = True
               Else
                   blnLabel = False
               End If
           Catch
               Response.Write(Err.Description)
           End Try


       End Function



    in aspx
    <%#IsXMLNull(Container.DataItem("ReportXML"),Container.DataItem("ScheduledDate"), blnLabel)    %>
                                               
                                               <%  
                                                   If blnLabel = True Then
                                               %>
                                                   <asp:Label id="lblDate" runat="server" Text='<%# Container.DataItem("ScheduledDate")%>'></asp:Label>
                                               <%    
                                                   Else    
                                               %>
                                                   <asp:LinkButton id="Date" runat="server" OnCommand="UserCommand" CommandArgument= '<%# Container.DataItem("ScheduledDate")%>' Text='<%# Container.DataItem("ScheduledDate")%>' >
                                                   </asp:LinkButton>
                                               <%
                                                   End If
                                               %>

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.” - Donald Knuth