Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
381 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
116 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
216 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
150 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
386 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
119 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
417 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
109 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
1 answer
151 views
My insert command contains codes like these:

protected void grdcodelist_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
  //Get the GridEditFormInsertItem of the RadGrid
  GridDataInsertItem insertedItem = e.Item as GridDataInsertItem;
  if (insertedItem == null)
  {
    grdcodelist.Controls.Add(new LiteralControl("GridDataInsertItem is null"));
    e.Canceled = true;
    return;
  }
  // process continues
}

GridDataInsertItem is null when the following line is not there
grdcodelist.MasterTableView.EditMode = GridEditMode.InPlace;

I believe the default is EditForms.

With GridEditMode.InPlace, insert works. Update command is not affcted. Update works with or without GridEditMode.InPlace.

Any idea why insert only works with InPlace EditMode and not EditForms?
Iana Tsolova
Telerik team
 answered on 20 Sep 2011
3 answers
112 views
Hi,

I found a example in the documentation, but I did not find a full example with edit row / delete row and so on.

Do you have code example with those features?

Using the example available i was able to doble click a row to edit, but I am having trouble saving the row (index out of bounds).

Edit: Forgot to meintion that i need a example where the structure and everything else is in the code behind file, due to dynamic number of columns.
Iana Tsolova
Telerik team
 answered on 20 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?