private object gridElem_OnExternalDataBound(object sender, string sourceName, object parameter) { switch (sourceName) { case "remove": // Set the OnDrawRemoveButton event arguments, fire it // and set delete button's properties appropriately afterwards. DataRowView drv = (parameter as GridViewRow).DataItem as DataRowView; DrawButtonEventArgs drawButtonArgs = new DrawButtonEventArgs(); drawButtonArgs.EditedObject = drv["ContactGroupID"]; OnDrawRemoveButton(sender, drawButtonArgs); if (drawButtonArgs.ButtonEnabled) { ((CMSImageButton)sender).ImageUrl = GetImageUrl("Design/Controls/UniGrid/Actions/Delete.png"); ((CMSImageButton)sender).Enabled = true; } else { ((CMSImageButton)sender).ImageUrl = GetImageUrl("Design/Controls/UniGrid/Actions/DeleteDisabled.png"); ((CMSImageButton)sender).Enabled = false; } break; } return(null); }
object gridElem_OnExternalDataBound(object sender, string sourceName, object parameter) { switch (sourceName) { case "remove": // Set the OnDrawRemoveButton event arguments, fire it // and set delete button's properties appropriately afterwards. DataRowView drv = (parameter as GridViewRow).DataItem as DataRowView; DrawButtonEventArgs drawButtonArgs = new DrawButtonEventArgs(); drawButtonArgs.EditedObject = drv["ContactGroupID"]; OnDrawRemoveButton(sender, drawButtonArgs); if (drawButtonArgs.ButtonEnabled) { ((CMSImageButton)sender).ImageUrl = GetImageUrl("Design/Controls/UniGrid/Actions/Delete.png"); ((CMSImageButton)sender).Enabled = true; } else { ((CMSImageButton)sender).ImageUrl = GetImageUrl("Design/Controls/UniGrid/Actions/DeleteDisabled.png"); ((CMSImageButton)sender).Enabled = false; } break; } return null; }
private object gridElem_OnExternalDataBound(object sender, string sourceName, object parameter) { switch (sourceName) { case "remove": // Set the OnDrawRemoveButton event arguments, fire it // and set delete button's properties appropriately afterwards. DataRowView drv = (parameter as GridViewRow).DataItem as DataRowView; DrawButtonEventArgs drawButtonArgs = new DrawButtonEventArgs(); drawButtonArgs.EditedObject = drv["ContactGroupID"]; OnDrawRemoveButton(sender, drawButtonArgs); if (drawButtonArgs.ButtonEnabled) { CMSGridActionButton btn = (CMSGridActionButton)sender; btn.Enabled = true; } else { CMSGridActionButton btn = (CMSGridActionButton)sender; btn.Enabled = false; } break; } return null; }