Situation:
I have multiple-paged Grid control on the page. It showing all positions in cathegory that user selected.
User can search items via search-engine and it shows elements as a list.
When user clicks on element in search-list, I need to refresh Grid and load all elements from cathegory clicked element belongs to.
Also I need to select this element in Grid and there is the problem: I can not find it in Grid.Items collection if this element not on current page.
Do anybody knows how to get all items ( but not only items from currently selected page ) or may be I doing something worng and there is another way should be used?
<
asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" />
Refresh Allocation list
</asp:LinkButton>
...
<
radG:GridClientDeleteColumn ConfirmText="Delete this Project?" ButtonType="ImageButton"
ImageUrl="Images\Delete.gif" CommandName="Delete" Text="Delete"
UniqueName="DeleteColumn">
<HeaderStyle Width="16px" />
<ItemStyle HorizontalAlign="Center" />
</radG:GridClientDeleteColumn>
...
protected void RadGrid1_DeleteCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.DeleteCommandName)
{
string ProjectId = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ProjectId"].ToString();
string Resource = e.Item.OwnerTableView.Items[e.Item.ItemIndex]["Resource"].ToString();
string Role = e.Item.OwnerTableView.Items[e.Item.ItemIndex]["Role"].ToString();
string Year = e.Item.OwnerTableView.Items[e.Item.ItemIndex]["Year"].ToString();
AllocationsDataSource.DeleteCommandType =
SqlDataSourceCommandType.StoredProcedure;
AllocationsDataSource.DeleteCommand =
"RAT_OWNER.DeleteAllocations";
AllocationsDataSource.DeleteParameters.Clear();
AllocationsDataSource.DeleteParameters.Add(
"ProjectId", ProjectId);
AllocationsDataSource.DeleteParameters.Add(
"Resource", Resource);
AllocationsDataSource.DeleteParameters.Add(
"Role", Role);
AllocationsDataSource.DeleteParameters.Add(
"Year", Year);
RadGrid1.Rebind();
}
}
