Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
108 views
The grid is set to multi-page.  When I scroll down and click select a checkbox, the grid jumps jumps off the page where the bottom of the grid is showing at the top of the screen.  I cannot seem to fix this issue.  Anyone have any idea what's going on here? 

Pavlina
Telerik team
 answered on 02 Apr 2012
1 answer
173 views
Hello,

I want to use a simple HeaderTemplate for my ComboBox:

internal class MyHeaderTemplate : ITemplate
   {
      private readonly RadButton _okButton;
 
      public MyHeaderTemplate()
      {
         _okButton = new RadButton();
         _okButton.ID = "OkButton";
         _okButton.Text = "OK";
      }
 
 
      internal RadButton ButtonOk
      {
         get { return _okButton; }
      }
 
      public void InstantiateIn(Control container)
      {
         container.Controls.Add(_okButton);
      }
   }

But I get this error when the pare is generated: Script controls may not be registered after PreRender. When I don't set the HeaderTemplate to the ComboBox, everything works as expected.

Princy
Top achievements
Rank 2
 answered on 02 Apr 2012
1 answer
179 views
How can I make a datepicker show warning symbol like  RadNumericTextBox ?
Princy
Top achievements
Rank 2
 answered on 02 Apr 2012
2 answers
99 views
Hi everybody,

i have a little problem which may be caused by misunderstanding some logic in RadChart.

My RadChart is drawed as Pie and bound two a DataTable. The result is one Series with dynamic count of items.
Whenever the Items count is getting higher than 15 the ChartControl is drawing two pies.
Searching the Forum and Support i found that the DataGroupColumn is responsíble vor mulitple Pies but i haven't set it to any value.

My Qestion is:
Is this behavior by Design or what else can be the reason that a Series with more than 15 items is drawed into two pies?

Thank you guys

P.s. I use the newest version of Telerik RadControls
Peshito
Telerik team
 answered on 02 Apr 2012
3 answers
220 views
I'm using client-side binding to a WebMethod, and I need to intercept the AJAX response object. I can get the row objects that are children of the response in the OnRowDataBound through args.get_dataItem(); how to do I get the return object from the WebMethod (either before or after the grid is bound at client-side)?
Antonio Stoilkov
Telerik team
 answered on 02 Apr 2012
1 answer
730 views
Hello,

I am having trouble adding "OnChecked" events to my GridTemplateColumns I am creating programmatically.

Here is the code I am using to create my columns (and the new column "RoleColumn"):
               public void DefineGridStructure()
            {
                var templateColumn = new GridTemplateColumn();
                templateColumn.UniqueName = "myColumn" + i;
                templateColumn.ItemTemplate = new RoleColumn("myColumn" + i);
  
                 // add the dynamically created columns to the grid
                dgLoginRequest.MasterTableView.Columns.AddAt(COLUMN_START_POS - 1, templateColumn);
            }
  
  
    public class RoleColumn : ITemplate
    {
  
        protected CheckBox roleCheckbox;
        private string _columnName;
  
        public RoleColumn(string columnName)
        {
            _columnName = columnName;
        }
  
        public void InstantiateIn(Control container)
        {
            roleCheckbox = new CheckBox { ID = "cbx" + _columnName };
            roleCheckbox.AutoPostBack = true;
            roleCheckbox.DataBinding += new EventHandler(roleCheckbox_DataBinding);
            container.Controls.Add(roleCheckbox);
        }
  
        private void roleCheckbox_DataBinding(object sender, EventArgs e)
        {
            var cBox = (CheckBox)sender;
            var container = (GridDataItem)cBox.NamingContainer;
            cBox.Checked = ((EntityUserRole)container.DataItem).Roles[0][_columnName];
        }
  
    }


Now when I call the DefineGridStructure routine I then bind a data source to my grid (the datasource is an ArrayList type which holds "Role" objects):

           public void BindDataGrid()
        {
            try
            {
                DefineGridStructure();
                dgLoginRequest.DataSource = DataSource;
                dgLoginRequest.DataBind();
            }
            catch (Exception ex)
            {
                throw;
            }
        }

    public

 

 

interface IRole

 

    {

 

 

        Int16 RoleID { get; set; }

 

 

 

        string RoleName { get; set; }

 

 

 

        Int16 OrderID { get; set; }

 

    }



I then capture the OnItemDataBoundEvent and add my event handler at this point;
            protected void dgLoginRequest_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            

                    var i = 0;
                foreach (Role role in Roles)
                {
                    var checkbox = (e.Item as GridDataItem)["myColumn" + i].Controls[0] as CheckBox;
                    checkbox.CheckedChanged += new EventHandler(cbxReader_CheckedChanged); 
                            i++;
                }
                  
            }
        }

However, when I click my checkboxes they do not fire the event (cbx_CheckedChanged).

What am I missing?

All I want to do is create a checkbox column for each role that I have in my Arraylist (currently 4).  And I want to be able to handle the "OnCheckedChanged" event in code whenever any of these checkboxes are checked.

Please help.  I have went through the documenation already - that's how i got this far.  A sample application would be appreciated.

Thanks,
Antonio Stoilkov
Telerik team
 answered on 02 Apr 2012
4 answers
261 views
Trying to use the Radgrid to do server-side data filtering.  

