Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
178 views
A problem that we cannot explain or work around.  Often when our end users right click on a table to edit some table properties, text formatting is completely changed, like a whole new style is applied, even when no actual changes were made in the properties dialogue, just by launching it and clicking OK.  We found that the table was being changed, and a lot of TH were appearing.  We then narrowed it down to the Heading columns field in the properties dialogue was defaulting to 3 and was being applied to the table when OK was clicked.  We did not program any accessible features, and do not want this.  Attached is a print screen of the Heading Columns field with a mysterious 3 in it, that we think is then being applied to the table.

How can we stop this, or programmatically access this field to keep it at 0.

Thank you.
Ianko
Telerik team
 answered on 05 Jun 2014
1 answer
128 views
hello,

I have radgrid with multi levels grouping,

<GroupByExpressions>
      <telerik:GridGroupByExpression>
         <GroupByFields>
              <telerik:GridGroupByField FieldName="STORE_ID" />
          </GroupByFields>
          <SelectFields>
              <telerik:GridGroupByField FieldName="STORE_NAME" FieldAlias="STORE_NAME" HeaderValueSeparator=""/>
          </SelectFields>
      </telerik:GridGroupByExpression>
      <telerik:GridGroupByExpression>
             <GroupByFields>
              <telerik:GridGroupByField FieldName="PROVIDER_ID" />
          </GroupByFields>
          <SelectFields >
               <telerik:GridGroupByField FieldName="PROVIDER_NAME" FieldAlias="PROVIDER_NAME" HeaderValueSeparator=""/>
          </SelectFields>
          <GroupByFields></GroupByFields>
      </telerik:GridGroupByExpression>
            </GroupByExpressions>

grouping works very well, but i want to add a template header group foreach one to create a checkbox column (for each row, and group ).


how to achieve that ??
Eyup
Telerik team
 answered on 05 Jun 2014
8 answers
466 views
Hi,

I am so stuck in finding out how can i configure the datetimecolumn in edit mode. Situation is I have to enter time in minutes in the edit mode: HH:mm (24hrs time) so user may enter time say 59mins --> 00:59. I am using GridDateTimeColumn. It is displaying the time correctly in the grid because I am using the DataFormatString:
<tel:GridDateTimeColumn Datafield="MyTime" ...UniqueName="MyTime"  ... DataFormatString="{0:HH:mm}"... PickerType="TimeOnly" />
But when I edit any row in the grid the MyTime column displays the time : 12:59 AM which is quite confusing.

If I use a RadTimePicker outside the grid the I can setup the dateinput view as:
<tel:RadTimePicker ... >
  <DateInput runat="server" DateFormat="HH:mm" DisplayDateFormat="HH:mm" />
</tel:RadTimePicker>

I also tried to setup the properties of datatime control in ItemDataBound but it is not applying. Is there any thing like DateInput.... in GridDateTimeColumn, so that we can set the options (DateInput,No popup button etc) in Edit / insert mode.

Any help will be so much appreciated.

Cheers, Ali

Angel Petrov
Telerik team
 answered on 05 Jun 2014
3 answers
214 views
Hi,
We have a radgrid which have mastertable and detailtables and we would like to have a gray background starting from extreme left. We managed doing for mastertable header by using below css

.rgRow .rgExpandCol
       {
         background-color:Gainsboro !important;
         
       } 

Please help us so that we can achieve the same effect for detailtable headers.
Please find the attached image.
Venelin
Telerik team
 answered on 05 Jun 2014
9 answers
297 views
When i use SelectedIndexchanged in RadCombobox1(postback=true) to call a SQL query to change item in Radcombobox2.I want use RadAjaxLoadingPanel in that time.can you help me?thank you very much!
Nencho
Telerik team
 answered on 05 Jun 2014
12 answers
228 views
My grid contains items in sort order as per my custom logic.But when i am using filter option with contains property, my grid shows the items which are perfectly match at the top and then other items.

So my sort order concept not persisting so longer.

I want filtering without changing the order of items in grid.

Thanks in advance!
Angel Petrov
Telerik team
 answered on 05 Jun 2014
4 answers
451 views

Hi,

I've got a page with one Placeholder on it and nothing else. I've added the RadScriptManager and the RadGrid using the code below and the Paging works ok but the sorting doesn't?  No error is thrown. It shows the sorting icons in the column heading but does not actually do the sorting.

If I do exaclty the same using the Designer pages it all works fine. It's trying to do things programmatically that I can't get it to work.

 

