Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
126 views
With a GridClientSelectColumn I am trying to add in the FilterTemplate a Linkbutton that will act as my clear filter button but it is not showing
Princy
Top achievements
Rank 2
 answered on 25 Jul 2014
1 answer
179 views
Telerik version: 2011.2.915.40

I am trying to set the header text for one of the columns in my hierarchical grid.  I am using the default HierarchyLoadMode (ServerOnDemand).

My original attempt was to call a recursive function on Page_Load that set the header text for each level in the hierarchy.  This works fine until you expand level 3, at which point the header text on level 2 displays the value set in the .aspx instead of the value I am setting in the code-behind.  Based on other posts I have seen in this forum, I have also tried setting the header text in the ItemDataBound event of my grid and in the PreRender of the grid.  Setting the text in the ItemDataBound works for whatever level was just loaded (first level initially, then second level when you expand the first, etc.) but the other levels display the value set in the .aspx.  Setting the text in the PreRender of the grid doesn't seem to work at all.

Where is the correct place to set header text for a hierarchical RadGrid so that it works when the grid updates?

Thanks,
Brian
Shinu
Top achievements
Rank 2
 answered on 25 Jul 2014
3 answers
448 views
Hello,
I have RadComBox and RadTextBox.When radcombox contain value I need to disable radtextbox.The following is my code but not working:

 

<telerik:RadComboBox ID="ddlLocation" runat="server" Width="125px" Font-Size="Small" AutoPostBack="false" onchanged="JavaScript: return DisableBox();">

 

 

</telerik:RadComboBox>

 

 

</td>

 

 

<td>

 

 

 

 

<telerik:RadTextBox ID="LocTextBox" runat="server" Width="100px" MaxLength="4" ToolTip="Please enter 4 char Location" AutoPostBack="false">

 

 

</telerik:RadTextBox>

 

 

</td>

 

function

 

DisableBox()

 

{

 

 

 

var TextBox = $find("<%=LocTextBox.ClientID %>");

 

 

var Location = $find("<%=ddlLocation.ClientID %>");

 

 

if(Location.length > 0)

 

{

 

 

 

TextBox.disable();

 

 

return false;

 

}
}

Please help to resolve this issue.
Thanks so much

Princy
Top achievements
Rank 2
 answered on 25 Jul 2014
3 answers
212 views
I'm using version: 2010.1.519.35 of the Telerik controls
We have a control that inherits from RadDateTimePicker that when used in a scenario that does partial postbacks with RadAjaxManager does not display the calendar popup after an ajax postback.  I have tried setting EnableAjaxSkinRendering = True with no luck.
Tim
Top achievements
Rank 1
 answered on 24 Jul 2014
9 answers
338 views
Quick question: Can I use the new client-side databinding method and have the data grouped?

I'd like to change from doing full postbacks to populate a grid, but the only stumbling block I have is trying to keep the grouping I have.

Thanks,

Stephen
Hardik
Top achievements
Rank 1
 answered on 24 Jul 2014
1 answer
68 views
Dear Telerik,

I'm following your demo here, I wonder if it's possible to have a way of comparing different fields by also showing its original field? As if using the DifferenceFrom total function, the difference from of the own field will always be zero.

Thanks.
Maria Ilieva
Telerik team
 answered on 24 Jul 2014
2 answers
74 views
I have a grid as follows. On first click it sorts one way. Than when I click on the arrow, the next column gets the sort arrow instead!
    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);
        }    
    }
}



Kostadin
Telerik team
 answered on 24 Jul 2014
1 answer
208 views
Dear Telerik,

I'm using advanced databinding on pageload in c#, and enabled batch edit mode as follow:

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;
But I have 4 columns in table and would like to set readonly = "false" to some of them, as created programmatically, what property/event should I set to get access to these generated-on-the-fly column? Many thanks.

Shinu
Top achievements
Rank 2
 answered on 24 Jul 2014
5 answers
270 views
Hello,

I am working on a project with a RadGrid that has DetailView.
The RadGrid has a lot of columns.
I want the columns’ width to auto-size by content.

I have the following code: 
VB.NET:
RadGrid1.AllowSorting = True
adGrid1.MasterTableView.AllowSorting = True
adGrid1.ClientSettings.Scrolling.UseStaticHeaders = True
adGrid1.MasterTableView.PageSize = 30
adGrid1.MasterTableView.AllowPaging = True
adGrid1.AllowPaging = False

ASPX:
    <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>

When I add the following code, all columns’s width get “squashed”:
Dim tableViewOrders = New GridTableView(RadGrid1)
RadGrid1.MasterTableView.DetailTables.Add(tableViewOrders)

How can I solve this?

I have attached video link that shows this issue:
[video link]


Thanks,
Daniel.
Princy
Top achievements
Rank 2
 answered on 24 Jul 2014
6 answers
263 views
Hi,

We are logging all error on the webserver, and for some of our customers (they are hosting their own web-server), there are thousands of errors each day like the following:
System.Web.HttpException (0x80004005): This is an invalid webresource request.

We have managed to locate the resource to a background image for the telerik tooltip.
A client that has this issue, can reset the browser cache and the error will go away for that client, but this is impossible to tell thousands of users to do so we would like to prevent this on the server!

I don't know for sure, but I think this is caused by for some reason the Machine Key has changed for our web application.
I guess this could change for several reasons, a "simple" one is a re-install of the web-server (new hardware) and then give the new server the same name.

I could easily reproduce this error by changing the Machine Key manually.

The following will happen when changing the Machine Key:
All links to WebResource.axd will be changed, BUT if using combined css with telerik, the combined css link will NOT change, it still looks like:
Telerik.Web.UI.WebResource.axd?compress=1&_TSM_CombinedScripts_=%3b%3bTelerik.Web.UI%2c+Version%3d2013.3.1029.45%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ac2b8033d-3a83-4465-9875-b583e310bb14%3aed2942d4

And inside that css are links to background images that leads to an invalid WebResource.axd!!!

To solve this, the combined link should also in some way be different if a different Machine Key!

Regards
Andreas
Aneliya Petkova
Telerik team
 answered on 24 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?