Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
134 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
66 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
265 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
107 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
80 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
108 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
2 answers
60 views

Hello everyone, need help if possible...
I'm currently trying to hide the "Cancel" on my edit form and leave the Update visible

Here's how my editforms looks like

 

<

 

EditFormSettings>

 

 

<EditColumn UniqueName="EditCommandColumn" ButtonType="ImageButton" UpdateImageUrl="Images/update2.png" CancelImageUrl="Images/cancel.png" Visible="True">

 

 

</EditColumn>

 

</

 

EditFormSettings>

 

 

 

If I change the Visible to = false it hides both.

Any help is greatly appreciated, I'm currently new to Telerik

Thanks!

aj
Top achievements
Rank 1
 answered on 11 Jul 2012
1 answer
95 views
hi everyone

by using RadUpload inside RadGrid  how can i send path to database and  store file in an folder ..... i tested some of the code but i didn't succeed

i am using C#
Bozhidar
Telerik team
 answered on 11 Jul 2012
4 answers
149 views
Hi,
  I have multi-line radTextBox used all over my application. I want to associate a generic validation across all these multi-line radTextBoxes. To accomplish that, I thought of using jQuery to find control of type textarea (found this through firebug) and called my validation function. All this is fine. I'm able to trigger validation. One part where I didn't succeed is in my validation function, I'm using args which is not getting passed when I trigger it through jQuery. Is there a way to get around this problem?

To give you code example, in the below code, args is not defined when I try to add validation dynamically
$('textarea').keypress(function (sender, args) {
            ValidateSpecialCharcters(sender, args);
        });

        function ValidateSpecialCharcters(sender, args) {
           if(validation condition fails)
                args.set_cancel(true);
            }
        }

any ideas?

~/Ananth
Ananthalvan
Top achievements
Rank 1
 answered on 11 Jul 2012
2 answers
88 views
Hi,

I'm being given data from our DAL which returns properties, such as ParentContent.ID, however when I pass this to the TreeView it fails on databind, please see my below code:

this.rtv_LeftMenu.DataSource = contentList;
this.rtv_LeftMenu.DataTextField = "Title";
this.rtv_LeftMenu.DataFieldID = "ID";
this.rtv_LeftMenu.DataValueField = "ID";
this.rtv_LeftMenu.DataFieldParentID = "ParentContent.ID";
this.rtv_LeftMenu.Style.Add("margin", "5");
this.rtv_LeftMenu.Style.Add("padding", "5");
this.rtv_LeftMenu.DataBind();

At run time I get a NotSupportedException saying it can't find the property ParentContent.ID. I have checked to make sure the property exists and is accessible. Please let me know if there is a way to get the TreeView control to accept properties like this?

I had this working with our previous DAL, so am confident that everything else is working correctly.

Many thanks.
Anthony
Top achievements
Rank 1
 answered on 11 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?