default.aspx
==========
<%@ Page EnableEventValidation="false"  Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="TelerikGridExample._Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
<asp:PlaceHolder runat="server" ID="ph"></asp:PlaceHolder>
</body>
</html>

default.aspx.cs
==============
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

namespace TelerikGridExample
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Init(object sender, EventArgs e)
        {

                HtmlForm f1 = new HtmlForm();

                // script manager
                Telerik.Web.UI.RadScriptManager sm = new Telerik.Web.UI.RadScriptManager();
                sm.ID = "RadScriptManager1";

                // data source
                SqlDataSource ds = new SqlDataSource(@"Data Source=gbe-pc\express2008;Initial Catalog=Northwind;User ID=sa;Password=something", "SELECT categoryid, categoryname FROM [categories]");
                ds.ID = "SqlDataSource1";

                // rad grid
                Telerik.Web.UI.RadGrid rg = new Telerik.Web.UI.RadGrid();
                rg.ID = "RadGrid1";
                rg.PageSize = 5;
                rg.AllowPaging = true;
                rg.AllowSorting = true;
                rg.AutoGenerateColumns = false;
                rg.GroupingEnabled = true;
                rg.ClientSettings.AllowDragToGroup = true;
                rg.EnableViewState = false;

                // add some columns
                Telerik.Web.UI.GridBoundColumn c1 = new Telerik.Web.UI.GridBoundColumn();
                rg.MasterTableView.Columns.Add(c1);
                c1.DataField = "categoryid";
                c1.SortExpression = "categoryid";
                c1.UniqueName = "categoryid";
                c1.DataType = System.Type.GetType("System.Int32");
                c1.HeaderText = "categoryid";

                Telerik.Web.UI.GridBoundColumn c2 = new Telerik.Web.UI.GridBoundColumn();
                rg.MasterTableView.Columns.Add(c2);
                c2.DataField = "categoryname";
                c2.SortExpression = "categoryname";
                c2.UniqueName = "categoryname";
                c2.DataType = System.Type.GetType("System.String");
                c2.HeaderText = "categoryname";
               
                rg.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(rg_NeedDataSource);
                // add to controls to the ajax panel
                f1.Controls.Add(sm);
                f1.Controls.Add(ds);
                f1.Controls.Add(rg);

                ph.Controls.Add(f1);     
        }

        void rg_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            Telerik.Web.UI.RadGrid myrg = (Telerik.Web.UI.RadGrid)Page.FindControl("RadGrid1");
            myrg.DataSource = (SqlDataSource)Page.FindControl("SqlDataSource1");

        }

    }
}

 

Shinu
Top achievements
Rank 2
 answered on 05 Jun 2014
2 answers
123 views
I am using an edit form template. Editing a record is fine, but when I select the "add new record button", the paging moves about 14 pages (I am using 50 rows per page). After cancelling or saving the record, the paging stays at that new paging position. My sqldatasource is sorted desc by the identity field.  So I am no longer at the top (newest record). I even tried rebinding the grid after initializing(RadGrid.InitInsertCommandName). Why does the act of initializing the insert do this? Very strange, but I'm sure one of you know what I am doing wrong.

Tom
Princy
Top achievements
Rank 2
 answered on 05 Jun 2014
3 answers
543 views
I've got RadCombobox with Itemtemplate (an anchor  element)  which is inside GridtemplateColumn of RadGrid. This RadCombobox has this properties set -  EnableLoadOnDemand="true" DataSourceID="ObjectDataSourceDrob" so  in RadGridLang_Loadevent  when I get to the point             pRadGridLang.DataBind();   myradcombobox is populated.

My question is is there any way I can create dynamically this Itemtemplate od radcombobox dynamically and populate it with data
Thank you

