Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
129 views
Hi,

I used following code to get the total item count to display on the footer:

int RowCount;
protected void RadGrid1_ItemEvent(object sender, GridItemEventArgs e)
{
    if (e.EventInfo is GridInitializePagerItem)
    {
         RowCount = (e.EventInfo as GridInitializePagerItem).PagingManager.DataSourceCount;
    } 
}
  
  
protected void grd_ItemDataBound(object sender, GridItemEventArgs e)
 
    if (e.Item is GridFooterItem) //Set footer text  
    {
        RadGrid grd = (RadGrid)sender;
        GridFooterItem footerItem = e.Item as GridFooterItem;
        footerItem["LastCol"].Text = "Count: " + RowCount.ToString(); 
    }
}


However, when I export the grid to the Excel, the count is show as 0 in excel file (Count: 0).
Is there any workaround on this issue?

Thanks

Lamk.
LamKhoa
Top achievements
Rank 1
 asked on 11 Jul 2012
8 answers
171 views
Have a major problem with RadWindows that are pinned.

When opening a RadWindow (either clientside or serverside) and pinning it caused the clients CPU usage for iexplore.exe to go up. When the window is not pinned the CPU usage will generally be 0, but as soon as we pin the windows the CPU can increase by as much as 8% and stay there until we unpin it.

Completely baffled by this behaviour. Just to test it wasn't something I introduced I created a very basic new web application, added simply the scriptmanager, radwindowmanager and 1 radwindow to the page. We added a simple page to load in the radwindow.

I then pinned the window and the CPU usage went up and stayed up, unpinned it and the CPU usage went down.

Heres the example we used...
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TestRad._Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"  
            OutputCompression="AutoDetect"
        </telerik:RadScriptManager> 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server"
            <Windows> 
                <telerik:RadWindow runat="server" VisibleOnPageLoad="true" Visible="true" Behavior="Maximize, Minimize, Pin" InitialBehavior="Pin" NavigateUrl="WebForm1.aspx"></telerik:RadWindow> 
            </Windows> 
        </telerik:RadWindowManager> 
    </div> 
    </form> 
</body> 
</html> 
 

...and the window to load...
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="TestRad.WebForm1" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
    hello world 
    </div> 
    </form> 
</body> 
</html> 
 

No code behind is on either form. Absolutely annoying.

We did some snooping and located a possible area where the issue is happening. Seems to be getting stuck in one of the telerik script resource files. We notice ValidateParameter was being called constantly after the pinning though we didn't have the time to debug fully.


Slav
Telerik team
 answered on 11 Jul 2012
2 answers
111 views
I am following the example for resource availability but I can't figure out how to store additional text fields (Phone, BookedBy) for the appointments. I don't need them as drop down selectable resources, I need simple text entry. Is there a  way to do this?

Here is my sql data:
    <asp:SqlDataSource ID="AppointmentsDataSource" runat="server" ProviderName="System.Data.SqlClient"
        ConnectionString="<%$ ConnectionStrings:MCHPEVENTS %>" SelectCommand="SELECT [SchedulingID], [Start], [End], [Subject], [BookedBy], [Phone], [RoomID] FROM [RS_Scheduling]"
        InsertCommand="INSERT INTO [RS_Scheduling] ([Start], [End], [Subject], [RoomID], [BookedBy], [Phone]) VALUES (@Start, @End, @Subject, @RoomID, @BookedBy, @Phone)"
        UpdateCommand="UPDATE [RS_Scheduling] SET [Start] = @Start, [End] = @End, [Subject] = @Subject, [RoomID] = @RoomID, [BookedBy] = @BookedBy, [Phone] = @Phone WHERE (SchedulingID = @SchedulingID)"
        DeleteCommand="DELETE FROM [RS_Scheduling] WHERE [SchedulingID] = @SchedulingID">
        <DeleteParameters>
            <asp:Parameter Name="SchedulingID" Type="Int32" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="SchedulingID" Type="Int32" />
            <asp:Parameter Name="Start" Type="DateTime" />
            <asp:Parameter Name="End" Type="DateTime" />
            <asp:Parameter Name="Subject" Type="String" />
            <asp:Parameter Name="RoomID" Type="Int32" />
            <asp:Parameter Name="BookedBy" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="Start" Type="DateTime" />
            <asp:Parameter Name="End" Type="DateTime" />
            <asp:Parameter Name="Subject" Type="String" />
            <asp:Parameter Name="RoomID" Type="Int32" />
            <asp:Parameter Name="BookedBy" Type="String" />
            <asp:Parameter Name="Phone" Type="String" />
        </InsertParameters>
    </asp:SqlDataSource>

