title: Grid View Empty Data Template in ASP.NET
body: <p>I have a Grid View Which populates data when user clicks on search button. If user have not clicked on search button it should show message no data found in selection. I have done the following: </p>
  
  <pre><code> &lt;asp:gridview id="gvSoag" runat="server" AutoGenerateColumns="False"  cssClass="table table-hover"
                      AllowPaging="True" EmptyDataText="No Data found in selection."&gt;
                      &lt;emptydatatemplate&gt;&lt;asp:Label Text="No Data found in selection." runat="server"&gt;&lt;/asp:Label&gt;&lt;/emptydatatemplate&gt; 
                      &lt;HeaderStyle CssClass="alert-danger"/&gt;                             
                      &lt;Columns&gt;
                               &lt;asp:TemplateField HeaderText="Sub Item Name"&gt;
                                  &lt;ItemTemplate&gt;
                                     &lt;asp:Label ID="gvLbSubItemName" runat="server" Text='&lt;%# Eval("SA_Dscr")%&gt;'&gt;&lt;/asp:Label&gt;
                                  &lt;/ItemTemplate&gt;
                              &lt;/asp:TemplateField&gt;
                               &lt;asp:TemplateField HeaderText="Sequence"&gt;
                                  &lt;ItemTemplate&gt;
                                     &lt;asp:Label ID="gvLbSequence" runat="server" Text='&lt;%# Eval("sequence")%&gt;'&gt;&lt;/asp:Label&gt;
                                  &lt;/ItemTemplate&gt;
                              &lt;/asp:TemplateField&gt;
                              &lt;asp:TemplateField HeaderText="Allow"&gt;
                                  &lt;ItemTemplate&gt;
                                     &lt;asp:Image ID="gvLbAllow" runat="server" ToolTip='&lt;%# Convert.ToBoolean(Eval("isSelected")) == false ? ("Not Allowed") : ("Allowed") %&gt;' src='&lt;%# Convert.ToBoolean(Eval("isSelected")) == false ? ("images/redAF.png") : ("images/greenAF.png") %&gt;'/&gt;
                                  &lt;/ItemTemplate&gt;
                              &lt;/asp:TemplateField&gt;
                               &lt;asp:TemplateField HeaderText="Action"&gt;
                                  &lt;ItemTemplate&gt;
                                          &lt;asp:ImageButton ID="imgEdit" Style="padding-right: 4px;  vertical-align: middle;"
                                          runat="server"  CommandArgument='&lt;%# Eval("id") %&gt;' AlternateText="Edit" ImageUrl="images/setting.gif"
                                          OnClick="imgEdit_Click" CausesValidation="false" ToolTip="Edit"/&gt;
                                          &lt;asp:ImageButton ID="imgDelete" Style="padding-right: 4px;  vertical-align: middle;"
                                          runat="server" CommandArgument='&lt;%# Eval("id") %&gt;' AlternateText="Delete" ImageUrl="images/delete.gif"
                                          OnClick="imgDelete_Click" CausesValidation="false" ToolTip="Delete"/&gt;
                                  &lt;/ItemTemplate&gt;
                              &lt;/asp:TemplateField&gt;
                          &lt;/Columns&gt;
                          &lt;PagerSettings Visible="False" /&gt;
  
                    &lt;/asp:gridview&gt;
  </code></pre>
  
  <p>If user selects some dropdowns than it shows message if empty result found. How can I get this to be done that when user comes at very first time it should show some message some thing like please select option search. </p>