or
class AssignBanGridCtrl : WebControl { #region Fields private RadAjaxLoadingPanel _RadLoadingPanel = new RadAjaxLoadingPanel(); private UpdatePanel _UpdatePanel = new UpdatePanel(); private RadGrid _RadGrid1 = new RadGrid(); private PriceDealProductBanTable _PriceDealProductBanTable = new PriceDealProductBanTable(); private PriceDealProposal _Proposal = null; private GXButton _btnCopyToSelect = new GXButton(); private GXButton _btnSaveSelected = new GXButton(); private GXTextBox _TbBAN = new GXTextBox(); public SmartOrderQuote OrderQuote; private string _BanColumnName; private string _ServiceColumnName; #endregion #region Constructors public AssignBanGridCtrl(PriceDealProposal proposal, bool hasOrderRequest) : base() { } #endregion #region Overrides protected override void OnInit(EventArgs e) { base.OnInit(e); this._ProductTable = new _ProductTable().ExecuteTypedDataTable(); this._RadLoadingPanel.ID = "_RadLoadingPanel"; this._RadLoadingPanel.Transparency = 30; this._RadLoadingPanel.Skin = "WebBlue"; this._RadLoadingPanel.BackgroundPosition = AjaxLoadingPanelBackgroundPosition.Center; this.Controls.Add(this._RadLoadingPanel); #region Grid1 this._RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false; this._RadGrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; this._RadGrid.ID = "RadGrid1"; this._RadGrid.Skin = "WebBlue"; this._RadGrid.Width = Unit.Percentage(100); this._RadGrid.GridLines = GridLines.None; this._RadGrid.PageSize = 100; this._RadGrid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; this._RadGrid.AllowPaging = true; this._RadGrid.AutoGenerateColumns = false; this._RadGrid.EnableLinqExpressions = false; this._RadGrid.AllowAutomaticInserts = false; this._RadGrid.AllowAutomaticUpdates = false; this._RadGrid.AllowAutomaticDeletes = false; if(this._ProductTable.Count>=100) this._RadGrid1.AllowFilteringByColumn = true; this._RadGrid1.AllowSorting = true; this._RadGrid1.MasterTableView.AllowNaturalSort = false; this._RadGrid1.MasterTableView.DataKeyNames = new string[] { this._ProductTable.PriceDealEntityProductItemIdColumn.ColumnName }; this._RadGrid1.MasterTableView.ClientDataKeyNames = new string[] { this._ProductTable.PriceDealEntityProductItemIdColumn.ColumnName }; this._RadGrid1.EnableLinqExpressions = false; this._RadGrid1.MasterTableView.NoMasterRecordsText = "No Products found."; this._RadGrid1.MasterTableView.Width = Unit.Percentage(100); this._RadGrid1.ClientSettings.Selecting.AllowRowSelect = true; this._RadGrid1.ClientSettings.Selecting.UseClientSelectColumnOnly = true; this._RadGrid1.AllowMultiRowSelection = true; this._RadGrid1.NeedDataSource += RadGrid1_NeedDataSource; this._RadGrid1.ItemDataBound += RadGrid1_ItemDataBound; this._RadGrid1.ItemCreated += RadGrid1_ItemCreated; GridBoundColumn boundColumn = new GridBoundColumn(); string columnName; #region RadGrid Columns GridClientSelectColumn selectAll = new GridClientSelectColumn(); selectAll.UniqueName = "SelectOne"; this._RadGrid1.MasterTableView.Columns.Add(selectAll); string templateColumnName; GridTemplateColumn templateColumn = new GridTemplateColumn(); columnName = this._ProductTable.SupplementalOriginalPriceDealEntityProductItemIdColumn.ColumnName; ; boundColumn = new GridBoundColumn(); boundColumn.DataField = columnName; boundColumn.UniqueName = "SupplementalOriginalPriceDealEntityProductItemId"; boundColumn.Display = false; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); columnName = this._ProductTable.IsCustomProductColumn.ColumnName; ; boundColumn = new GridBoundColumn(); boundColumn.DataField = columnName; boundColumn.UniqueName = "IsCustomProduct"; boundColumn.Display = false; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); columnName = this._ProductTable.SupplementalActionCodeColumn.ColumnName; ; boundColumn = new GridBoundColumn(); boundColumn.DataField = columnName; boundColumn.UniqueName = "SupplementalActionCode"; boundColumn.Display = false; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); columnName = this._ProductTable.IsLockedColumn.ColumnName; ; boundColumn = new GridBoundColumn(); boundColumn.DataField = columnName; boundColumn.UniqueName = "IsLocked"; boundColumn.Display = false; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); columnName = this._ProductTable.DescriptionColumn.ColumnName; ; boundColumn = new GridBoundColumn(); boundColumn.DataField = columnName; boundColumn.HeaderText = "Location"; boundColumn.UniqueName = "Location"; boundColumn.SortExpression = columnName; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); columnName = this._ProductTable.CatalogProductColumn.ColumnName; boundColumn = new GridBoundColumn(); boundColumn.FilterTemplate = new DropdownTemplate(columnName, _RadGrid1, this._ProductTable.SelectDistinct(columnName)); boundColumn.DataField = columnName; boundColumn.HeaderText = "Product"; boundColumn.UniqueName = "Product"; boundColumn.AllowFiltering = true; boundColumn.SortExpression = columnName; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); columnName = this._ProductTable.CountryColumn.ColumnName; boundColumn = new GridBoundColumn(); boundColumn.FilterTemplate = new DropdownTemplate(columnName, _RadGrid1, this._ProductTable.SelectDistinct(columnName)); boundColumn.DataField = columnName; boundColumn.HeaderText = "Country"; boundColumn.UniqueName= "Country"; boundColumn.AllowFiltering = true; boundColumn.SortExpression = columnName; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); columnName = this._ProductTable.StateColumn.ColumnName; boundColumn = new GridBoundColumn(); boundColumn.FilterTemplate = new DropdownTemplate(columnName, _RadGrid1, this._ProductTable.SelectDistinct(columnName)); boundColumn.DataField = columnName; boundColumn.HeaderText = "State/Province"; boundColumn.UniqueName = "StateProvince"; boundColumn.AllowFiltering = true; boundColumn.SortExpression = columnName; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); columnName = this._ProductTable.SourceSystemTypeDescriptionColumn.ColumnName; boundColumn = new GridBoundColumn(); boundColumn.FilterTemplate = new DropdownTemplate(columnName, _RadGrid1, this._ProductTable.SelectDistinct(columnName)); boundColumn.DataField = columnName; boundColumn.HeaderText = "OE System"; boundColumn.UniqueName = "OESystem"; boundColumn.SortExpression = columnName; boundColumn.AllowFiltering = true; this._RadGrid1.MasterTableView.Columns.Add(boundColumn); templateColumn = new GridTemplateColumn(); _BanColumnName = this._ProductTable.BillingAccountNumberColumn.ColumnName; templateColumn.DataField = _BanColumnName; templateColumn.ItemTemplate = new TextBoxTemplate(_BanColumnName); templateColumn.HeaderText = "BAN"; templateColumn.UniqueName = "BAN"; templateColumn.AllowFiltering = false; this._RadGrid1.MasterTableView.Columns.Add(templateColumn); if (IsSupplementOrChangeQuote) { _ServiceColumnName = this._ProductTable.AssetServiceIdColumn.ColumnName; templateColumn = new GridTemplateColumn(); templateColumn.ItemTemplate = new TextBoxTemplate(_ServiceColumnName); templateColumn.DataField = _ServiceColumnName; templateColumn.HeaderText = "Asset/Service ID"; templateColumn.UniqueName = "AssetServiceID"; templateColumn.AllowFiltering = false; this._RadGrid1.MasterTableView.Columns.Add(templateColumn); } #endregion #endregion this._UpdatePanel.UpdateMode = UpdatePanelUpdateMode.Conditional; this._UpdatePanel.ContentTemplateContainer.Controls.Add(this._RadGrid1); this._TbBAN.ID = "TbBAN"; this._TbBAN.ShowTitle = true; this._TbBAN.MaxLength = 30; this._TbBAN.WikiKeyword = "Assignment"; this._TbBAN.Title = "BAN :"; this._UpdatePanel.ContentTemplateContainer.Controls.Add(this._TbBAN); this._btnCopyToSelect.ID = "BtCopyToSelected"; this._btnCopyToSelect.Text = "Copy To Selected"; this._btnCopyToSelect.ToolTip = "This will save the BAN above to all selected items."; this._btnCopyToSelect.CssClass = "GxButtonBlue"; this._btnCopyToSelect.Click += new EventHandler(BtnCopyToSelected_Click); this._UpdatePanel.ContentTemplateContainer.Controls.Add(this._btnCopyToSelect); this._btnSaveSelected.ID = "BtSaveToSelected"; this._btnSaveSelected.Text = "Save Selected"; this._btnSaveSelected.CssClass = "GxButtonBlue"; this._btnSaveSelected.Click += new EventHandler(BtSaveToSelected_Click); this._UpdatePanel.ContentTemplateContainer.Controls.Add(this._btnSaveSelected); this.Controls.Add(this._UpdatePanel); this._btnCopyToSelect.OnClientClick = "OnClientClick('" + _RadGrid1.ClientID + "')"; this._btnSaveSelected.OnClientClick = "OnClientClick('" + _RadGrid1.ClientID + "')"; } private void BtnCopyToSelected_Click(object sender, EventArgs e) { } void BtSaveToSelected_Click(object sender, EventArgs e) { } protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { } } protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = (GridDataItem)e.Item; RadTextBox txtBan = (RadTextBox)dataItem.FindControl(_BanColumnName);// pass the TextBox ID txtBan.Attributes.Add("onfocus", "SelectRow('" + dataItem.ItemIndex + "','" + _RadGrid1.ClientID + "')"); } } #endregion void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { try { this._ProductTable = new _ProductTable().ExecuteTypedDataTable(); } catch (Exception) { } this._RadGrid1.DataSource = this._ProductTable; } protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); RadAjaxManager ajaxManager = RadAjaxManager.GetCurrent(Page); if (ajaxManager != null) ajaxManager.AjaxSettings.AddAjaxSetting(this._UpdatePanel, this._RadGrid1, this._RadLoadingPanel); } }}
RadGrid_Strategy.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top; RadGrid_Strategy.MasterTableView.EditMode = GridEditMode.Batch; RadGrid_Strategy.MasterTableView.BatchEditingSettings.EditType = GridBatchEditingType.Cell; RadGrid_Strategy.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false; RadGrid_Strategy.MasterTableView.CommandItemSettings.ShowSaveChangesButton = true; RadGrid_Strategy.MasterTableView.CommandItemSettings.ShowCancelChangesButton = true;RadGrid1.AllowSorting = TrueadGrid1.MasterTableView.AllowSorting = TrueadGrid1.ClientSettings.Scrolling.UseStaticHeaders = TrueadGrid1.MasterTableView.PageSize = 30adGrid1.MasterTableView.AllowPaging = TrueadGrid1.AllowPaging = False <style type="text/css"> #RadGrid1Panel, .RadGrid, .RadGrid_Default{ width: 700px !important; } </style><telerik:RadGrid ID="RadGrid1" runat="server" MasterTableView-EnableHeaderContextMenu="true" Height="900px" Width="700px" > <ClientSettings> <Scrolling AllowScroll="True"></Scrolling> </ClientSettings> </telerik:RadGrid>Dim tableViewOrders = New GridTableView(RadGrid1)RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders)<div class="exampleWrapper" style="margin-top:10px;margin-left:50px;"> <telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="MainMenu" SelectedIndex="0" UnSelectChildren="True" ClickSelectedTab="True" EnableSubLevelStyles="True"> <Tabs> <telerik:RadTab Text="Risk Assessments" Width="180px" > </telerik:RadTab> <telerik:RadTab Text="Audit Planning" Width="180px" Selected="True"></telerik:RadTab> <telerik:RadTab Text="Audit Execution" Width="180px"></telerik:RadTab> <telerik:RadTab Text="Draft Report" Width="180px"></telerik:RadTab> <telerik:RadTab Text="Management comments" Width="200px"></telerik:RadTab> <telerik:RadTab Text="Audit Rating" Width="180px" Selected="True"></telerik:RadTab> <telerik:RadTab Text="Final report" Width="180px"></telerik:RadTab> <telerik:RadTab Text="Follow Ups" Width="180px" Selected="True"></telerik:RadTab> </Tabs> </telerik:RadTabStrip> <!--Risk Assessment Multi View --> <telerik:RadMultiPage ID="MainMenu" runat="server" SelectedIndex="0" CssClass="outerMultiPage" > <telerik:RadPageView Height="100%" runat="server" ID="PageView1"> <telerik:RadTabStrip runat="server" ID="RiskAssessmentSubTab" CssClass="innerMultiPage" MultiPageID="MultiPageRiskAssessmentSubMenu" SelectedIndex="0" > <Tabs> <telerik:RadTab runat="server" Text="Risk Heatmap" > </telerik:RadTab> <telerik:RadTab runat="server" Text="Risk Assessment Criteria"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Detailed Plan"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Inherent Risk Score Explanation"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Controls Risk Score Explanation"> </telerik:RadTab> <telerik:RadTab runat="server" Text="Help"> </telerik:RadTab> </Tabs> </telerik:RadTabStrip> </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageAuditPlanning"> Audit Planning </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageAuditExecution"> Audit Execution </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageDraftReport"> Draft Report </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageManagementcomments"> Management comments </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageAuditRating"> Audit Rating </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageFinalreport"> Final report </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageFollowUps"> Follow Ups </telerik:RadPageView> </telerik:RadMultiPage> <telerik:RadMultiPage runat="server" ID="MultiPageRiskAssessmentSubMenu" SelectedIndex="0" CssClass="innerMultiPage" > <!--Main Views --> <telerik:RadPageView Height="100%" runat="server" ID="PageRiskHeatmap"> Risk Heatmap </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageRiskAssessmentCriteria"> Risk Assessment Criteria </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageDetailedPlan"> Detailed Plan </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageInherentRiskScoreExplanation"> Inherent Risk Score Explanation </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageControlsRiskScoreExplanation"> Controls Risk Score Explanation </telerik:RadPageView> <telerik:RadPageView runat="server" ID="PageHelp"> Help </telerik:RadPageView> </telerik:RadMultiPage></div>
var button = $find("<%= btnToggle.ClientID %>");button.set_selectedToggleStateIndex(0);Greetings all,
I’ve built a web part that connects to an AS400 database and gets a certain amount of data. A custom summary web part has been added to the landing page of the site that contains a RadGird control. The initial connection for a user is slow as the OLEDB/ODBC is connected and gets the data; up to 12 seconds. Once the connection is cached the rendering is quick.
I’d like to know if there is a way to render the page first and then bind the data within the RadGrid after the load. Much like the way the BDC connector works. With the BDC connector you can see the animated line go back and forth as it gets data.
If anyone has any ideas that’d be great.
Thanks,
-Matt