change gridview values

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yogarajan
    New Member
    • Apr 2007
    • 115

    change gridview values

    hi
    how can i change gridview value
    this is my code
    Code:
    <asp:TemplateField HeaderText="currstatus" SortExpression="currstatus">                
                    <ItemTemplate>
                     <asp:Label ID="Label1" runat="server" Text='<%#(string) printstatus((string)Eval("currstatus")) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
    cs file
    Code:
    public string printstatus(string val)
        {
            string retval="In Active";
            if (val == "1")
            {
                retval = "Active";
            }
            
            return retval;
        }
    it is not working it gives error

    pls help me
  • yogarajan
    New Member
    • Apr 2007
    • 115

    #2
    re:

    hi all

    my problem solve

    pls change code
    <asp:Label ID="Label1" runat="server" Text='<%#(strin g) printstatus((st ring)Eval("curr status")) %>'></asp:Label>

    to
    <asp:Label ID="Label1" runat="server" Text='<%#prints tatus(("currsta tus").ToString( )) %>'></asp:Label>


    thanks

    Comment

    Working...