Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
95 views

Hi Telerik team,
So far i have enjoyed using your telerik controls but now facing an awkward problem.
I am creating radgrid dynamically from the code behind with autogenerated columns TRUE.
when I set AllowSorting property of the grid to true. It is displaying the following error

Control 'ctl16_ctl00_ctl02_ctl00_ctl00' of type 'GridLinkButton' must be placed inside a form tag with runat=server.


I even tried with advanced databinding like on need datasource but no luck.
i set autogenerated columns=false and dynamically added columns and data fields and sortexpression and bind the grid. the previous error is gone but the sorting is not happening. Please take it as urgent issue and tell me the solution as my demo is tomorrow.
Thanks in advance






Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Sep 2011
0 answers
56 views
Hi

I am using this code to get the Grandtotal of each item in Radgrid and show it in textbox outside Grid

function Grand_Total(sender)
 {
               
            var tot_cos = document.getElementById("tot_cos");
            var grandTotal = 0;
                
   
            for(var i = 0; i < sender.MasterTableView.Rows.length; i++)   //loop through the items
            {
                       var item = sender.MasterTableView.Rows[i];
                        if (item.Control.cells[1].all[0].checked == true)
             {                   
                var total;
               total= item.Control.cells[8].all[0].value.replace("$","");
                  
                grandTotal =  parseFloat(grandTotal) + parseFloat(total);
              }  
            }
              
            tot_cos.value = parseFloat(grandTotal);
 }
only when an item is checked i am retreiving the total.

When i open the same page on IPAD or safari . It gives me error item.Control.cells[1].all is not an object.

How can i get the item of radgrid in a row using uniquename.

Please help.

Thank you
kavya
Kavya
Top achievements
Rank 2
 asked on 20 Sep 2011
9 answers
304 views
Guys, this is a really really weird one for me.
we launch a modal window from a rowClick in radGrid:

 

 

string strfunction = String.Format("OpenWorkOrderDetails({0},{1},{2},{3})",

 

wonumber, wotypeid, locationid, woid);


the code above basically does the "window.open(wonumber, wotypeid, locationid, woid); from javascript and runs the Page Load event of the Page it's Opening.
usually passing the variable 'woid'
HOWEVER. For the Life of the Session, it never ever runs thru that Page load event again - only the first time.
And, you can select other rows go to another tab in the program & when you come back when you click that same row, the screen comes up exactly as it did the first time - completely skipping the "Page Load" event. if any changes were made on that window, it doesn't show them. it only shows the original data.
we're not caching anything, so, i dont understand how this is possible.
here's the  top part of that page - run inside of a master page.
is there anything that you can see & have you ever heard of anything like this before?
thanks again for any help.
rik

<%

 

@ Page Language="C#" MasterPageFile="~/NOVDarkBlue.Master" AutoEventWireup="true"

 

 

 

CodeBehind="InventoryConsole.aspx.cs" Inherits="NOV.GOLD.WebApp.Inventory.InventoryConsole" Culture="auto:en-US" UICulture="auto" %>

 

<

 

 

asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

 

 

 

<script type="text/javascript" src="../Scripts/CommonFunctions.js"></script>

 

 

 

<script type="text/javascript" src="../Scripts/WorkOrders.js"></script>

 

 

 

<script type="text/javascript" src="../Scripts/Inventory.js"></script>

 

 

 

<telerik:RadWindowManager ID="RadWindowMnager1" runat="server" KeepInScreenBounds="true"

 

 

 

CssClass="RadWinManager" VisibleStatusbar="false">

 

 

 

<Windows>

 

 

 

<telerik:RadWindow ID="RadWindow1" runat="server" Modal="true" Width="600" Height="500"

 

 

 

ShowContentDuringLoad="false" Skin="WebBlue" Behaviors="Close,Move" />

 

 

 

</Windows>

 

 

 

</telerik:RadWindowManager>

 

 

 

<telerik:RadAjaxPanel ID="MainContentAjaxPanel" runat="server" LoadingPanelID="MasterAjaxLoadingPanel">

rik butcher
Top achievements
Rank 1
 answered on 20 Sep 2011
0 answers
82 views
My colleague wrote a demo project that uses the rad combobox in a really nice way whereby each item in the combo box is of type [object] so can be cast to the object desired.. This was in the winforms version..

I am trying to do something similar in asp.net but cannot get it to work.. Can someone confirm this doesnt work in this version?

MassMaintenance.

 

MaintenanceFieldDTO selectedField =

 

comboboxField.SelectedValue

 