Here is my aspx page

  <telerik:RadGrid ID="RadGridLang" runat="server" AutoGenerateColumns="False"  EnableEmbeddedSkins="False"  RegisterWithScriptManager=false 
                 DataTextField="Descr" DataValueField="LanImg"
                Height="100%" Width="120px" AppendDataBoundItems="true" CellSpacing="0" GridLines="None" OnLoad="RadGridLang_Load">
                <MasterTableView>
                    <Columns>
                        <telerik:GridTemplateColumn DataField="LanCd">
                            <ItemTemplate>
                                <img src="<%#DataBinder.Eval(Container.DataItem, "LanImg")%>" alt="ASP.NET hosting" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="LanCd">
                            <ItemTemplate>
                                <telerik:RadComboBox ID="RadComboBoxLang" runat="server" EmptyMessage="Select a language" DataTextField="Descr" DataValueField="LanCd" EnableEventValidation="true"  RegisterWithScriptManager=false 
                                    EnableLoadOnDemand="true" DataSourceID="ObjectDataSourceDrob" CausesValidation="false" AllowCustomText="true" AppendDataBoundItems="true" OnLoad="RadComboBoxLang_Load">
                                     <ItemTemplate>
                                        <div class="imageWrap">
                                           <<telerik:RadComboBoxItem Text="Select" />
                                            <a id='myhref' href='/<%#DataBinder.Eval(Container.DataItem, "Controller")%>/<%#DataBinder.Eval(Container.DataItem, "Action")%>/<%# Eval("LanCd") %>/<%#DataBinder.Eval(Container.DataItem, "menuID")%>'>
                                            <img src="<%#DataBinder.Eval(Container.DataItem, "LanImg")%>" alt='<%# Eval("Descr")%>'/>&nbsp&nbsp&nbsp&nbsp&nbsp<%#DataBinder.Eval(Container.DataItem, "Descr")%></a>
                                        </div>
                                       
                                    </ItemTemplate>
                                </telerik:RadComboBox>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
                                                                                   
   



  <asp:ObjectDataSource ID="ObjectDataSourceDrob" runat="server" SelectMethod="GetWebLanguage" TypeName="MvcBeaDAL.WebServiceBea">
        <SelectParameters>
            <asp:Parameter DefaultValue="" Name="id" Type="String" />
        </SelectParameters>
    </asp:ObjectDataSource>

Here is my code 

protected void RadComboBoxLang_Load(object sender, EventArgs e)
        {
            String pRequest = pGetLang; 
           RadComboBox radComboBoxLang = sender as RadComboBox;
           

            radComboBoxLang.SelectedValue = pRequest.ToUpper();
            bool p_test = MvcBeaDAL.CookiesManager.SetGetCookie(radComboBoxLang.SelectedValue);
        }
        protected void RadGridLang_Load(object sender, EventArgs e)
        {
            String pRequest = GetLang();
            pGetLang = pRequest;
            
            RadGrid pRadGridLang = this.FindControl("RadGridLang") as RadGrid;
            List<LanguageHost> radLang = new List<LanguageHost>();
            radLang.Add( MvcBeaDAL.WebServiceBea.GetWebLanguageID(pRequest));
           
            pRadGridLang.DataSource = radLang.ToList();
            pRadGridLang.DataBind();
        }
 
 
Shinu
Top achievements
Rank 2
 answered on 05 Jun 2014
3 answers
139 views
I have a Radgrid in an Update Panel. It has a template for "Add new Record". This template has a dropdownlist and a RadAsyncUpload control in a panel. When a value is selected from the dropdown and a file is uploaded, the Upload button is enabled. Else it is disabled.  For this I have a javascript function as follows:
function SetUploadButtonEnabled(controlPanel, fileUploadId) {
     var docTypesList = controlPanel.find("select");
     var gotListVal = docTypesList.val() != "";
     var fileUpload = $find(fileUploadId);
     var gotFileVal = fileUpload.getUploadedFiles().length > 0;
     var enable = gotListVal && gotFileVal;
     if (enable) {
         controlPanel.find(".GxButtonBlue").removeAttr("disabled");
     }
     else {
         controlPanel.find(".GxButtonBlue").attr("disabled", true);
     }
 }
I am trying to call it from code behind as follows, but the function is not being called:
string script = "<script type=\"text/javascript\">"
                + "\n  $(document).ready(function (){"
                    + "\n    $(document).on(\"change\", \"#" + this._DdDocumentTypes.ClientID + "\", function(event){"
                    + "\n      var docUploadControlPanel = $(this).closest(\"#" + this._DocUploadControlPanel.ClientID + "\");"
                    + "\n      SetUploadButtonEnabled(docUploadControlPanel, \"" + this._fiInput.ClientID + "\");"
                    + "\n    });"
                    + "\n  });"
                    + "\n "
                    + "</script>";
 
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "DocumentAjaxUploadCtrlScript_" + this.ClientID, script);
Since an Update Panel is there I even tried:
ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "DocumentAjaxUploadCtrlScript_" + this.ClientID, script, true);

But the javascript function is never called! Can you suggest a solution?
Shinu
Top achievements
Rank 2
 answered on 05 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?