Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
150 views
The problem that I am having is that the custom user control is not displaying for a DetailTableView.EditFormSettings when using a GridButtonColumn as the firing event.

I have a class that defines a Hierarchical RadGrid that I will be using application wide. This grid has many column so this is the best implementation for me.
using System;
using System.Data;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace MAAS.WebApplication.Controls
{
    public static class BatchRadGrid
    {
 
        internal static RadGrid GridDefinition(string id)
        {
            RadGrid _policyRadGrid = new RadGrid
                                         {
                                             ID = id,
                                             Width = Unit.Percentage(98),
                                             Height = Unit.Pixel(460),
                                             PageSize = 10,
                                             AllowPaging = true,
                                             EnableAjaxSkinRendering = true,
                                             AllowSorting = true,
                                             AutoGenerateColumns = false,
                                             ShowStatusBar = true,
                                             GridLines = GridLines.None,
                                             AutoGenerateEditColumn = false,
                                             AutoGenerateDeleteColumn = false,
                                             ExportSettings =
                                                 {
                                                     HideStructureColumns = true,
                                                     ExportOnlyData = true,
                                                     IgnorePaging = true,
                                                 },
                                             HeaderContextMenu =
                                                 {
                                                     Enabled = true,
                                                     CssClass = "GridContextMenu GridContextMenu_Web20"
                                                 },
                                             PagerStyle = {Mode = GridPagerMode.NextPrevNumericAndAdvanced},
                                             ClientSettings =
                                                 {
                                                     Scrolling = {AllowScroll = true, UseStaticHeaders = true},
                                                     Selecting = {AllowRowSelect = true},
                                                     AllowExpandCollapse = true,
                                                     ClientEvents = {OnRowDblClick = "RowDblClicked"}
 
                                                 },
                                             FilterMenu = {EnableImageSprites = false},
                                             MasterTableView =
                                                 {
                                                     PageSize = 10,
                                                     CommandItemDisplay = GridCommandItemDisplay.Top,
                                                     CommandItemSettings =
                                                         {
                                                             ShowExportToExcelButton = false,
                                                             AddNewRecordText = "Add New Batch"
                                                         },
                                                     EnableHeaderContextMenu = true,
                                                     HorizontalAlign = HorizontalAlign.NotSet,
                                                     EditFormSettings =
                                                         {
                                                             FormCaptionStyle = {CssClass = "EditFormHeader"},
                                                             ColumnNumber = 3,
                                                             CaptionDataField = "BatchID",
                                                             CaptionFormatString = "Edit properties of Item {0}",
                                                             InsertCaption = "New Batch",
                                                             FormTableItemStyle = {Wrap = false},
                                                             FormMainTableStyle =
                                                                 {
                                                                     BackColor = Color.FromArgb(222, 222, 214),
                                                                     CellPadding = 3,
                                                                     CellSpacing = 0,
                                                                     GridLines = GridLines.None,
                                                                     Width = Unit.Percentage(43)
                                                                 },
                                                             FormTableStyle =
                                                                 {
                                                                     BackColor = Color.FromArgb(222, 222, 214),
                                                                     CellPadding = 2,
                                                                     CellSpacing = 0,
                                                                     Height = Unit.Percentage(100)
                                                                 },
                                                             FormTableAlternatingItemStyle = {Wrap = false},
                                                             FormTableButtonRowStyle =
                                                                 {
                                                                     HorizontalAlign = HorizontalAlign.Right,
                                                                     CssClass = "EditFormButtonRow"
                                                                 },
                                                         },
                                                     HierarchyLoadMode = GridChildLoadMode.ServerBind,
                                                     DataKeyNames = new string[] {"BatchID"},
                                                     EditMode = GridEditMode.PopUp,
                                                 },
                                         };
 
            //Add Edit Column
            GridEditCommandColumn _masterGridEditCommandColumn = new GridEditCommandColumn
                                                                     {
                                                                         ButtonType = GridButtonColumnType.ImageButton,
                                                                         HeaderText = "",
                                                                         UniqueName = "MasterEditRecord",
                                                                         HeaderStyle = {Width = Unit.Pixel(20)},
                                                                         ItemStyle = {Width = Unit.Pixel(20)}
                                                                     };
            _policyRadGrid.MasterTableView.Columns.Add(_masterGridEditCommandColumn);
 
            //Add Delete Column
            GridButtonColumn _masterDeleteCommandColumn = new GridButtonColumn
                                                              {
                                                                  ConfirmText = "Confirm",
                                                                  ConfirmDialogType = GridConfirmDialogType.RadWindow,
                                                                  ButtonType = GridButtonColumnType.ImageButton,
                                                                  HeaderText = "",
                                                                  ConfirmTitle = "Delete",
                                                                  CommandName = "Delete",
                                                                  Text = "Delete",
                                                                  UniqueName = "MasterDeleteRecord",
                                                                  HeaderStyle = {Width = Unit.Pixel(20)},
                                                                  ItemStyle =
                                                                      {
                                                                          HorizontalAlign = HorizontalAlign.Center,
                                                                          Width = Unit.Pixel(20)
                                                                      }
                                                              };
 
            _policyRadGrid.MasterTableView.Columns.Add(_masterDeleteCommandColumn);
 
 
            GridButtonColumn _masterPromoteCommandColumn = new GridButtonColumn
                                                               {
                                                                   ConfirmText = "Confirm",
                                                                   ConfirmDialogType = GridConfirmDialogType.RadWindow,
                                                                   ButtonType = GridButtonColumnType.ImageButton,
                                                                   HeaderText = "",
                                                                   ConfirmTitle = "Promote Batch",
                                                                   CommandName = "Promote",
                                                                   Text = "Promote",
                                                                   UniqueName = "MasterPromoteRecord",
                                                                   HeaderStyle = {Width = Unit.Pixel(20)},
                                                                   ItemStyle =
                                                                       {
                                                                           HorizontalAlign = HorizontalAlign.Center,
                                                                           Width = Unit.Pixel(20)
                                                                       }
                                                               };
            _policyRadGrid.MasterTableView.Columns.Add(_masterPromoteCommandColumn);
 
            GridBoundColumn _masterBoundColumn = new GridBoundColumn
                                                     {
                                                         DataField = "BatchID",
                                                         HeaderText = "Batch ID",
                                                         UniqueName = "BatchID",
                                                         HeaderStyle = {Width = Unit.Pixel(50)},
                                                         ItemStyle = {Width = Unit.Pixel(50)},
                                                         ReadOnly = true,
                                                     };
            _policyRadGrid.MasterTableView.Columns.Add(_masterBoundColumn);
 
            _masterBoundColumn = new GridBoundColumn
                                     {
                                         DataField = "AccountingPeriodID",
                                         HeaderText = "Accounting Period",
                                         UniqueName = "AccountingPeriodID",
                                         HeaderStyle = {Width = Unit.Pixel(130)},
                                         ItemStyle = {Width = Unit.Pixel(130)},
                                         ReadOnly = true,
                                     };
            _policyRadGrid.MasterTableView.Columns.Add(_masterBoundColumn);
            _masterBoundColumn = new GridBoundColumn
                                     {
                                         DataField = "BatchName",
                                         HeaderText = "Batch Name",
                                         UniqueName = "BatchName",
                                         HeaderStyle = {Width = Unit.Pixel(200)},
                                         ItemStyle = {Width = Unit.Pixel(200)},
                                         ReadOnly = true,
                                     };
            _policyRadGrid.MasterTableView.Columns.Add(_masterBoundColumn);
 
            _masterBoundColumn = new GridBoundColumn
                                     {
                                         DataField = "BatchStatusName",
                                         HeaderText = "Batch Status",
                                         UniqueName = "BatchStatusName",
                                         HeaderStyle = {Width = Unit.Pixel(80)},
                                         ItemStyle = {Width = Unit.Pixel(80)},
                                         ReadOnly = true,
                                     };
            _policyRadGrid.MasterTableView.Columns.Add(_masterBoundColumn);
 
            _masterBoundColumn = new GridBoundColumn
                                     {
                                         DataField = "BatchDescription",
                                         HeaderText = "Batch Description",
                                         UniqueName = "BatchDescription",
                                         HeaderStyle = {Width = Unit.Percentage(100)},
                                         ItemStyle = {Width = Unit.Percentage(100)},
                                     };
            _policyRadGrid.MasterTableView.Columns.Add(_masterBoundColumn);
 
 
            // (II in hierarchy level) Detail table - Manual Adjustments of the Batch
 
            GridTableView _batchAdjustments = new GridTableView(_policyRadGrid)
                                                  {
                                                      ID = string.Format("{0}_ChildGrid", id),
                                                      Name = string.Format("{0}_ChildGrid", id),
                                                      DataMember = "Policy",
                                                      AutoGenerateColumns = false,
                                                      Width = Unit.Percentage(100),
                                                      PageSize = 10,
                                                      BackColor = Color.FromArgb(198, 203, 214),
                                                      CommandItemDisplay = GridCommandItemDisplay.Top,
                                                      CommandItemSettings =
                                                          {
                                                              ShowExportToExcelButton = true,
                                                              AddNewRecordText = "Add New Adjustment",
 
                                                          },
                                                      EnableHeaderContextMenu = true,
                                                      HorizontalAlign = HorizontalAlign.NotSet,
                                                      EditFormSettings =
                                                          {
                                                              EditColumn =
                                                                  {
                                                                      UniqueName = "EditRecord",
                                                                  },
                                                          },
                                                      HierarchyLoadMode = GridChildLoadMode.ServerOnDemand,
                                                      EditMode = GridEditMode.PopUp,
                                                  };
 
            GridRelationFields _relationFields = new GridRelationFields
                                                     {
                                                         MasterKeyField = "BatchID",
                                                         DetailKeyField = "ManualAdjustmentBatchId"
                                                     };
            _batchAdjustments.ParentTableRelation.Add(_relationFields);
 
            _policyRadGrid.MasterTableView.DetailTables.Add(_batchAdjustments);
 
 
            //Add Edit Column
            GridEditCommandColumn _gridEditCommandColumn = new GridEditCommandColumn
                                                               {
                                                                   ButtonType = GridButtonColumnType.ImageButton,
                                                                   HeaderText = "",
                                                                   UniqueName = "PolicyEditRecord",
                                                                   HeaderStyle = {Width = Unit.Pixel(33)},
                                                                   ItemStyle =
                                                                   {
                                                                       HorizontalAlign = HorizontalAlign.Center,
                                                                       Width = Unit.Pixel(33)
                                                                   },
                                                               };
            _batchAdjustments.Columns.Add(_gridEditCommandColumn);
 
            //Add Delete Column GridButtonColumn
            GridButtonColumn _deleteCommandColumn = new GridButtonColumn
                                                        {
                                                            ButtonType = GridButtonColumnType.ImageButton,
                                                            CommandName = "Delete",
                                                            UniqueName = "DeleteTransaction",
                                                            HeaderStyle = {Width = Unit.Pixel(33)},
                                                            ItemStyle =
                                                                {
                                                                    HorizontalAlign = HorizontalAlign.Center,
                                                                    Width = Unit.Pixel(33)
                                                                },
                                                        };
 
 
            _batchAdjustments.Columns.Add(_deleteCommandColumn);
 
            //Add columns           
            GridBoundColumn _boundColumn = new GridBoundColumn
                                               {
                                                   DataField = "ManualAdjustmentBatchId",
                                                   HeaderText = "ManualAdjustmentBatchId",
                                                   UniqueName = "ManualAdjustmentBatchId",
                                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                                   ItemStyle = {Width = Unit.Pixel(100)},
                                                   Visible = false,
                                                   ReadOnly = true,
                                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                               {
                                                   DataField = "ManualAdjustmentId",
                                                   HeaderText = "Manual Adjustment Id",
                                                   UniqueName = "ManualAdjustmentId",
                                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                                   ItemStyle = {Width = Unit.Pixel(100)},
                                                   Visible = false,
                                                   ReadOnly = true,
                                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
 
            _boundColumn = new GridBoundColumn
                                               {
                                                   DataField = "OriginatingSystemCode",
                                                   HeaderText = "Originating System Code",
                                                   UniqueName = "OriginatingSystemCode",
                                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                                   ItemStyle = {Width = Unit.Pixel(100)},
                                                   Visible = false,
                                                   ReadOnly = true,
                                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
 
            _boundColumn = new GridBoundColumn
                               {
                                   DataField = "PolicyNumber",
                                   HeaderText = "Policy Number",
                                   UniqueName = "PolicyNumber",
                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                   ItemStyle = {Width = Unit.Pixel(100)},
                                   EditFormColumnIndex = 0,
                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                               {
                                   DataField = "PolicyVersion",
                                   HeaderText = "Policy Version",
                                   UniqueName = "PolicyVersion",
                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                   ItemStyle = {Width = Unit.Pixel(100)},
                                   EditFormColumnIndex = 1,
                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                               {
                                   DataField = "InternalLegalEntityCode",
                                   HeaderText = "Internal Legal Entity Code",
                                   UniqueName = "InternalLegalEntityCode",
                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                   ItemStyle = {Width = Unit.Pixel(100)},
                                   EditFormColumnIndex = 2,
                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
 
            _boundColumn = new GridBoundColumn
                               {
                                   DataField = "ProductLine2Name",
                                   HeaderText = "Product Line 2 Name",
                                   UniqueName = "ProductLine2Name",
                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                   ItemStyle = {Width = Unit.Pixel(100)},
                                   EditFormColumnIndex = 3
                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                               {
                                   DataField = "DirectAssumedCededCode",
                                   HeaderText = "Direct Assumed Ceded Code",
                                   UniqueName = "DirectAssumedCededCode",
                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                   ItemStyle = {Width = Unit.Pixel(100)},
                                   EditFormColumnIndex = 0,
 
                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                               {
                                   DataField = "PolicyTransactionTypeCode",
                                   HeaderText = "Policy Transaction Type Code",
                                   UniqueName = "PolicyTransactionTypeCode",
                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                   ItemStyle = {Width = Unit.Pixel(100)},
                                   EditFormColumnIndex = 1
                               };
 
        _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "FinancialAmount",
                                     HeaderText = "Financial Amount",
                                     UniqueName = "FinancialAmount",
                                     HeaderStyle = {Width = Unit.Pixel(100)},
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 2,
                                     DataFormatString = "{0:C}"
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            GridDateTimeColumn _bounddtColumn = new GridDateTimeColumn
            {
                                   DataField = "PolicyEffectiveDate",
                                   HeaderText = "Policy Effective Date",
                                   UniqueName = "PolicyEffectiveDate",
                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                   ItemStyle = {Width = Unit.Pixel(100)},
                                   EditFormColumnIndex = 3,
                                   DataFormatString = "{0:M/d/yyyy}",
                               };
            _batchAdjustments.Columns.Add(_bounddtColumn);
 
            _boundColumn = new GridBoundColumn
                                      {
                                          DataField = "CoverageMarkelCode",
                                          HeaderText = "Coverage Markel Code",
                                          UniqueName = "CoverageMarkelCode",
                                          HeaderStyle = { Width = Unit.Pixel(100) },
                                          ItemStyle = {Width = Unit.Pixel(100)},
                                          Visible = false,
                                          ReadOnly = true,
                                      };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "AnnualStatementLineNAICCode",
                                     HeaderText = "Annual Statement Line NAIC Code",
                                     UniqueName = "AnnualStatementLineNAICCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "InwardAssumingCompanyCode",
                                     HeaderText = "Inward Assuming Company Code",
                                     UniqueName = "InwardAssumingCompanyCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 1,
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                               {
                                   DataField = "ProducerCode",
                                   HeaderText = "Producer Code",
                                   UniqueName = "ProducerCode",
                                   HeaderStyle = {Width = Unit.Pixel(100)},
                                   ItemStyle = {Width = Unit.Pixel(100)},
                                   EditFormColumnIndex = 2,
                                   DataFormatString = "{0:MM/dd/yyyy}",
                               };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "LegacyProgramCode",
                                     HeaderText = "Legacy Program Code",
                                     UniqueName = "LegacyProgramCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 3,
 
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "FinancialRiskISOCountrySubdivisionCode",
                                     HeaderText = "Financial Risk ISO Country Subdivision Code",
                                     UniqueName = "FinancialRiskISOCountrySubdivisionCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "LineOfBusinessMarkelCode",
                                     HeaderText = "Line Of Business Markel Code",
                                     UniqueName = "LineOfBusinessMarkelCodeb",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 2,
 
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "SublineMarkelCode",
                                     HeaderText = "Subline Markel Code",
                                     UniqueName = "SublineMarkelCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 3,
 
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "RatingClassMarkelCode",
                                     HeaderText = "Rating Class Markel Code",
                                     UniqueName = "RatingClassMarkelCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
 
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "CoverageTriggerCode",
                                     HeaderText = "Coverage Trigger Code",
                                     UniqueName = "CoverageTriggerCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 1,
 
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "RegionCode",
                                     HeaderText = "Region Code",
                                     UniqueName = "RegionCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 2,
 
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "LegacyAccountingUnitCode",
                                     HeaderText = "Legacy Accounting Unit Code",
                                     UniqueName = "LegacyAccountingUnitCode",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 3,
 
                                 };
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _bounddtColumn = new GridDateTimeColumn
                                 {
                                     DataField = "PremiumFinancialEffectiveFromDate",
                                     HeaderText = "Premium Financial Effective From Date",
                                     UniqueName = "PremiumFinancialEffectiveFromDate",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
                                     DataFormatString = "{0:M/d/yyyy}",
                                 };
            _batchAdjustments.Columns.Add(_bounddtColumn);
 
            _bounddtColumn = new GridDateTimeColumn
                                 {
                                     DataField = "PremiumFinancialEffectiveToDate",
                                     HeaderText = "Premium Financial Effective To Date",
                                     UniqueName = "PremiumFinancialEffectivetoDate",
                                     HeaderStyle = {Width = Unit.Pixel(100)},
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
                                     DataFormatString = "{0:M/d/yyyy}",
 
                                 };
            _batchAdjustments.Columns.Add(_bounddtColumn);
 
            _bounddtColumn = new GridDateTimeColumn
                                 {
                                     DataField = "CoverageEffectiveDate",
                                     HeaderText = "Coverage Effective Date",
                                     UniqueName = "CoverageEffectiveDate",
                                     HeaderStyle = { Width = Unit.Pixel(100) },
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
                                     DataFormatString = "{0:M/d/yyyy}",
                                 };
 
            _batchAdjustments.Columns.Add(_bounddtColumn);
 
            _bounddtColumn = new GridDateTimeColumn
                                 {
                                     DataField = "CoverageExpirationDate",
                                     HeaderText = "Coverage Expiration Date",
                                     UniqueName = "CoverageExpirationDate",
                                     HeaderStyle = {Width = Unit.Pixel(100)},
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
                                     DataFormatString = "{0:M/d/yyyy}",
                                 };
 
            _batchAdjustments.Columns.Add(_bounddtColumn);
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "PolicyClaimManualAdjustmentTypeName",
                                     HeaderText = "Manual Adjustment Type Name",
                                     UniqueName = "PolicyClaimManualAdjustmentTypeName",
                                     HeaderStyle = {Width = Unit.Pixel(100)},
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
                                 };
 
            _batchAdjustments.Columns.Add(_boundColumn);
 
            _boundColumn = new GridBoundColumn
                                 {
                                     DataField = "AutoGenerated",
                                     HeaderText = "Auto-Generated",
                                     UniqueName = "AutoGenerated",
                                     HeaderStyle = {Width = Unit.Pixel(100)},
                                     ItemStyle = {Width = Unit.Pixel(100)},
                                     EditFormColumnIndex = 0,
                                 };
 
            _batchAdjustments.Columns.Add(_boundColumn);
            return _policyRadGrid;
        }
    }
 }


The grid will function in a different manner based on the access level of the user. On a 'basic user level' they will have a Add New Item/Edit Item on the parent grid and Edit, Reject(delete), Approve(Update) on the Child Grid

The next level will be a 'Approver' role. They will NOT have Add New Item/Edit Item on the parent grid and will only have Reject(Edit) on the child. The action that the user will take in this role when rejecting an item is that they will be required to enter a comment through a user control that will be launched when the click the reject button.

private void SubmittedBatchesRadGrid_ItemDataBound(object sender, GridItemEventArgs e)
{
    GridDataItem _dataItem = e.Item as GridDataItem;
    if (_dataItem == null) return;
 
    if (e.Item.OwnerTableView.Name == "SubmittedBatchesRadGrid_ChildGrid")
    {
        SetChildGridCommandColumns(sender, e);
        return;
    }
 
    if (_dataItem.KeyValues == "{}") { return; }
 
    SetMasterGridCommandColumns(sender, e, _dataItem);
 
}
 
private static void SetChildGridCommandColumns(object sender, GridItemEventArgs e)
{
    const string _jqueryCode = "if(!$find('{0}').confirm('{1}', event, '{2}'))return false;";
    const string _confirmText = "<p>Rejecting this adjustment will mean that you will have to also reject the batch when you are done processing these items.</p><p>Are you sure you want to reject this adjustment?</p>";
    ((ImageButton)(((GridEditableItem)e.Item)["PolicyEditRecord"].Controls[0])).ImageUrl = "/controls/styles/images/editpencil.png";
    ImageButton _btnReject = (ImageButton)((GridDataItem)e.Item)["DeleteTransaction"].Controls[0];
 
    _btnReject.CommandName = "Update";
    _btnReject.ImageUrl = "/controls/styles/images/decline.png";
    _btnReject.ToolTip = "Reject this item";
    //_btnReject.Attributes["onclick"] = string.Format(_jqueryCode, ((Control)sender).ClientID, _confirmText, "Reject Adjustment");
}
 
private void SubmittedBatchesRadGrid_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
{
    e.DetailTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
    e.DetailTableView.EditFormSettings.UserControlName = "/Controls/RejectedAdjustmentComment.ascx";
    e.DetailTableView.EditMode = GridEditMode.PopUp;
 
    e.DetailTableView.CommandItemSettings.ShowAddNewRecordButton = false;
    GridDataItem _dataItem = e.DetailTableView.ParentItem;
    e.DetailTableView.DataSource = AdjustmentAPI.GetAdjustmentsByBatch(Convert.ToInt32(_dataItem.GetDataKeyValue("BatchID").ToString()), PolicyClaimManualAdjustmentCode);
}


Any thoughts as to why it's not launching the user control?




Marin
Telerik team
 answered on 03 Nov 2011
2 answers
56 views

Hello
I use the ajax combo to search the addresses. The problem is that the first letter disappears when I write a little too fast, and it is only the first time I enter, but afterwards comnobox functioning, as it should.
I also have similar problem with ÅØÆ letters. First time I write these letters, I get a strange character, but when I delete it and write it again I get it right. what the problem could be??

Here is my ComboBox:

<telerik:RadComboBox ID="RadComboBoxSearch1" runat="server" AutoPostBack="true" SkinsPath="~/RadControls/ComboBox/Skins"

                        Width="95%" Enabled="false" EnableLoadOnDemand="True" ShowMoreResultsBox="True"

                        LoadingMessage="Søger..." OnItemsRequested="RadComboBoxSearch1_ItemsRequested"

                        OnSelectedIndexChanged="RadComboBoxSearch1_SelectedIndexChanged"    
                        OnClientDropDownOpening="CleanBoxSearch1"

                        OnClientKeyPressing="OnClientKeyPressing_searchBox1"
                        OnClientItemsRequesting="OnClientItemsRequesting_searchBox1"

                        OnClientItemsRequested="OnClientItemsRequested_searchBox1" OnClientLoad="GiveMeFocus">

                        <HeaderTemplate>

                            <div id="previous" class="previousText">

                                <a id="RadComboBox1_MoreResultsBoxImage2" onclick="setIsPrevious_searchBox1();">

                                    <img src="Images/arrow.png" alt="previous" />

                                    Previous </a>

                            </div>

                        </HeaderTemplate>

</telerik:RadComboBox>

Joseph
Top achievements
Rank 1
 answered on 03 Nov 2011
1 answer
81 views
(see title)
Genady Sergeev
Telerik team
 answered on 03 Nov 2011
4 answers
221 views
Hi Guys,

I have a dynamic menu being generated and I can not see all the menu items. How do I dynamically setup the scrolling in the RadMenu?

William
Kate
Telerik team
 answered on 03 Nov 2011
1 answer
107 views
Hi,
i have been using the Radupload and when i select a file it uploads the file, however when the file get posted or the page is ajaxed refresh, the file  disappears and are no-longer in the list.

This is working fine in IE, however it dos not work in Firefox, Chrome or Opera.
i have tested it in multiple version of each browser but it still does not work.

When i go to the "add-ons" in Firefox, then disable the shockwave flash, firefox then starts working.
however i need flash to work with the rest of my pages so turning it off is a problem, nor can i relay on users doing this.

i have also reverted back to earlier version of flash to see if that was the issue, however it had no affect.

given my description can someone please guide me to what is going on?

(update with testing today)
- it appears that with Flash version 8,9,10 and 11 Firefox, chrome and Opera still do not  show the files after upload.
Internet explorer 8,9 both work fine.   All work when Silverlight is installed, but don't when the system is relying on flash.

could this be a ajax loading issue, postback or uploader?

Dimitar Terziev
Telerik team
 answered on 03 Nov 2011
1 answer
135 views
Hi,


I need just a simple mult-select files (like the asyncUpload dialog)...
I need just know the path + fileName of selected files, to use on upload later...

Can I have it with Telerik ? 
Dimitar Terziev
Telerik team
 answered on 03 Nov 2011
5 answers
130 views

Hi Team,

I used RadDatePicker in my application with Overlay="true" in order to be visible over a Silver Light Control and Its working fine in all browsers but in Google chrome the date picker not appears over a Silver Light control.[Silver Light control hides the display of RadDatePicker]

I Used the below code RadDatePicker.

<telerik:RadDatePicker ID="txtStartDate" runat="server" Width="145" Overlay="true" ></telerik:RadDatePicker>

Please help me to sort it out urgently.

dhamo
Top achievements
Rank 1
 answered on 03 Nov 2011
1 answer
89 views
Hi ,The id of controls are not found after the ajax is executed.You can help me.Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 03 Nov 2011
3 answers
119 views
I have a radcombobox in itemtemplate of grid.how to access the datakeyvalue?
Shinu
Top achievements
Rank 2
 answered on 03 Nov 2011
1 answer
152 views
Greetings,

  I am working on a radgrid control in which we do our own paging.  The issue is when a client is using dates in the English Canadian format in a column filter on the grid.  The dates are wrong and we are getting a "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."  Debugging the code I see that the filter express in the the MasterTableView.FilterExpression has the incorrect dates in it.  Where do I need to do my date formating to fix this?  Thanks

Princy
Top achievements
Rank 2
 answered on 03 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?