as MassMaintenance.MaintenanceFieldDTO;

 


In my code, comboboxField.SelectedValue is a string and I have to locate that string in my list of objects myself - I cant seem to do the above, right?

michelle
Top achievements
Rank 1
 asked on 20 Sep 2011
1 answer
178 views
Hi all,

I am developing webparts for Sharepoint using Telerik Controls.
I need to put a RadGrid inside a RadWindow so users could acces it when searching for specific data.
RadGrid data change while choosing specific fields from Combobox from a different control.
My problem is the RadGrid Data that is inside the RadWindow is not changing.
I am opening the RadWindow from javascript and reloading RadGrid Data from server side.
Can you help me with this issue please.

Thank you in advance.

Fady
Marin Bratanov
Telerik team
 answered on 20 Sep 2011
2 answers
126 views
Hi all,

Basically i have a grid which is declared statically, as in the following example:

 http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html#Section1

Now when i declare the columns in the markup, everything works fine (grouping/ filtering / self reference hierarchy, by the way, in the following example the hierarchy is not declared, i know hehe).

EDIT: Solved the grouping problem, it was a mistake with the execution of the grid creation procedure.

Now problem is, when i run a procedure in code-behind that creates the columns / hierarchy, the needdatasource handler doesnt seem to work...and starts throwing errors regarding "Multiple textbox with the same Id" or something similar when i try to drag and group by a column, filter works, and the hierarchy doesn't. My datasource is a list of entities using the IEnumerable interface, so from what i have read, it should not cause any problems D:

Attaching code-behind:

EDIT: Still having problem creating the hierarchy from code-behid.

protected void CreateGridStructure()
{                                 
    RadGrid1.MasterTableView.DataKeyNames = new string[] { "ElementoJerarquia.Parent.Id", "ElementoJerarquia.Id" };
    RadGrid1.MasterTableView.ClientDataKeyNames = new string[] { "Id", "Numero", "Responsable.NombreCompleto", "ElementoJerarquia.Nombre" };
    RadGrid1.MasterTableView.FilterExpression = "ElementoJerarquia.Parent.Id IS NULL";
 
    RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.Client;
    RadGrid1.MasterTableView.SelfHierarchySettings.KeyName = "ElementoJerarquia.Parent.Id";
    RadGrid1.MasterTableView.SelfHierarchySettings.ParentKeyName = "ElementoJerarquia.Id";
              
}

Also a little note, the procedure that reads "CrearBoundColumn", returns a GridBoundColumn object, it was just a test.

Thanks in advance for any help.
Trasto
Top achievements
Rank 1
 answered on 20 Sep 2011
17 answers
304 views
I am using the WebBlue skin, but my user wants the weekend color shaded darker. I added the following to my aspx:

.RadScheduler_WebBlue .rsContentTable .rsSatCol,

.RadScheduler_WebBlue .rsContentTable .rsSunCol

{

background:#8B8F91;

border-bottom-color:#d2d8db;

}

When first entring the screen, it is still the light blue. If I change to 24-hour, it is the new dark grey I specified. If I change back to Business Hours, it is then changed to the Dark Grey. How do I get the Dark Grey to show when I first enter the screen for the first time?

Thanks,
Susan

Plamen
Telerik team
 answered on 20 Sep 2011
2 answers
80 views
Hello.

In the following html page, the cursor is displayed in the login field when the page is loaded:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head>
    <title></title>
</head>
<body>
    <center>
    <form id="form1" runat="server" method="post" action="">
        <table style="background:#cccccc" cellpadding="2" cellspacing="3">
            <tr align="center">
                <td></td>
                <td align="right"><label>Login: </label></td>
                <td align="left"><input type="text" id="login" style="width:140px" maxlength="30" /></td>
                <td></td>
            </tr>
            <tr align="center">
                <td></td>
                <td align="right"><label>Password: </label></td>
                <td align="left"><input type="text" id="password" style="width:140px" maxlength="30" /></td>
                <td></td>
            </tr>
        </table>
        <br />
  
        <input type="button" value="Login" style="width:65px;" />
    </form>
    </center>
  
    <script type="text/javascript">
        document.forms["form1"]["login"].focus();
    </script>
</body>
</html>

However, when the corresponding aspx page is loaded (with the RadFormDecorator component), the cursor is no longer displayed:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="MemberJoin._Default" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head>
    <title></title>    