Thanks

http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceavailability/defaultvb.aspx 
Darren
Top achievements
Rank 1
 answered on 11 Jul 2012
3 answers
166 views
Hello everyone,

I want to partially generate an HTMLchart in codebehind.
Here is what i got :

ASPX :
<telerik:RadHtmlChart ID="CHT_samples" runat="server">
</telerik:RadHtmlChart>

in my .CS file :
AxisItem o_xItem = new AxisItem();
i_gridLines =9;
for (i_incrementA = 0; i_incrementA < i_gridLines; i_incrementA++)
{
       // Add the mold number as the X label
       o_xItem = new AxisItem();
       o_xItem.LabelText = "#" + o_sampling.LST_MOLDS[i_incrementA].NUM;
       CHT_SAMPLESCHART.PlotArea.XAxis.Items.Add(o_xItem);
}

This is working perfectly, i get the labels on my chart.
But when i create a serie and decide to add data ...

LineSeries o_xMax = new LineSeries();   
o_xMax.Name = "Max";
 
CHT_SAMPLESCHART.PlotArea.Series.Add(o_xMax);
CHT_SAMPLESCHART.PlotArea.Series[0].Items.Add(16.85m);

I get 2 points on my chart : one for "16" and the other for "85".
Is this a bug or am i doing it wrong ? Or both ? :p

Many thanks.
Framework 4.0 - WS2008R2 - VS2010

