本文整理汇总了C#中GridCommandEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridCommandEventArgs类的具体用法?C# GridCommandEventArgs怎么用?C# GridCommandEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GridCommandEventArgs类属于命名空间,在下文中一共展示了GridCommandEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _grdUserUnit_ItemCommand
protected void _grdUserUnit_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
{
GridEditableItem editedItem = e.Item as GridEditableItem;
string _ID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID"].ToString();
GridDataItem item = e.Item as GridDataItem;
if (item != null)
{
LinkButton button = item["Disable"].Controls[0] as LinkButton;
if (button.Text == "Enable")
{
if (_rdoUnit.Checked)
EnableUnit(_ID);
}
else if (button.Text == "Disable")
{
if (_rdoUnit.Checked)
DisableUnit(_ID);
//else if (_rdoUser.Checked)
//DisableUser(_ID);
}
}
}
}
示例2: ucTourists_onTouristUpdated
protected void ucTourists_onTouristUpdated(object sender, GridCommandEventArgs e)
{
this.lblUpdated.Text = "Updated: " + ((GridEditableItem)e.Item).GetDataKeyValue("PolTuristiSaraksts").ToString();
var intTouristId = (int)((GridEditableItem)e.Item).GetDataKeyValue("PolTuristiSaraksts");
var itemTourist = ucTourists.TouristsList.Where(n => n.PolTuristiSaraksts == intTouristId).FirstOrDefault();
itemTourist.Fransize = itemTourist.PolTuristiSaraksts * 5;
}
示例3: RadGrid1_InsertCommand
protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
{
var item = e.Item as GridEditableItem;
var values = new Hashtable();
item.ExtractValues(values);
BLL.Users.Insert(values);
}
示例4: RadGrid1_InsertCommand
protected void RadGrid1_InsertCommand(object source, GridCommandEventArgs e)
{
var editableItem = ((GridEditableItem)e.Item);
Hashtable values = new Hashtable();
editableItem.ExtractValues(values);
try
{
var posName = values["PositionName"] as string;
if (posName == null || string.IsNullOrEmpty(posName.Trim()))
{
ShowErrorMessage(Pharma.Please_provide_name_to_add);
e.Canceled = true;
}
else
{
var result = repo.Add(posName.Trim());
if (!result)
{
ShowErrorMessage("Position Name is unique, please choose another name.");
e.Canceled = true;
}
}
}
catch (System.Exception ex)
{
ShowErrorMessage(ex.Message);
e.Canceled = true;
}
}
示例5: RadGrid1_OnItemCommand
protected void RadGrid1_OnItemCommand(object sender, GridCommandEventArgs e)
{
try
{
GridDataItem item = (GridDataItem)e.Item;
string id = item["colId"].Text;
switch (e.CommandName)
{
case "btnSelect":
{
Response.Redirect("DesignationInformation.aspx?id="+id,true);
break;
}
case "btnDelete":
int del = new Designation().DeleteDesignationByDesignationId(int.Parse(id));
if (del == 0)
Alert.Show("Data is not deleted");
else
{
this.LoadDesignationTable();
}
break;
}
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
示例6: BlogGrid_ItemCommand
protected void BlogGrid_ItemCommand(Object sender, GridCommandEventArgs e)
{
try
{
if (e.CommandName == "Delete")
{
GridEditableItem item = (GridEditableItem)e.Item;
Object id = item.GetDataKeyValue("ID");
try
{
BlogManager.Current.Delete(Convert.ToInt32(id));
BlogManager.Current.Save();
}
finally
{
BlogManager.Current.Reset();
}
}
}
catch (Exception ex)
{
SetMessage("Article cannot be deleted. Reason: " + ex.Message);
e.Canceled = true;
}
finally
{
BlogGrid.Rebind();
}
}
示例7: RadGrid1_InsertCommand
protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
{
GridEditableItem item = e.Item as GridEditableItem;
Hashtable values = new Hashtable();
item.ExtractValues(values);
roles.Insert(values);
}
示例8: grdConference_ItemCommand
protected void grdConference_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.Item != null)
{
string[] commandsToCloseOtherItemsFor = { RadGrid.InitInsertCommandName, RadGrid.EditCommandName };
if (commandsToCloseOtherItemsFor.Contains(e.CommandName))
{
e.Item.OwnerTableView.IsItemInserted = false;
e.Item.OwnerTableView.ClearChildEditItems();
}
if (e.CommandName.Equals(RadGrid.ExpandCollapseCommandName))
{
e.Item.OwnerTableView.IsItemInserted = false;
e.Item.OwnerTableView.ClearChildEditItems();
if (e.Item is GridDataItem)
{
foreach (GridDataItem item in e.Item.OwnerTableView.Items.OfType<GridDataItem>().Where(it => it != e.Item))
{
item.Expanded = false;
}
}
}
if (e.CommandName.Equals(RadGrid.RebindGridCommandName))
{
GridTableView table = e.Item.OwnerTableView;
table.SortExpressions.Clear();
table.Rebind();
e.Canceled = true;
}
}
}
示例9: MenuGrid_ItemCommand
protected void MenuGrid_ItemCommand(Object sender, GridCommandEventArgs e)
{
try
{
GridEditableItem item = (GridEditableItem)e.Item;
Int32 id = (Int32)item.GetDataKeyValue("ID");
if (e.CommandName == "Delete")
{
try
{
if (MenuManager.Current.Delete(id))
MenuManager.Current.Save();
else
ShowMessage("Item cannot be removed: menu contains a child items.");
}
finally
{
MenuManager.Current.Reset();
}
}
}
catch (Exception ex)
{
ShowMessage("Activity cannot be deleted. Reason: " + ex.Message);
e.Canceled = true;
}
finally
{
MenuGrid.Rebind();
}
}
示例10: rgAdminListDepartment_InsertCommand
protected void rgAdminListDepartment_InsertCommand(object source, GridCommandEventArgs e)
{
GridEditableItem dataItem = (GridEditableItem)e.Item;
int departmentId = 0;
TextBox txtDepartmentName = (TextBox)dataItem["DepartmentName"].Controls[0];
TextBox txtDescription = (TextBox)dataItem["Description"].Controls[0];
if (txtDepartmentName.Text == string.Empty || txtDescription.Text == string.Empty)
{
ShowAlertMessage("Please enter the department and description to add!");
}
else
{
int IsSaved = new AdministrationBAL().InsertDepartment(departmentId, txtDepartmentName.Text, txtDescription.Text);
if (IsSaved < 0)
ShowAlertMessage("Entered Department is already exists!");
else
{
ShowAlertMessage("New Department Saved successfully!");
}
}
BindDepartment(false);
}
示例11: pGrid_ItemCommand
void pGrid_ItemCommand(object sender, GridCommandEventArgs e)
{
Int64 Key = 0;
// Get the ID for the row to select or delete
if (e.CommandName.ToUpper() == "SELECT" || e.CommandName.ToUpper() == "DELETE")
{
//Key = Methods.Convert_Int64(this.UserGrid.pGrid.MasterTableView.Items[e.Item.ItemIndex].GetDataKeyValue("RecruitmentTestUserID").ToString());
Key = this.UserGrid.GetKey(e.Item.ItemIndex);
}
switch (e.CommandName)
{
case "Select":
this.Response.Redirect(@"~/Page/User_Details.aspx?ID=" + Key);
break;
case "Delete":
ClsKeys ClsKey = new ClsKeys();
ClsKey.Add("RecruitmentTestUserID", Convert.ToInt64(Key));
this.ClsUser.Load(ClsKey);
this.ClsUser.Delete();
this.UserGrid.RebindGrid();
break;
}
}
示例12: RadGrid1_OnItemCommand
protected void RadGrid1_OnItemCommand(object sender, GridCommandEventArgs e)
{
try
{
GridDataItem item = (GridDataItem)e.Item;
string id = item["colId"].Text;
switch (e.CommandName)
{
case "btnSelect":
Response.Redirect("ChartOfAccounting.aspx?id=" + id, true);
break;
case "btnDelete":
//int delete = new Bank().DeleteBankByBankId(int.Parse(id));
int delete = new ChartOfAccount().DeleteChartOfAccountByCoaId(int.Parse(id));
if (delete == 0)
{
Alert.Show("Data was not delete..");
}
else
LoadChartOfAccountTable();
break;
}
}
catch (Exception ex)
{
Alert.Show(ex.Message);
}
}
示例13: RadGrid1_ItemCommand
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "btntradedetails")
{
GridDataItem item = (GridDataItem)e.Item;
int paymentkey = Convert.ToInt32(item["payments_key"].Text);
LoadTradeDetails(paymentkey);
pnltradedetails.Visible = true;
}
if (e.CommandName == "btnWithdraw")
{
GridDataItem item = (GridDataItem)e.Item;
int paymentkey = Convert.ToInt32(item["payments_key"].Text);
Payment paymenttemp = sitetemp.getPayment(paymentkey);
Int64 payment_payment_object_key = sitetemp.getpaymentobject(6, paymentkey);
Users user_requestor = sitetemp.get_user_info(paymenttemp.Requestor_user_key);
sitetemp.InternalTransaction(paymenttemp.Buy_currency, paymenttemp.Buy_amount, payment_payment_object_key, paymenttemp.Payment_object_receiver, currentuser.User_key, "From Payment object to Withdrawl Bank Account", 1, paymentkey);
Peerfx_DB.SPs.UpdatePaymentStatus(paymentkey, 5).Execute(); //payment delivered
//payment completed, send email
Peerfx.External_APIs.SendGrid sg = new Peerfx.External_APIs.SendGrid();
sg.Send_Email_Payment_Completed(paymenttemp.Payments_Key, user_requestor);
RadGrid1.Rebind();
}
}
示例14: rGridAddress_DeleteCommand
/// <summary>
/// rGridAddress_DeleteCommand - Is executed if the 'Delete' command is called
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void rGridAddress_DeleteCommand(object sender, GridCommandEventArgs e)
{
GridEditableItem eeditedItem = e.Item as GridEditableItem;
sp_Sample_Address_Select_DM cSampleAddress = new sp_Sample_Address_Select_DM();
cSampleAddress.AddrID = Convert.ToInt32(eeditedItem.OwnerTableView.DataKeyValues[eeditedItem.ItemIndex]["AddrID"]);
BLL.DeleteSampleAddressContext(cSampleAddress);
}
示例15: grid_OnDeleteCommand
protected void grid_OnDeleteCommand(object sender, GridCommandEventArgs e)
{
try
{
var item = (e.Item as GridEditableItem);
// ReSharper disable PossibleNullReferenceException
var roleId = Guid.Parse(item.GetDataKeyValue("RoleId").ToString());
// ReSharper restore PossibleNullReferenceException
var userId = Guid.Parse(item.GetDataKeyValue("UserId").ToString());
var ur = new UserRole
{
UserId = userId,
RoleId = roleId,
State = State.删除
};
HomoryContext.Value.UserRole.AddOrUpdate(ur);
HomoryContext.Value.SaveChanges();
LogOp(OperationType.删除);
grid.Rebind();
Notify(panel, "操作成功", "success");
}
// ReSharper disable EmptyGeneralCatchClause
catch
// ReSharper restore EmptyGeneralCatchClause
{
}
}