Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
100 views
When I make a change to the schedule, or if I view the AdvancedEditForm for a particular appointment, I start getting the following error when I hover over an appointment:

Unable to get value of the property 'get_allowDelete': object is null or undefined

If I add a new appointment the page refreshes (via Ajax, not a full postback).  I can hover over the new appointment without a problem, but any existing appointments will throw this error.

When I step through the JavaScript debugger, I see that there is a call to get_element(), and this method looks in the first position of the _domElements array.  In my case, the first entry is null, but the second contains the element that it should be returning.
Chet
Top achievements
Rank 1
 answered on 14 Oct 2011
1 answer
54 views

Hi telerik ppl:

Im using this code to swap languages for the column headers and also for the grouping fields labels within the group panel.
 

protected void RadGrid1_ItemCreated(object sender,GridItemEventArgs e){
            if (e.Item is GridHeaderItem)
            {
                string strControl = "";
                GridHeaderItem headerItem = e.Item as GridHeaderItem;
                headerItem["IDColumn"].Text = GetResource("Document ID");
                headerItem["companyColumn"].Text = GetResource("Company");
                headerItem["nameColumn"].Text = GetResource("Name, First");
                headerItem["dueDateColumn"].Text = UBGlobal.GetResource("Due Date");
                headerItem["ageColumn"].Text = GetResource("Age");
                headerItem["assignedToColumn"].Text = GetResource("Assigned To");
                headerItem["activityTypeCodeColumn"].Text = GetResource("Next Activity");
                headerItem["subjectColumn"].Text = GetResource("Last Activity Notes");
                headerItem["phoneColumn"].Text = GetResource("Phone");
                 
            }
 
 
            if (RadGrid1.GroupPanel.GroupPanelItems.Count > 0)
            {
                RadGrid1.GroupPanel.GroupPanelItems.Count.ToString());
                for (int i = 0; i < RadGrid1.GroupPanel.GroupPanelItems.Count; i++)
                {
                    RadGrid1.GroupPanel.GroupPanelItems[i].Text = GetResource(RadGrid1.GroupPanel.GroupPanelItems[i].Text);
                }
            }           
}

 
The problem here is that the objects within the Group Panel are not being translated when loading the grid or after draging and drop a column into the group panel.......the traslations are only being done when colapsing or expanding the grid rows.

I think this is because the Group Panel doesnt have elements when the ItemCreated Event is fired.....so my questions are:

1.- When is the Group Panel being populated.
and/or
2.- is there a better way to localize the Group Panel elements.......

This must be done in CODEBEHIND.....srry about the caps, are only to emphasize the fact that I cant use the fieldAlias property due to the fact that 3 different language translations must be done and the texts are changed so oftenly.

Thks in advance

Joel
Top achievements
Rank 1
 answered on 14 Oct 2011
1 answer
73 views
Hi,

In loaded event of tree I look through nodes and get reference to <img/> inside each node which is templated through <NodeTemplate>.I want the user to be able to left click on it and see context menu (same context menu as user can see by right clicking on any tree item). This is how I add 'onclick' handler to <img/>:
imgTag.click(nodes[i], function (e) {
    var menu = e.data.get_contextMenu();
    if (menu)
        menu.showAt(e.pageX, e.pageY);
 
    //$telerik.cancelRawEvent(e);
    e.stopPropagation();
});

Now when I click on img I can see the context menu, but no events are fired and obviously postback doesn't happen (regular right click based menu works as expected). I tried with treeView.showNodeContextMenu but it fails internally on get_contextMenu call.

How to fix that? :) Thank you!

Related posts with similar problems:
http://www.telerik.com/community/forums/aspnet-ajax/treeview/show-contextmenu-when-hovering-on-node-instead-of-right-click.aspx
http://www.telerik.com/community/forums/aspnet/treeview/show-context-menu.aspx
Shukhrat Nekbaev
Top achievements
Rank 1
 answered on 14 Oct 2011