</head>
<body>
    <center>
    <form id="form1" runat="server" method="post" action="">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" />
          
        <table style="background:#cccccc" cellpadding="2" cellspacing="3">
            <tr align="center">
                <td></td>
                <td align="right"><label>Login: </label></td>
                <td align="left"><input type="text" id="login" style="width:140px" maxlength="30" /></td>
                <td></td>
            </tr>
            <tr align="center">
                <td></td>
                <td align="right"><label>Password: </label></td>
                <td align="left"><input type="text" id="password" style="width:140px" maxlength="30" /></td>
                <td></td>
            </tr>
        </table>
        <br />
          
        <input type="button" value="Login" style="width:65px;" onclick="validateLogin()" />
    </form>
    </center>
      
    <script type="text/javascript">
        document.forms["form1"]["login"].focus();
    </script>
</body>
</html>

No methods have been implemented in the code behind.
Why isn't the cursor being displayed?

Thank you in advance.
Paulo
Paulo
Top achievements
Rank 1
 answered on 20 Sep 2011
1 answer
361 views
I get the error:
Cannot add duplicate collection entry of type add with unique key attribute name set to Telerik_Web_UI_WebResource_axd

While trying to deploy my application. It works fine when I run it on my machine though:

The box I'm trying to deploy it on is iis7.5/Windows Server 2008 if that helps. Here are the offending lines of code from my web.config. if I comment them out the app runs, but the asyncupload control isn't visible.


<system.web>
    <httpHandlers>
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false" />
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
    </httpHandlers>
  </system.web>
  <system.webServer>
    <defaultDocument>
      <files>
        <clear/>
        <add value="pcHome.aspx" />
      </files>
    </defaultDocument>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <!--<add name="ChartImage_axd" verb="*" preCondition="integratedMode" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" />
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />-->
    </handlers>
  </system.webServer>
Genady Sergeev
Telerik team
 answered on 20 Sep 2011
1 answer
90 views
Hello.

I'm developing a page with RadGrid. Grid should have ability to reorder positions of predefined columns and ability to hide some of them.
And I'm facing with very strange behavior. I prepared small example with this bug

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test.aspx.cs" Inherits="Web.Test" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager runat="server" />
         
        <telerik:RadGrid ID="grid" runat="server" AutoGenerateColumns="False">
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn DataField="column1" UniqueName="column1" />
                    <telerik:GridBoundColumn DataField="column2" UniqueName="column2" />
                    <telerik:GridBoundColumn DataField="column3" UniqueName="column3" />
                    <telerik:GridBoundColumn DataField="column4" UniqueName="column4" />
                    <telerik:GridBoundColumn DataField="column5" UniqueName="column5" />
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
        <asp:Button ID="btnButton" runat="server" Text="Press Me" />
    </div>
    </form>
</body>
</html>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace Web
{
    public partial class Test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            grid.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(grid_NeedDataSource);
            btnButton.Click += new EventHandler(btnButton_Click);
        }
 
        void btnButton_Click(object sender, EventArgs e)
        {
            var columns = new string[] { "column5", "column2" };
            List<GridColumn> items = grid.Columns.Cast<GridColumn>().ToList();
            grid.Columns.Clear();
 
            for (int i = 0; i < columns.Count(); i++)
            { // Adding visible columns
                GridColumn column = items.FirstOrDefault(a => a.UniqueName == columns[i]);
                column.Visible = true;
                grid.Columns.Add(column);
            }
 
            for (int i = 0; i < items.Count; i++)
            { // Adding invisible columns
                if (!columns.Contains(items[i].UniqueName))
                {
                    items[i].Visible = false;
                    grid.Columns.Add(items[i]);
                }
            }
 
            grid.Rebind();
        }
 
        void grid_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            grid.DataSource = Enumerable.Range(0, 5).Select(i => new {
                column1 = 1 * Math.Pow(10, i),
                column2 = 2 * Math.Pow(10, i),
                column3 = 3 * Math.Pow(10, i),
                column4 = 4 * Math.Pow(10, i),
                column5 = 5 * Math.Pow(10, i),
            });
        }
    }
}

It should display columns 1..5 after start and columns 5 and 2 after pressing a button is not it?
But what we see:
1) columns 1..5 after start, ok
2) when press a button - there are only 2 and 5 columns, but it should be 5 and 2, the order is wrong
3) press a button again - columns displayed changed (!) to 2 and 1

If we set breakpoint on grid.Rebind() line and look at grid.Columns we'll see that there is correct order (visible column5 and column2, then invisible column1, column 3, column4) every time. So I think that root of evil is in some AJAX logic or in grid rendering code. Or may be something is wrong with my code?
Iana Tsolova
Telerik team
 answered on 20 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?