I'm binding a dataset to a RadGrid, and setting the AutoPostBackOnFilter='true' for each column.  Clicking on the filter button throws this unhandled exception.


Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +11025
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +176
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5563
Milena
Telerik team
 answered on 02 Apr 2012
4 answers
101 views

If I use DataBinding to create my menuitems, and use the OnClientItemClicked event to call a javascript which calls a radwindow (popup), the called radwindow does not popup, rather it loads into the target pane.
(well it pops up briefly, then exits and reloads in the Target Pane)

However, when I Create the MenuItems in HTML, the call to the OnClientItemClicked javascript , does popup the radwindow correctly.

My workaround for this was "AppendDataBoundItems" and retain a menu item from HTML, such that my popup radwindow pops up correctly...Happiness,..BUT

It is AppendDataBoundItems,...and I really want PrePend,..i.e. I would like my MenuItem with Popup to appear at the end of the Menu, not the beginning.

Any help,..ideas ? (for either).

Code is: 

RadMenu AdminAuthMenu = this.NavPane.FindControl("RadMenu1") as RadMenu;
AdminAuthMenu.DataSource = SiteMap.GetdbMenuItems();   //Just class with db sql to get MenuItems
AdminAuthMenu.DataBind();

protected void RadMenu1_OnItemDataBound(object sender, RadMenuEventArgs e)
{

    RadMenuItem ei = e.Item as RadMenuItem;

    ei.Target = "ContentPane";
}

Markup is:

 

telerik:RadMenu ID="RadMenu1"  runat="server" Width="100%" Height="31px" Skin="Black"

 OnClientItemClicked="MenuItemItemClicked"

 DataFieldID="ScreenId"

 DataNavigateUrlField="Screen"

 DataTextField="Title"

 DataValueField="ScreenId"

 OnItemDataBound="RadMenu1_OnItemDataBound"

 AppendDataBoundItems="True">

 <DefaultGroupSettings Flow="Horizontal" />

 <Items >
      <telerik:RadMenuItem runat="server" Text="Login" value="Login"

                  BackColor="Transparent" ForeColor="#FFFFC0"></telerik:RadMenuItem>

</Items>

 

Neal
Top achievements
Rank 1
 answered on 02 Apr 2012
4 answers
174 views
Hi,
I have update newer version of telerik to 2012.1.215.40. After update the new version i am getting error on my almost all page
before updating the version it was working fine but i don't know what happened after update the newer version. Please help

Following javascript error getting on button click(javascirpt error on Mozilla firefox)

Error: Sys.WebForms.PageRequestManagerServerErrorException: Text property cannot be set. String was not recognized as a valid DateTime.
Source File: http://localhost:1932/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RSMAccountsTrak_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a89093640-ae6b-44c3-b8ea-010c934f8924%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2012.1.215.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3ab29b07e8-2c1e-44e5-9e1b-59bb6459fb01%3a16e4e7cd%3a874f8ea2%3af7645509%3a24ee1bba%3a19620875%3af46195d3%3a490a9d4e%3abd8f85e4%3a2003d0b8%3a1e771326%3aaa288e2d%3aed16cbdc%3ae330518b%3a8e6f0d33%3a7c926187%3a8674cba1%3ab7778d6c%3ac08e9f8a%3a59462f1%3aa51ee93e%3ae085fe68
Line: 15Webpage error details


Please help it break my all applications.

Thanks
Manish
Vasil
Telerik team
 answered on 02 Apr 2012
6 answers
314 views
I have a maskedTextbox with 2 events, onblur client side and OnTextChanged in server side.
My on blur method are returning true or false, if my return is true, i wanna enter in server side and do OnTextChanged, if return is false doesnt enter on server side and show a alert. 
My problem is, my return can be true or false, doesnt make anything different, always enter in server side.

function verificarCPF() {
    var contador;
    var valorCPF = $telerik.findMaskedTextBox("txtBuscaCpf").get_value();
    var numeroCPF = valorCPF.substr(0, 9);
    var digitoCPF = valorCPF.substr(9, 2);
    var d1 = 0;
 
    for (contador = 0; contador < 9; contador++) {
        d1 += numeroCPF.charAt(contador) * (10 - contador);
    }
    if (d1 == 0) {
        radalert("CPF Inválido!",350,140,"Mensagem",null,null);
        return false;
    }
    d1 = 11 - (d1 % 11);
    if (d1 > 9) d1 = 0;
    if (digitoCPF.charAt(0) != d1) {
        radalert("CPF Inválido!", 350, 140, "Mensagem", null, null);
        return false;
    }
 
    d1 *= 2;
    for (contador = 0; contador < 9; contador++) {
        d1 += numeroCPF.charAt(contador) * (11 - contador);
    }
    d1 = 11 - (d1 % 11);
    if (d1 > 9) d1 = 0;
    if (digitoCPF.charAt(1) != d1) {
        radalert("CPF Inválido!", 350, 140, "Mensagem", null, null);
        return false;
    }
    return true;
    //radalert("CPF Válido!", 350, 140, "Mensagem", null, null);
}

<telerik:RadMaskedTextBox ID="txtBuscaCpf" ClientEvents-OnBlur="verificarCPF" AutoPostBack="true" runat="server" Mask="###.###.###-##"
    Width="100" OnTextChanged="txtBuscaCpf_TextChanged" />

Thankz in advance!
Vasil
Telerik team
 answered on 02 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?