I am using gridview with some columns few are :
<asp:templatefield headertext="Title Description" sortexpression="Description">
<itemtemplate>
<asp:Label id="Description" runat="server" Text='<%# Bind("Description")%>'></asp:Label>
</itemtemplate>
<edititemtemplate>
<asp:textbox id="Description" runat="server" CssClass="form-control" text='<%# Bind("Description") %>' />
</edititemtemplate>
</asp:templatefield>
<asp:templatefield headertext="Title Abbreviation" sortexpression="Abbreviation">
<itemtemplate>
<asp:Label id="Abbreviation" runat="server" Text='<%# Bind("Abbreviation")%>'></asp:Label>
</itemtemplate>
<edititemtemplate>
<asp:textbox id="Abbreviation" runat="server" CssClass="form-control" text='<%# Bind("Abbreviation") %>' />
</edititemtemplate>
</asp:templatefield>
<footertemplate>
<asp:Button ID="AddGridAddBTN" runat="server" OnClick="AddGridAddBTN_OnClick" Width="100%" CssClass="btn btn-info tooltips" Text="Add Row" />
<asp:Button ID="AddGridSubmitBTN" runat="server" OnClick="AddGridSubmitBTN_OnClick" CssClass="btn btn-success tooltips" Width="100%" Text="Submit" />
</footertemplate>
Now this AddGridAddBTN Temporarily adds a data row to a grid but won't submit that data to database , however AddGridSubmitBTN Submits the data to DB through foreach loop .
Now my query is i want to provide user a functionality that when he gets focus on Abbreviation Text Box OR Description Box and he after typing some data Press ENTER KEY , This ENTER KEY would provide funcionality as a AddGridAddBTN Button , and when he presses SHIFT + ENTER , It works like AddGridSubmitBTN Button , also i want to make Abbreviation and Description Field to be filled must !
Moral is that :
ENTER KEY WOULD DO : Generate a temporary row with holding previous values as it is actually doing on AddGridAddBTN Button.
SHIFT + ENTER WOULD DO : Enter the whole grid data thorugh foreach loop as it is actually doing on AddGridSubmitBTN Button.
NOTE : I dont want to refresh my page on enter or shift enter pressing .
HELP : This grid is binded through SQL DATA SOURCE