Add search by key or value to localization:
File: NopCommerceStore\Administration\Modules\LocaleStringResources.ascx
Line: add at 23
<td class="adminTitle" style="padding-left:25px; white-space:nowrap" runat="server" id="tdSearch">
<%=GetLocaleResourceString("Admin.LocaleStringResources.PageSize")%>: <asp:DropDownList runat="server" ID="ddlPageSize" AutoPostBack="true" Style="margin-right:20px;" OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged" />
<%=GetLocaleResourceString("Admin.LocaleStringResources.SearchByKey")%>
<asp:TextBox ID="txtSearchByKey" runat="server" />
<asp:Button runat="server" ID="btnSearchByKey" CssClass="adminButtonBlue" Text="<% $NopResources:Admin.LocaleStringResources.SearchButton.Text %>"
OnClick="btnSearchByKey_Click" ToolTip="<% $NopResources:Admin.LocaleStringResources.SearchButton.Tooltip %>" Style="margin-right:20px;" />
<%=GetLocaleResourceString("Admin.LocaleStringResources.SearchByValue")%>
<asp:TextBox ID="txtSearchByValue" runat="server" />
<asp:Button runat="server" ID="btnSearchByValue" CssClass="adminButtonBlue" Text="<% $NopResources:Admin.LocaleStringResources.SearchButton.Text %>"
OnClick="btnSearchByValue_Click" ToolTip="<% $NopResources:Admin.LocaleStringResources.SearchButton.Tooltip %>" />
</td>
File: NopCommerceStore\Administration\Modules\
at the end of "FillDropDowns()":
this.ddlPageSize.Items.Clear();
Enumerable.Range(1, 20).ToList().ForEach(x => ddlPageSize.Items.Add((x * 100).ToString()));
in "BindGrid()" after "var resourceDictionary = language.LocaleStringResources;"
gvLocaleStringResources.PageSize = int.Parse(ddlPageSize.SelectedValue);
if ( !String.IsNullOrWhiteSpace(txtSearchByKey.Text) ) {
txtSearchByKey.Text = txtSearchByKey.Text.ToLower();
resourceDictionary = resourceDictionary
.Where(x => !String.IsNullOrEmpty(x.Value.ResourceName) && x.Value.ResourceName.ToLower().Contains(txtSearchByKey.Text))
.ToDictionary(x => x.Key, x => x.Value);
}
if ( !String.IsNullOrWhiteSpace(txtSearchByValue.Text) ) {
txtSearchByValue.Text = txtSearchByValue.Text.ToLower();
resourceDictionary = resourceDictionary
.Where(x => !String.IsNullOrEmpty(x.Value.ResourceValue) && x.Value.ResourceValue.ToLower().Contains(txtSearchByValue.Text))
.ToDictionary(x => x.Key, x => x.Value);
}
tdSearch.Visible = ddlLanguage.SelectedIndex > 0;
at the end of "BindGrid()":
ddlPageSize.Visible = tdSearch.Visible = btnAddNew.Visible;
at the end of file:
protected void btnSearchByKey_Click(object sender, EventArgs e)
{
txtSearchByValue.Text = null;
BindGrid();
}
protected void btnSearchByValue_Click(object sender, EventArgs e)
{
txtSearchByKey.Text = null;
BindGrid();
}
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
BindGrid();
}