Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
80 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
733 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
250 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
89 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
8 answers
318 views
I'm trying to create a form with text boxes and combo boxes, that have a set width and right aligned labels.

Using the label attribute of the of the controls, the final rendered output between the two are not consistent. The text box puts the <label> and the <input type=text> in two different table cells. While the combobox renders with in a single cell. So using CSS on the LabelCssClass doesn't get the same results.

I've seen examples on your site of right aligned text on the combo box (http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/expandanimation/defaultcs.aspx) but it is using standard text instead of the <label for="">. I need it to use the label tag for 508 compliance.

Can you point me to another example of how this is done?
Princy
Top achievements
Rank 2
 answered on 14 Oct 2011
2 answers
124 views
Hi, I'm trying to create a compositeControl that contains a RadEditor:

public class TextEditorRad : CompositeControl
    {
        public TextEditorRad()
        {
          
  
protected override void OnInit(EventArgs e)
        {
            CreateChildControls();
            base.OnInit(e);
        }
  
        #region CreateChildControls
        protected override void CreateChildControls()
        {
            Controls.Clear();
            editor = new RadEditor();
            editor.ID = "edEdit";
  
            //DoControl();
            this.Controls.Add(editor);
              
        }
        #endregion
        #region RecreateChildControls
        protected override void RecreateChildControls()
        {
            EnsureChildControls();
        }
        #endregion
        #region Render
        protected override void Render(HtmlTextWriter writer)
        {
            AddAttributesToRender(writer);
            editor.RenderControl(writer);            
        }
        #endregion
}

When I drag this from my tool box on to an aspx and view the page, The editor is visible but I cannot select the text area and I get the following error showing in FF error console:
Error: a is undefined
Source File: http://localhost/myapp/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+Version%3d3.5.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3ad0c4ca6e-6b5d-49b6-922d-5244924fb100%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c+Version%3d2010.1.309.20%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3af0c88abc-2e1c-4c5d-ab67-8dc4eeeb22f8%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3a1e771326%3ae524c98b%3a874f8ea2%3adc7e0bd%3a1569bb5f%3a63b115ed%3a1c565fc%3a30f1f089%3a19620875%3a33108d14
Line: 6

Any ideas?

Thanks
ric c
Top achievements
Rank 1
 answered on 14 Oct 2011
1 answer
112 views
Hi!
I'm using a telerik radeditor with the DocumentManager button that opens a file explorer. In this case I have a rather large folder tree and when I scroll down to select a folder, the file explorer rerenders and the folder tree scrolls to top again. Is there any way to prevent this so that the user easier can keep track of where he/she is?

I have tried the same scenario using the FileExplorer control directly, but in that case the scroll to top does not occur.

/Dan
Rumen
Telerik team
 answered on 14 Oct 2011
3 answers
96 views
Hi,

Is it possible to make the confirmation delete box to be displayed just beside the appointment to delete?
Because if I have a scheduler page that is in full view (24 hrs) and I try to delete the meeting in 11pm, the confirmation box is in the center of the scheduler.

And some users are lazy to scroll up to just to click on Ok button.

Thanks,
Bermo
Peter
Telerik team
 answered on 14 Oct 2011
3 answers
172 views
Hello
     My problem is Row created event is not firing on using Mozilla Firefox.  But there is no problem when i am using on IE.

Please help me on this issue..
Thanks in advance...



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript" language="javascript">
            function LessionPlanViewRowCreated(sender, eventArgs) {
                var DataItem = eventArgs.get_gridDataItem().get_element();
                for (var i = 2; i < DataItem.cells.length; i++) {
                    if (DataItem.cells[i].innerText.trim() == "Red") {
                        DataItem.cells[i].style.backgroundColor = "Red";
                    }
                    else if (DataItem.cells[i].innerText.trim() == "Orange") {
                        DataItem.cells[i].style.backgroundColor = "Orange";
                    }

                    else if (DataItem.cells[i].innerText.trim() == "Green") {
                        DataItem.cells[i].style.backgroundColor = "Green";
                    }
                }
            }
         
        </script>

    </telerik:RadCodeBlock>
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table>
        <tr>
            <td>
                
                <telerik:RadGrid ID="radGvrAcdamicYearPerformanceView" runat="server" GridLines="None"
                    Skin="Office2007" CellSpacing="1">
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" EnableImageSprites="True">
                    </HeaderContextMenu>
                    <MasterTableView>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <CommandItemSettings ExportToPdfText="Export to Pdf" />
                        <Columns>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <ClientEvents OnRowCreated="LessionPlanViewRowCreated" />
                    </ClientSettings>
                </telerik:RadGrid>
            </td>
        </tr>
    </table>
</asp:Content>
Mira
Telerik team
 answered on 14 Oct 2011
1 answer
267 views
I am trying to find a way to control the compression and quality of the image saved by the ImageEditor.    

Currently running the saveImageOnServer command:
imageEditor.saveImageOnServer("", true)

connected to a  "SaveImage" tool
 <telerik:ImageEditorTool CommandName="SaveImage" ToolTip="Save Image" />
 

I loaded an image with following properties:
Width = 1024px
Height = 768px
Size = 606KB
DPI = 96
BitDepth = 24

I cropped the image to 1013 x 638 and saved the image. 

The properties of the file changed to:
Width = 1013px  Height = 638px Size = 1.32MB  DPI = 96 BitDepth = 32

I was hoping the file size would decrease but I imagine file size increase has to do with the BitDepth increasing.   How can I control this with the ImageEditor control? 
Rumen
Telerik team
 answered on 14 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?