<
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();
}
}
