本文整理汇总了C#中GridItemEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# GridItemEventArgs类的具体用法?C# GridItemEventArgs怎么用?C# GridItemEventArgs使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GridItemEventArgs类属于命名空间,在下文中一共展示了GridItemEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: grdVendorCategory_ItemDataBound
protected void grdVendorCategory_ItemDataBound(object sender, GridItemEventArgs e)
{
//if (e.Item is GridDataItem)
//{
// GridDataItem item = e.Item as GridDataItem;
// foreach (GridColumn column in item.OwnerTableView.RenderColumns)
// {
// if (column.UniqueName == "ContactPhone" ||
// column.UniqueName == "ContactDesignation")
// {
// TextBox tbEditBox = new TextBox();
// tbEditBox.Text = item[column].Text;
// //tbEditBox.CssClass = "gridEditItem";
// //tbEditBox.Width = Unit.Pixel(50);
// tbEditBox.TextChanged += new EventHandler(tbEditBox_TextChanged);
// tbEditBox.AutoPostBack = true;
// item[column].Controls.Clear();
// item[column].Controls.Add(tbEditBox);
// }
// }
//}
}
示例2: PopulateGrid
/*
protected void PopulateGrid (int accountId, DateTime start, DateTime end)
{
if (accountId == 0)
{
return;
}
FinancialAccount account = FinancialAccount.FromIdentity(accountId);
DateTime balanceStart = new DateTime(DateTime.Today.Year, 1, 1);
if (account.AccountType == FinancialAccountType.Asset || account.AccountType == FinancialAccountType.Debt)
{
balanceStart = new DateTime(2006, 1, 1); // The dawn of mankind, for our purposes
}
currentAccountBalance = account.GetDelta(balanceStart, start.AddSeconds(-1));
// We use "AddDays (1)" onto the end date, as the underlying select works like this:
// "get rows where datetime >= start or datetime < end"
// This assures us that the dates given in the interface make an inclusive range.
this.GridTransactions.DataSource = FinancialAccount.FromIdentity(accountId).GetRows(start, end.AddDays(1));
}
protected void PopulateAccounts()
{
int organizationId = Organization.PPSEid; // TODO: Get from a future dropdown
FinancialAccounts accounts = FinancialAccounts.ForOrganization(organizationId);
this.DropAccounts.Items.Add(new ListItem("-- Select account --", "0"));
this.DropAccountsCreate.Items.Add(new ListItem("-- Select account --", "0"));
foreach (FinancialAccount account in accounts)
{
this.DropAccounts.Items.Add(new ListItem(account.Name, account.Identity.ToString()));
this.DropAccountsCreate.Items.Add(new ListItem(account.Name, account.Identity.ToString()));
}
}*/
protected void GridReporters_ItemCreated (object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
Reporter reporter = e.Item.DataItem as Reporter;
if (reporter == null)
{
return;
}
/*
HyperLink editLink = (HyperLink) e.Item.FindControl("ManageLink");
editLink.Attributes["href"] = "#";
editLink.Attributes["onclick"] = String.Format("return ShowTransactionForm('{0}','{1}');",
row.FinancialTransactionId, e.Item.ItemIndex);*/
Label labelCategories = (Label) e.Item.FindControl("LabelCategories");
List<string> categoryNames = new List<string>();
foreach (MediaCategory mediaCategory in reporter.MediaCategories)
{
categoryNames.Add(mediaCategory.Name);
}
labelCategories.Text = String.Join(", ", categoryNames.ToArray());
}
}
示例3: GridExpenseClaims_ItemCreated
protected void GridExpenseClaims_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
ExpenseClaim claim = (ExpenseClaim) e.Item.DataItem;
if (claim == null)
{
return;
}
Controls_v4_DocumentList docList = (Controls_v4_DocumentList) e.Item.FindControl("DocumentListClaim");
if (docList != null)
{
docList.Documents = Documents.ForObject(claim);
}
HyperLink editLink = (HyperLink)e.Item.FindControl("LinkEdit");
editLink.Attributes["href"] = "#";
editLink.Attributes["onclick"] = String.Format("return ShowExpenseClaimForm('{0}','{1}');",
claim.Identity, e.Item.ItemIndex);
}
}
示例4: AppointmentTypesGridItemCreated
/// <summary>
/// Handles the ItemCreated event of the AppointmentTypesGrid control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="Telerik.Web.UI.GridItemEventArgs"/> instance containing the event data.</param>
private static void AppointmentTypesGridItemCreated(object sender, GridItemEventArgs e)
{
var commandItem = e.Item as GridCommandItem;
if (commandItem != null)
{
// control names from http://www.telerik.com/help/aspnet-ajax/grddefaultbehavior.html
commandItem.FindControl("RefreshButton").Visible = false;
commandItem.FindControl("RebindGridButton").Visible = false;
}
else
{
var editableItem = e.Item as GridEditableItem;
if (editableItem != null && e.Item.IsInEditMode)
{
const int EnterKey = 13;
ClientAPI.RegisterKeyCapture(
editableItem["Name"].Controls.OfType<TextBox>().Single(),
editableItem["EditButtons"].Controls[0],
EnterKey);
}
else
{
var normalItem = e.Item as GridDataItem;
if (normalItem != null && e.Item.DataItem != null)
{
////var category = (AppointmentType)e.Item.DataItem;
////normalItem["Delete"].Controls.OfType<LinkButton>().Single().Visible = category.EventCount == 0;
}
}
}
}
示例5: OnGridKnowledgeItemDataBound
protected void OnGridKnowledgeItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
LinkButton buttonDelete = dataItem["TemplateDeleteKnowledgeColumn"].Controls[1] as LinkButton;
ParamKnowledge knowledge = (ParamKnowledge)e.Item.DataItem;
buttonDelete.CommandArgument = knowledge.KnowledgeID.ToString();
buttonDelete.Text = ResourceManager.GetString("deleteText");
if (knowledge.NumberIDUsed > 0)
{
buttonDelete.OnClientClick = string.Format("javascript:alert('{0}'); return false;", ResourceManager.GetString("messageKnowledgeBeingUsed"));
}
else
{
buttonDelete.OnClientClick = "return confirm('" + ResourceManager.GetString("deleteConfirmText") + "')";
}
LinkButton buttonEdit = dataItem["TemplateEditKnowledgeColumn"].Controls[1] as LinkButton;
buttonEdit.Text = ResourceManager.GetString("editText");
}
if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
{
ParamKnowledge knowledge = e.Item.DataItem as ParamKnowledge;
if (knowledge != null)
{
LinkButton lnkKnowledgeEdit = (LinkButton)e.Item.FindControl("lnkKnowledgeEdit");
if (lnkKnowledgeEdit != null)
{
lnkKnowledgeEdit.OnClientClick = string.Format("return OnKnowledgeEditClientClicked('{0}')", knowledge.KnowledgeID);
}
}
}
}
示例6: grdIstIdninImzaileIlgiliBelgeleri2_OnItemDataBound
protected void grdIstIdninImzaileIlgiliBelgeleri2_OnItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
Label lblKimlerImzalamis = (Label)item.FindControl("lblImzalayanlar");
EFDal ed=new EFDal();
string path = ed.ImzaliDosyalarIddenPathDon(Convert.ToInt32(item["Id"].Text));
//lblKimlerImzalamis.Text= ed.SignersInfo(path);
item["Imzalayan"].Text = ed.SignersInfo(path);
item["Imzalayan"].ForeColor = System.Drawing.Color.Red;
if (item["Imzalayan"].Text == "00000000-0000-0000-0000-000000000000" || item["Imzalayan"].Text == " ")
{
item["Imzalayan"].BackColor = System.Drawing.Color.Gainsboro;
item["Imzalayan"].Text = "İmzalanmamış";
}
else
{
item["Imzalayan"].BackColor = System.Drawing.Color.LightYellow;
}
using (Service1Client proxy = new Service1Client())
{
item["Yukleyen"].Text = proxy.kal_UserIddenUserNameDon(Guid.Parse(item["Yukleyen"].Text));
}
item["DokumanTipi"].Text = ed.DokumanTipiIddenDokumanAdiDon(Convert.ToInt32(item["DokumanTipi"].Text));
}
}
示例7: RadGrid1_ItemCreated
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridNestedViewItem)
{
var nestedItem = (GridNestedViewItem)e.Item;
var hdnOrderID = (HiddenField)nestedItem.FindControl("hdnOrderID");
var hdnBillingAddressID = (HiddenField)nestedItem.FindControl("hdnBillingAddressID");
var hdnShippingAddressID = (HiddenField)nestedItem.FindControl("hdnShippingAddressID");
hdnOrderID.Value = nestedItem.ParentItem["OrderID"].Text;
hdnBillingAddressID.Value = nestedItem.ParentItem["BillingAddressID"].Text;
hdnShippingAddressID.Value = nestedItem.ParentItem["ShippingAddressID"].Text;
var lvOrderDetail = (RadListView)nestedItem.FindControl("lvOrderDetail");
var OdsOrderDetail = (ObjectDataSource)nestedItem.FindControl("OdsOrderDetail");
lvOrderDetail.DataSourceID = OdsOrderDetail.ID;
var fvBillingAddress = (FormView)nestedItem.FindControl("fvBillingAddress");
var OdsBillingAddress = (ObjectDataSource)nestedItem.FindControl("OdsBillingAddress");
fvBillingAddress.DataSourceID = OdsBillingAddress.ID;
var fvShippingAddress = (FormView)nestedItem.FindControl("fvShippingAddress");
var OdsShippingAddress = (ObjectDataSource)nestedItem.FindControl("OdsShippingAddress");
fvShippingAddress.DataSourceID = OdsShippingAddress.ID;
}
}
示例8: OnItemDataBound
protected void OnItemDataBound(object sender, GridItemEventArgs e)
{
if(e.Item is GridDataItem)
{
GridDataItem oDataItem = e.Item as GridDataItem;
}
}
示例9: GridInvoices_ItemCreated
protected void GridInvoices_ItemCreated(object sender, GridItemEventArgs e)
{
// Set the images for the status indicators.
const string imageUrlTodo = "~/Images/Public/Fugue/icons-shadowless/minus-small.png";
const string imageUrlTick = "~/Images/Public/Fugue/icons-shadowless/tick.png";
const string imageUrlFail = "~/Images/Public/Fugue/icons-shadowless/cross-circle-frame.png";
if (e.Item is GridDataItem)
{
OutboundInvoice invoice = (OutboundInvoice)e.Item.DataItem;
if (invoice == null)
{
return;
}
Image imagePaid = (Image)e.Item.FindControl("ImagePaidClosed");
imagePaid.ImageUrl = invoice.Open ? imageUrlTodo : imageUrlTick;
HyperLink editLink = (HyperLink)e.Item.FindControl("LinkEdit");
editLink.Attributes["href"] = "http://data.piratpartiet.se/Forms/DisplayOutboundInvoice.aspx?Reference=" + invoice.Reference + "&Culture=" + (invoice.Domestic? invoice.Organization.DefaultCountry.Culture.Replace("-", "").ToLower(): "enus");
}
}
示例10: RadGrid1_ItemDataBound
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
DataTable dt = new DataTable();
string str = "";
int it = 0;
dt.Columns.Add(new DataColumn("Answer", str.GetType()));
dt.Columns.Add(new DataColumn("Count", it.GetType()));
GridDataItem item = (GridDataItem)e.Item;
RadChart rc = item.FindControl("RadChart1") as RadChart;
long qsid = long.Parse(item["QSID"].Text);
Model.Question qsM = qn.GetQsModel(qsid);
int[] qsAcc = ua.CountAnswers(qsM.ID);
int maxcount = 0;
for (int i = 0; i < qsM.Answer.Length; i++)
{
DataRow dr = dt.NewRow();
dr["Answer"] = qsM.Answer[i];
dr["Count"] = qsAcc[i];
dt.Rows.Add(dr);
maxcount += qsAcc[i];
}
rc.PlotArea.XAxis.Appearance.MajorGridLines.Visible = false;
rc.PlotArea.Appearance.FillStyle.MainColor = Color.AliceBlue;
rc.PlotArea.Appearance.FillStyle.SecondColor = Color.AliceBlue;
rc.PlotArea.YAxis.MaxValue = maxcount;
rc.ChartTitle.TextBlock.Text = "";
rc.DataSource = dt;
rc.DataBind();
}
}
示例11: OnGridUserItemDataBound
protected void OnGridUserItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
LinkButton buttonDelete = dataItem["TemplateDeleteUserColumn"].Controls[1] as LinkButton;
//buttonDelete.OnClientClick = "return confirm('" + ResourceManager.GetString("deleteConfirmText") + "')";
buttonDelete.CommandArgument = ((ParamUser)e.Item.DataItem).UserID;
buttonDelete.Text = ResourceManager.GetString("deleteText");
int count = new ParamUserRepository().CountNumberBeingUsedOfUser(buttonDelete.CommandArgument);
if (count > 0)
{
buttonDelete.OnClientClick = string.Format("javascript:alert('{0}'); return false;", ResourceManager.GetString("messageUserBeingUsed"));
}
else
{
buttonDelete.OnClientClick = "return confirm('" + ResourceManager.GetString("deleteConfirmText") + "')";
}
LinkButton buttonEdit = dataItem["TemplateEditUserColumn"].Controls[1] as LinkButton;
buttonEdit.Text = ResourceManager.GetString("editText");
}
if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
{
ParamUser user = e.Item.DataItem as ParamUser;
if(user != null)
{
LinkButton lnkUserEdit = (LinkButton)e.Item.FindControl("lnkUserEdit");
if (lnkUserEdit != null)
{
lnkUserEdit.OnClientClick = string.Format("return OnUserEditClientClicked('{0}')", user.UserID);
}
}
}
}
示例12: SetRTIImage_GraphicView
protected void SetRTIImage_GraphicView(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
Image rtiImage = (Image)item.FindControl("GraphicViewRTIImage");
Image studentImage = (Image)item.FindControl("StudentPhoto");
Image SummaryIcon = (Image)item.FindControl("GraphicViewSummaryIcon");
SummaryIcon.Visible = UserHasPermission(Base.Enums.Permission.Icon_Summary_Student);
DataRowView itemDataRow = (DataRowView)item.DataItem;
//RTI Image Path
string rtiImageURL = (String.IsNullOrEmpty(itemDataRow.Row["rtiimg"].ToString()) ? "" : itemDataRow.Row["rtiimg"].ToString());
//Student Image Path
string imgName = itemDataRow.Row["picture"].ToString();
//Default if it's null in the DB, or missing from the web server path
if (String.IsNullOrEmpty(imgName) || !File.Exists(Server.MapPath(AppSettings.ProfileImageStudentWebPath + "/" + imgName)))
{
studentImage.ImageUrl = ResolveUrl("~/Images/new/male_student.png");
}
else studentImage.ImageUrl = AppSettings.ProfileImageStudentWebPath + '/' + imgName;
if (rtiImage != null && rtiImageURL.Length > 0 && rtiImageURL.IndexOf("blank") == -1)
{
rtiImage.ImageUrl = "~/Images/" + rtiImageURL;
}
}
else if (e.Item is GridEditFormItem)
{
GridEditFormItem item = (GridEditFormItem)e.Item;
}
}
示例13: RadGrid1_ItemCreated
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridFooterItem && RadGrid1.MasterTableView.IsItemInserted)
{
e.Item.Visible = false;
}
}
示例14: OnGridUnitItemDataBound
protected void OnGridUnitItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
LinkButton buttonDelete = dataItem["TemplateDeleteUnitColumn"].Controls[1] as LinkButton;
ParamType unit = (ParamType)e.Item.DataItem;
buttonDelete.CommandArgument = unit.TypeID;
buttonDelete.Text = ResourceManager.GetString("deleteText");
buttonDelete.OnClientClick = "return confirm('" + ResourceManager.GetString("deleteConfirmText") + "')";
LinkButton buttonEdit = dataItem["TemplateEditUnitColumn"].Controls[1] as LinkButton;
buttonEdit.Text = ResourceManager.GetString("editText");
}
if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
{
ParamType unit = e.Item.DataItem as ParamType;
if (unit != null)
{
LinkButton lnkUnitEdit = (LinkButton)e.Item.FindControl("lnkUnitEdit");
if (lnkUnitEdit != null)
{
lnkUnitEdit.OnClientClick = string.Format("return OnUnitEditClientClicked('{0}')", unit.TypeID);
}
}
}
}
示例15: OnGridPermissionItemDataBound
protected void OnGridPermissionItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem dataItem = e.Item as GridDataItem;
LinkButton buttonDelete = dataItem["TemplateDeletePermissionColumn"].Controls[1] as LinkButton;
ParamPermission permission = (ParamPermission)e.Item.DataItem;
buttonDelete.CommandArgument = permission.PermissionCode;
buttonDelete.Text = ResourceManager.GetString("deleteText");
if (permission.NbrUserUsed > 0)
{
buttonDelete.OnClientClick = string.Format("javascript:alert('{0}'); return false;", ResourceManager.GetString("messagePermissionBeingUsed"));
}
else
{
buttonDelete.OnClientClick = "return confirm('" + ResourceManager.GetString("deleteConfirmText") + "')";
}
LinkButton buttonEdit = dataItem["TemplateEditPermissionColumn"].Controls[1] as LinkButton;
buttonEdit.Text = ResourceManager.GetString("editText");
}
if (e.Item.ItemType == GridItemType.AlternatingItem || e.Item.ItemType == GridItemType.Item)
{
ParamPermission per = e.Item.DataItem as ParamPermission;
if (per != null)
{
LinkButton lnkPermissionEdit = (LinkButton)e.Item.FindControl("lnkPermissionEdit");
if (lnkPermissionEdit != null)
{
lnkPermissionEdit.OnClientClick = string.Format("return OnPermissionEditClientClicked('{0}')", per.PermissionCode);
}
}
}
}