1 answer
88 views
Hi guys

I i succsesfuly viev appointments from the sql sever database from my scheduler, Now all my appointments appear in the "all day" slot
While each appointment hav a start time and an end time.

How can i solve this?
Ivana
Telerik team
 answered on 14 Oct 2011
8 answers
231 views

 

 

I am trying to get the user control on th eItemcommand of the grid but it is coming null. can some one please help as in what i am missing in here.

the user control comes null. please help.......
Code Behind

protected
void GridResult_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

 

if (e.CommandName == RadGrid.EditCommandName)

 

{

 

 

GridDataItem item = e.Item as GridDataItem;

 

 

 

UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);

 

(userControl.FindControl(

 

"A") as HiddenField).Value = item["x"].Text;

 

(userControl.FindControl(

 

"B") as HiddenField).Value = item["Y"].Text;

 

}

}

Page Details.
Grid Columns:
this is my button

 

 

<telerik:GridEditCommandColumn UniqueName="actionsCommandColumn" EditText="Go" ButtonType="PushButton">

 

 

 

</telerik:GridEditCommandColumn>

<

 

 

EditFormSettings PopUpSettings-Modal="true" InsertCaption="Actions" UserControlName="CustomControl.ascx"

 

 

 

 

 

 

 

EditFormType="WebUserControl">

 

</EditFormSettings>

 

 

 

 

Pravesh
Top achievements
Rank 1
 answered on 14 Oct 2011
2 answers
515 views
PROBLEM SOLVED
Moderator can close this thread.

On the website there seems to be missing an explicit explanation that After you do an CallbackUpdate you have to add a Javascript function where you do a sender.show() so your notification window could be seen on clientside.

**********************************************************************************************************************************************************

Hello, I started using RadNotification control today and I have encountered a problem that is really weird.

The problem is that I am using a really simple implementation of this control using a callback method on the server, and this the notification doesn't Fire up when the event ends... in Fact it never FIRES up anytime the event ends.

Here is my code (I used the same code provided in the Demo website) REF: http://demos.telerik.com/aspnet-ajax/notification/examples/updateinterval/defaultcs.aspx

The only difference is that I am not using the QuickStart Library or Event Log Console.

(CODE)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="ListaBase.UserControls.WebForm1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
 
<!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>
     
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <br />
    <telerik:RadNotification ID="RadNotification1" runat="server" LoadContentOn="TimeInterval"
        Width="300" Animation="Fade" EnableRoundedCorners="true" EnableShadow="true"
        Title="Received messages" OffsetX="-20" OffsetY="-20"
        TitleIcon="none" UpdateInterval="3000" AutoCloseDelay="1500" OnCallbackUpdate="OnCallbackUpdate">
        <ContentTemplate>
            <asp:Literal ID="lbl" runat="server"></asp:Literal>
        </ContentTemplate>
    </telerik:RadNotification>
     
     
    </div>
    </form>
</body>
</html>


namespace ListaBase.UserControls
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
 
        protected void OnCallbackUpdate(object sender, RadNotificationEventArgs e)
        {
            int newMsgs = DateTime.Now.Second % 10;
            if (newMsgs == 5 || newMsgs == 7 || newMsgs == 8 || newMsgs == 9) newMsgs = 0;
            lbl.Text = "You have " + newMsgs + " new messages!";
            RadNotification1.Value = newMsgs.ToString();
        }
    }
}
Kristian
Top achievements
Rank 2
 answered on 14 Oct 2011
1 answer
66 views
Got a strange one here.
We run a scheduler in timeline mode to show a bunch of bookings for an ad server.
90% of the time it works flawlessly.
But around once or twice a day out of many 10s of hits per day by our staff, the appointments render truncated in the view.
On closer inspection I noticed they are all exactly half-sized.  It's set to 1 day per slot, so ads that are booked for a full day take up half a slot, and a ten-day campaign stretches 5 slots leaving the next 5 days as incorrcectly available. Hitting F5 will always remedy the error, only for it randomly trigger later in the day.

