In this article, i am going to give some overview on how to set text in EmptyDataTemplate Dynamically. First We have to define a label in EmptyDataTemplate and call the specified function in its Text Property. After that, just declare the specified function at anywhere in aspx.cs page. Something Like this:-
aspx page
aspx.cs page
aspx page
aspx.cs page
    protected string BindEmptyText()
    {
        if (gvOrders.Rows.Count == 0)
        {
            return "No order was made!!"; // if no row found
        }
        return string.Empty; // if any row found
    }
That’s it!!…..Happy Programming...
 
glad you done it :-)
ReplyDelete