EDIT :
http://demos.telerik.com/aspnet-ajax/htmlchart/examples/databinding/staticitems/defaultcs.aspx
This is the same when i try to reproduce your static example :(
Slav
Telerik team
 answered on 11 Jul 2012
0 answers
160 views
I'm currently trying to export my Grid when the filters / sorting have been applied.  After reading around, it seems that I can't get that filtered / sorted data back unless in a function like PreRender.  There I can manually loop through each item in the grid and stuff them into an object to send to my custom export utility.

I have a custom javascript button that is running a custom fireCommand which triggers the ItemCommand function to fire off. Following the ideas from this post: http://www.telerik.com/community/forums/aspnet/grid/how-to-get-filter-data.aspx I am setting a flag in the fireCommand when my CommandName is matches the proper condition.  Then in PreRender, I call my own export function when the flag is true and this is where I'm running into issues.  Event Viewer kicks back: Server cannot set content type after HTTP headers have been sent.  

Essentially this is what my custom export function is doing to serve up the file: 
Response.Clear();
Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName + ".pdf" + ";);
Response.Flush();
Response.BinaryWrite(downloadBytes);
Response.Flush();
Response.End(); 

So is there a way I can access the sorted / filtered data to use in an export of my own?  Or is there any way to suppress whatever is firing off with Http Headers?


Philip
Top achievements
Rank 1
 asked on 11 Jul 2012
1 answer
79 views
Hello,

Here is my code

   <td align="right" width="20%"><asp:label id="LblID" runat="server" CssClass="BodyCopy" Visible="False"> ID: </asp:label>
                                   <asp:Label ID="lblReqField" runat="server" Text="*" ForeColor="Maroon" Font-Size="Medium" Visible="false"></asp:Label></td>
                                 
  <td align="left" width="30%"> 
                                   <asp:textbox id="TxtID" runat="server"  TextMode="SingleLine" Visible="false" MaxLength="10"></asp:textbox></td>

before using Rad Ajax manager, it is working fine and displaying in one row.

Now after adding the following Rad Ajax manager, ID and lblReqfield are displaying in two different rows but txtbox is displaying correct,
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cmbPaymentTerms">
                <UpdatedControls>
             
                    <telerik:AjaxUpdatedControl ControlID="LblID" />
                     <telerik:AjaxUpdatedControl ControlID="lblReqField" />
                    <telerik:AjaxUpdatedControl ControlID="TxtID" />
                  
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RbSFDCException">
                <UpdatedControls>
           
                    <telerik:AjaxUpdatedControl ControlID="LblID" />
                     <telerik:AjaxUpdatedControl ControlID="lblReqField" />
                    <telerik:AjaxUpdatedControl ControlID="TxtID" />
                 
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
       </telerik:RadAjaxManager>
Casey
Top achievements
Rank 1
 answered on 11 Jul 2012
2 answers
286 views
ASPX:

<telerik:GridTemplateColumn
                                           HeaderText="Product No."
                                           UniqueName="lnkproductnumber"
                                           DataType="System.String"-
                                           SortExpression="vchproductno"
                                           DataField="vchproductno"
                                           ReadOnly="true"
                                           ShowFilterIcon="false"
                                           CurrentFilterFunction="Contains"
                                           AutoPostBackOnFilter="true">
                                            
                                           <ItemTemplate>
                                               <asp:LinkButton
                                                   ID="lnkProdNo"
                                                   runat="server"
                                                   Text='<%# Eval( "vchproductno" ) %>'
                                                   Font-Bold="true"
                                                   OnCommand="GetProductDetail"
                                                   CommandName='<%# Eval( "vchproductno" ) %>' 
                                                   CommandArgument='<%# Eval( "intproductid" ) %>'>
                                               </asp:LinkButton>
                                           </ItemTemplate>
                                            
                                           </EditItemTemplate>
                                           <HeaderStyle Width="100px" />
                                           <ItemStyle Width="100px" />
                                       </telerik:GridTemplateColumn>



And im getting this error:

Parser Error Message: Telerik.Web.UI.GridColumnCollection must have items of type 'Telerik.Web.UI.GridColumn'. 'ItemTemplate' is of type 'System.Web.UI.HtmlControls.HtmlGenericControl'.

Telerik.Web.Ui Version=2012.1.215.40

Any idea?
Just64
Top achievements
Rank 1
 answered on 11 Jul 2012
2 answers
141 views
I am not sure where to start, so I'll just try to describe the problem as best as I can.

I have a radwindow that is set to 90% of the main window's size. Inside that window I have two panels, each with a radgrid with several rows of data each designed to fit 1024x768.

When the number of rows exceed the height of the container, the radgrid uses a vertical scroll. This is as expected. However, whenever the user scrolls the grid using the scrollbar or mouse wheel, as soon as the scrolling stops, the grid grows in width causing the radwindow to get both vertical and horizontal scroll bars.

So far I have only exhibited this problem when viewing the site in IE7 and IE9(compatability mode only). The other problem is that whenever the window is closed, after these scroll bars appear, the next time that window is used, the scroll bars remain in place.

Also, the tooltip for the grid shows something like [1 of 1] but as the grid is scrolled, the width of the tooltip narrows and the text is stacked vertically, as if the div is getting compressed along the width.

When viewed in IE9 (no compatability) the site renders as expected.
There is no backend CSS or javascript that affects the formatting and no posting is done until the user closes the form.

Thanks
Keith
Top achievements
Rank 2
 answered on 11 Jul 2012
1 answer
98 views
I have a task where I need to email information from a row where a checkbox is selected from a templatecolumn. I dont want to email info for the whole grid just the ones where a checkbox is checked from whichever row is "selected". How can I go about achieving this?

Thanks.
Eyup
Telerik team
 answered on 11 Jul 2012
3 answers
135 views
I am having two radgrids where I will show master data in one grid and when selecting the corresponding row I will show the data in child radgrid. As per the attached Image I would like to achieve my scenario can some one help me
Eyup
Telerik team
 answered on 11 Jul 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?