I have applied the actual start and end dates to the tooltip for the appointment and have confirmed that when they truncate, the actual data behind it is still correct. So it seems it is just a rendering issue, not a data source issue.

I can't seem to find any reference to this being a known bug, so I'm still looking at what might be causing it in our implementation.  But it is strange that such a bug should be intermittent.  We're using Firefox v 3.6.3.

Just thought I'd throw it out there in case it rings any bells with anyone.

Thanks for your time
Peter
Telerik team
 answered on 14 Oct 2011
5 answers
712 views
Hello,

I have an issue with a Heirarchy - Grid/Programmatic Binding.

I tried following this example as best as i can: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx

I have a main table and three nested grids:
Main Table 
    -  Table 1
- Table 2
- Table 3

I can expand just find from Main -> Table 1. But when i try to expand a row from table 1 to get to table 2 i keep getting an error "Object reference not set to an instance of an object". I debugged through my code and saw that it breaks down on the line that contains:

portfolioTypeCode = dataItem.GetDataKeyValue("PortfolioTypeCode").ToString();


It's odd that it doesn't work because I can see the PortfoliotypeCode Column in table 1 with all the correct data, and I named everything correctly on the front end. Here is my grid front end (the table not working is named 'PortfolioTypeCode':

<telerik:RadGrid ID="PNLViewGrid" runat="server" Width="100%" AutoGenerateColumns="false"
    AllowSorting="true" AllowPaging="false" OnNeedDataSource="PNLView_NeedDataSource"
    OnDetailTableDataBind="PNLView_DetailTableDataBind">
    <MasterTableView Width="100%" DataKeyNames="PortfolioCode,PortfolioTypeCode,Strategy,StrategyId,SymbolCode,AsOfDate"
        AllowMultiColumnSorting="true">
        <DetailTables>
            <telerik:GridTableView DataKeyNames="PortfolioCode,AsOfDate" Name="PortfolioCode" Width="100%">
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="PortfolioCode,PortfolioTypeCode,AsOfDate" Name="PortfolioTypeCode" Width="100%">
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="PortfolioCode,PortfolioTypeCode,StrategyId,AsOfDate" Name="Strategy" Width="100%">
                                <Columns>
                                    <telerik:GridBoundColumn SortExpression="SymbolCode" HeaderText="Symbol Code" HeaderButtonType="TextButton" DataField="SymbolCode" />
                                    <telerik:GridBoundColumn SortExpression="DailyPNL" HeaderText="Total Daily PNL" HeaderButtonType="TextButton" DataField="DailyPNL" />
                                    <telerik:GridBoundColumn SortExpression="MTDPNL" HeaderText="Total Montly PNL" HeaderButtonType="TextButton" DataField="MTDPNL" />
                                    <telerik:GridBoundColumn SortExpression="YTDPNL" HeaderText="Total Yearly PNL" HeaderButtonType="TextButton" DataField="YTDPNL" />
                                    <telerik:GridBoundColumn SortExpression="BaseMktValue" HeaderText="Total Base Market Value" HeaderButtonType="TextButton" DataField="BaseMktValue" />
                                    <telerik:GridDateTimeColumn SortExpression="AsOfDate" HeaderText="As Of Date" HeaderButtonType="TextButton" DataField="AsOfDate" Visible="false" />
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                        <Columns>
                            <telerik:GridNumericColumn SortExpression="StrategyId" HeaderText="StrategyId" HeaderButtonType="TextButton" DataField="StrategyId" Visible="false" />
                            <telerik:GridBoundColumn SortExpression="Strategy" HeaderText="Strategy" HeaderButtonType="TextButton" DataField="Strategy" />
                            <telerik:GridBoundColumn SortExpression="DailyPNL" HeaderText="Total Daily PNL" HeaderButtonType="TextButton" DataField="DailyPNL" />
                            <telerik:GridBoundColumn SortExpression="MTDPNL" HeaderText="Total Montly PNL" HeaderButtonType="TextButton" DataField="MTDPNL" />
                            <telerik:GridBoundColumn SortExpression="YTDPNL" HeaderText="Total Yearly PNL" HeaderButtonType="TextButton" DataField="YTDPNL" />
                            <telerik:GridBoundColumn SortExpression="BaseMktValue" HeaderText="Total Base Market Value" HeaderButtonType="TextButton" DataField="BaseMktValue" />
                            <telerik:GridDateTimeColumn SortExpression="AsOfDate" HeaderText="As Of Date" HeaderButtonType="TextButton" DataField="AsOfDate" Visible="false" />
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="PortfolioTypeCode" HeaderText="Portfolio Type Code" HeaderButtonType="TextButton" DataField="PortfolioTypeCode" />
                    <telerik:GridBoundColumn SortExpression="DailyPNL" HeaderText="Total Daily PNL" HeaderButtonType="TextButton" DataField="DailyPNL" />
                    <telerik:GridBoundColumn SortExpression="MTDPNL" HeaderText="Total Montly PNL" HeaderButtonType="TextButton" DataField="MTDPNL" />
                    <telerik:GridBoundColumn SortExpression="YTDPNL" HeaderText="Total Yearly PNL" HeaderButtonType="TextButton" DataField="YTDPNL" />
                    <telerik:GridBoundColumn SortExpression="BaseMktValue" HeaderText="Total Base Market Value" HeaderButtonType="TextButton" DataField="BaseMktValue" />
                    <telerik:GridDateTimeColumn SortExpression="AsOfDate" HeaderText="As Of Date" HeaderButtonType="TextButton" DataField="AsOfDate" Visible="false" />
                </Columns>
            </telerik:GridTableView>
        </DetailTables>   
        <Columns>
            <telerik:GridBoundColumn SortExpression="PortfolioCode" HeaderText="Portfolio Code" HeaderButtonType="TextButton" DataField="PortfolioCode" />
            <telerik:GridBoundColumn SortExpression="DailyPNL" HeaderText="Total Daily PNL" HeaderButtonType="TextButton" DataField="DailyPNL" />
            <telerik:GridBoundColumn SortExpression="MTDPNL" HeaderText="Total Montly PNL" HeaderButtonType="TextButton" DataField="MTDPNL" />
            <telerik:GridBoundColumn SortExpression="YTDPNL" HeaderText="Total Yearly PNL" HeaderButtonType="TextButton" DataField="YTDPNL" />
            <telerik:GridBoundColumn SortExpression="BaseMktValue" HeaderText="Total Base Market Value" HeaderButtonType="TextButton" DataField="BaseMktValue" />
            <telerik:GridDateTimeColumn SortExpression="AsOfDate" HeaderText="As Of Date" HeaderButtonType="TextButton" DataField="AsOfDate" Visible="false" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>


Here is my codebehind:

protected void PNLView_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
       {
           GridDataItem dataItem = (GridDataItem) e.DetailTableView.ParentItem;
           pnlVO item = (pnlVO) dataItem.DataItem;
           string portfolioCode = "";
           string portfolioTypeCode = "";
           string strategy = "";
           int strategyId = 0;
           string date = "";
           switch (e.DetailTableView.Name)
           {
               case "PortfolioCode":
                   portfolioCode = dataItem.GetDataKeyValue("PortfolioCode").ToString();
                   date = dataItem.GetDataKeyValue("AsOfDate").ToString();
                   e.DetailTableView.DataSource = ViewUtil.Instance.GetByPortfolioTypeCode(portfolioCode, date);
                   break;
               case "PortfolioTypeCode":
   ERROR HERE ===> portfolioTypeCode = dataItem.GetDataKeyValue("PortfolioTypeCode").ToString();
                   portfolioCode = dataItem.GetDataKeyValue("PortfolioCode").ToString();
                   date = dataItem.GetDataKeyValue("AsOfDate").ToString();
                   e.DetailTableView.DataSource = ViewUtil.Instance.GetByStrategy(portfolioTypeCode, portfolioCode, date);
                   break;
               case "Strategy":
                   portfolioTypeCode = dataItem.GetDataKeyValue("PortfolioTypeCode").ToString();
                   portfolioCode = dataItem.GetDataKeyValue("PortfolioCode").ToString();
      strategyId = Convert.ToInt32(dataItem.GetDataKeyValue("StrategyId").ToString());
                   date = dataItem.GetDataKeyValue("AsOfDate").ToString();
                   e.DetailTableView.DataSource = ViewUtil.Instance.GetBySymbolCode(portfolioTypeCode, portfolioCode, strategyId, date);
                   break;
           }
       }


Can someone please help me? I know for a fact that the PortfolioTypeCode column is being populated because i can see it in Table 1. Why is it not able to get the datakeyvalue? It looks to me like it can't get the datakeyvalue from a detail nested table but can only read the datakeyvalues whos columns are found within the main table. Anyway around this?

Thanks!
CG
Top achievements
Rank 1
 answered on 14 Oct 2011
3 answers
225 views
Hi

Been trying to deleet an appointment, below is my back code for attempting to delete the appointment

 

 

public void rsAppointments_AppointmentDelete(object sender, SchedulerCancelEventArgs e)

 

{

 

systemBusinessLayer.deleteAppointment(

 

Convert.ToInt32(e.Appointment.ID));

 

}



When i put a brake point I see it doesnt even come near the event.

below is the code from my businesLayer

public

 

 

void deleteAppointment(int appointmentID)

 

{

 

 

using (SqlConnection con = new SqlConnection(ConnString))

 

{

 

 

SqlCommand cmd = new SqlCommand("procDeleteAppointment", con);

 

cmd.CommandType =

 

CommandType.StoredProcedure;

 

cmd.Parameters.Add(

 

new SqlParameter("@appointmentID", SqlDbType.Int));

 

cmd.Parameters[

 

"@appointmentID"].Value = appointmentID;

 

 

 

try

 

{

con.Open();

cmd.ExecuteNonQuery();

}

 

 

catch (SqlException exp)

 

{

 

 

throw new ApplicationException(exp.Message);

 

}

}

}

 


Plamen
Telerik team
 answered on 14 Oct 2011
2 answers
74 views
New to using the Radgrid and trying to learn my way around but I found that I am stuck and need some help.

I have a small web app that allows the user to import a *.csv file that I bind to a RadGrid. I want the user to have the ability to add, edit or delete rows before storing to a table. I've got everything working except adding data.

For the edit (RadGrid.UpdateCommand) I am able to get the Item Index, cast as a GridEditableItem, specify the column name, cast as a textbox and get the text value.

Dim editItem As GridEditableItem = CType(gvMSR.EditItems(e.Item.ItemIndex), GridEditableItem)
dtb.Rows(e.Item.ItemIndex).Item("column1") = CType(editItem("column1").Controls(0), TextBox).Text

When I try to do this for the add record row, which has an Item Index of -1, I get an error "Index was out of range. Must be non-negative and less than the size of the collection."

I have also tried using the unique ID from the sender and concatenating that with the column number to get the unique ID for the individual textbox (which I have verified using Google Chrome dev tools) but get an "Object reference not set to an instance of an object" error.

Dim itemPrefix As String = e.Item.UniqueID.ToString & "$ctl"
dtb.Item("column1") = CType(e.Item.FindControl(itemPrefix & "00"), TextBox).Text

So I'm stuck. I'm sure there is a better way to do this but I'm not familiar enough with RadGrid yet to know how.

Any help is appreciated. Thanks.
License
Top achievements
Rank 1
 answered on 14 Oct 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?