Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
108 views
Hi,

I am useing RadGrid and which use HeaderTemplate and ItemTemplate in HeaderTemplate define Header like <tr> <td>Name</td></tr> ..... and 
 bind data in ItemTemplate like <tr><td>  <%--  <%# DataBinder.Eval(Container.DataItem, "Name")%>--%></td>.......</tr>. So problem is that
 i have clike on Export To Excel button RadGrid is disappear and Excel file is empty open. why? please help

ASPX Code:
<table>
<tr>
                                   <td>
                        <asp:Button ID="ExpReport" runat="server" Text="Export Excel " 
                             CssClass="Buttons" onclick="ExpReport_Click"  />
                    </td>
                </tr>
                <tr>
                    <td colspan="8" style="height: 8px">
                    </td>
                </tr>
            </table>
            
              
                    <%-- <table width="100%"  cellpadding="0" cellspacing="0">
        <tr><td>--%>
        <div id="divTableDataHolder">
                    <telerik:RadGrid ID="RGrid" runat="server" Skin="Default" 
                BorderWidth="0px" AutoGenerateColumns="false"
                        Width="100%" Height="100%" BorderColor="Transparent" 
                AllowSorting="true" GridLines="None"  EnableAJAX="true"                 
                OnNeedDataSource="RGrid_NeedDataSource"  CellPadding="0" CellSpacing ="0" 
                ongridexporting="RGrid_GridExporting" onpdfexporting="RGrid_PdfExporting" 
                        onitemcreated="RGrid_ItemCreated" >
                       <%-- <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>--%>
                        <MasterTableView AllowMultiColumnSorting="false" ShowHeader="false" RowIndicatorColumn-Display ="false" TableLayout ="Auto" >
                         
                            <Columns> 
                              <telerik:GridTemplateColumn groupable="False" UniqueName="Employer_Id"  Display="false">
                              
                                    <HeaderTemplate>
                                           <tr>
                                            <td>
                                                
                                                    <tr>
                                                        <td align="center" colspan="18" class ="tdBorder" style="font-weight :bold">
                                                            Number of Employees (Report employees in only one Category)
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="center" colspan="18" class ="tdBorder"  style="font-weight :bold">
                                                            Race or Ethnicity
                                                        </td>
                                                    </tr>
                                                    <tr>    
                                                               <tr>
                                                                <td class ="tdBorder" rowspan="3"  style="font-weight :bold" >Job Group</td>
                                                                    <td colspan="2"  class ="tdBorder" rowspan="2"  style="font-weight :bold">
                                                                        Hisponic or Latino
                                                                    </td>
                                                                    <td colspan="16" align="center" class ="tdBorder"  style="font-weight :bold">
                                                                        Non Hisponic or Latino
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                              
                                                              
                                                                    <td colspan="7" class ="tdBorder"  style="font-weight :bold">
                                                                        Male
                                                                    </td>
                                                                    <td colspan="7" class ="tdBorder"  style="font-weight :bold" >
                                                                        Female
                                                                    </td>
                                                                        <td class ="tdBorder" rowspan="3"  style="font-weight :bold" >
                                                                         Totals
                                                                    </td>
                                                                    </tr>
                                                                    <tr>
                                                                
                                                                        <td class ="tdBorder"  style="font-weight :bold" >
                                                                            Male</td>
                                                                            <td class ="tdBorder"  style="font-weight :bold" >
                                                                                Female
                                                                            
                                                                        </td>
                                                                        
                                                                        <td class ="tdBorder">
                                                                            American Indian OR Alaskan Native
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Asian
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Black OR African American
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Caucasian White
                                                                        </td>
                                                                        <td class ="tdBorder" >
                                                                            No Race
                                                                        </td>
                                                                        <td class ="tdBorder" >
                                                                            Native Hawaiian OR Other Pacific Islander
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Two Or More Race
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            American Indian OR Alaskan Native
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Asian
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Black OR African American
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Caucasian White
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            No Race
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Native Hawaiian OR Other Pacific Islander
                                                                        </td>
                                                                        <td class ="tdBorder">
                                                                            Two Or More Race
                                                                        </td>
                                                                       <%--    <td class ="tdBorder" rowspan="3">
                                                                         Totals
                                                                    </td>--%>
                                                                    </tr>
                                                                <%--</tr>--%>
                                                            
                                                        </td>

                                                    </tr>
                                       
                                   
                                  
                                    
                                   </HeaderTemplate>
                                    <ItemTemplate>
                                    
                                      
                                            <tr class="tdBorder" >
                                                <td class ="tdBorder">
                                              
                                                    <%# DataBinder.Eval(Container.DataItem,"EEO") %>
                                                </td>
                                                <td class ="tdBorder">
                                            
                                                    <%# DataBinder.Eval(Container.DataItem,"HispanicOrLatinoMale")%>
                                                </td>
                                                <td class ="tdBorder">
                                              
                                                   <%# DataBinder.Eval(Container.DataItem,"HispanicOrLatinoFemale")%>
                                                </td>
                                                <td class ="tdBorder">
                                                 <%# Eval("AmericanIndianOrAlaskanNativeM", "{0:N0}")%>
                                                    <%--<%# DataBinder.Eval(Container.DataItem, "AmericanIndianOrAlaskanNativeM")%>--%>
                                                </td>
                                                <td class ="tdBorder" >
                                                 
                                                   <%# DataBinder.Eval(Container.DataItem, "AsianM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                
                              <%# DataBinder.Eval(Container.DataItem, "BlackOrAfricanAmericanM")%>
                                                </td>
                                                <td class ="tdBorder">
                                         
                                                  <%# DataBinder.Eval(Container.DataItem, "CaucasianWhiteM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                  <%# Eval("NoRaceM", "{0:N0}")%>
                                                   <%# DataBinder.Eval(Container.DataItem, "NoRaceM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                 
                                                   <%# DataBinder.Eval(Container.DataItem, "NativeHawaiianOrOtherPacificIslanderM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                
                                                    <%# DataBinder.Eval(Container.DataItem, "TwoOrMoreRacesM")%>
                                                </td>
                                                <td class ="tdBorder">
                                                 <%# Eval("AmericanIndianOrAlaskanNativeF", "{0:N0}")%>
                                                 <%--   <%# DataBinder.Eval(Container.DataItem, "AmericanIndianOrAlaskanNativeF")%>--%>
                                                </td>
                                                <td class ="tdBorder">
                                               
                                                   <%# DataBinder.Eval(Container.DataItem, "AsianF")%>
                                                </td>
                                                <td class ="tdBorder">
                                                
                                                   <%# DataBinder.Eval(Container.DataItem, "BlackOrAfricanAmericanF")
                                                </td>
                                                 <td class ="tdBorder">
                                                 
                                                  <%# DataBinder.Eval(Container.DataItem, "CaucasianWhiteF")%>
                                                </td>
                                                <td class ="tdBorder">
                                              
                                                  <%# DataBinder.Eval(Container.DataItem, "NoRaceF")%>
                                                </td>
                                                <td class ="tdBorder">
                                                
                                                  <%# DataBinder.Eval(Container.DataItem, "NativeHawaiianOrOtherPacificIslanderF")%>
                                                </td>
                                                <td class ="tdBorder">
                                                 
                                                   <%# DataBinder.Eval(Container.DataItem, "TwoOrMoreRacesF")%>
                                                </td>
                                                <td class ="tdBorder" style ="font-weight:bold">
                                              
                                                    <%# DataBinder.Eval(Container.DataItem, "Total")%>
                                                </td>
                                            </tr>
       
                                    </ItemTemplate>
                                  
                               </telerik:GridTemplateColumn>
                               
                            </Columns>
                            
                        </MasterTableView>
                    </telerik:RadGrid>
                    </div>
                    <asp:HiddenField ID="HdnValue" runat="server" />
                      </telerik:RadAjaxPanel> 
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                        <ClientEvents OnRequestStart="RequestStart" />
                         <ClientEvents OnRequestStart="onRequestStart" />
                        <AjaxSettings>
                            <telerik:AjaxSetting AjaxControlID="showRpt">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="Panel" LoadingPanelID="RadAjaxLoadingPanel1" />
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                            <telerik:AjaxSetting AjaxControlID="RGrid">
                                <UpdatedControls>
                                    <telerik:AjaxUpdatedControl ControlID="RGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                                </UpdatedControls>
                            </telerik:AjaxSetting>
                        </AjaxSettings>
                    </telerik:RadAjaxManager>
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" CssClass="MyModalPanel" Transparency="50"
                        runat="server">
                    </telerik:RadAjaxLoadingPanel>

C# Code:
  protected void ExpReport_Click(object sender, EventArgs e)
        {
            try
            {
              
                RGrid.ExportSettings.IgnorePaging = true;
                RGrid.ExportSettings.ExportOnlyData = true;
                RGrid.ExportSettings.OpenInNewWindow = true;
                RGrid.ExportSettings.FileName = " Report";
                RGrid.MasterTableView.ExportToCSV();
               
                
            }
            catch (Exception ex)
            {
                
                throw ex;
            }
            
        }


Abbas
Top achievements
Rank 1
 answered on 06 Sep 2013
1 answer
95 views
A Telerik grid (Sorting, Paging enabled) with edit, delete & insert (popup) commands is used inside a user control. This user control is used in a webpage (Telerik Grid's Template Field column). When tried to use user control's grid events (edit, delete, insert, sorting, paging ...),  A Control is already associated with the element exception is thrown. 

<asp:UpdatePanel ID="updatePanel1" runat="server">
    <ContentTemplate>
        <ucl1:FormsControl ID="FormsControl1" runat="server" />
    </ContentTemplate>
</asp:UpdatePanel>

DRG
Top achievements
Rank 1
 answered on 06 Sep 2013
2 answers
111 views
I have a user control that contains an Async upload control, a comments text box and a save button. The save button is the Async upload postbackTrigger. This user control has been added multiple times to a page. If a user uploads an image for each upload control and then clicks a save button for any of the upload controls, the server side FileUpload event triggers for all of the uploaded files, not just the upload control where the save button was clicked. How can I get the FileUpload event to trigger only once for the upload control where the save button was clicked? Attached is a screen shot of the form.

Thank You for your help.
J
Top achievements
Rank 1
 answered on 06 Sep 2013
4 answers
53 views
I used the method described in the following article: Scheduler - External Edit in RadDock

The new edit form works perfectly. However, after the new edit form closes, I still have this little, tiny edit form that has no functionality. The buttons don't do anything on it. I want that tiny form to go away. Any ideas?

Thanks.
Kerry
Top achievements
Rank 1
 answered on 06 Sep 2013
2 answers
193 views
I have some simple processing going on inside a RadAjaxPanel, but when I add the RadAjaxLoadingPanel to get the spinner, the whole Panel just turns white / disappears until the postback returns. 

This is a SharePoint Visual webpart and is now happening in two different projects (different site collections), regardless of what controls are inside the RadAjaxPanel.

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"></telerik:RadAjaxLoadingPanel>
 
<telerik:RadAjaxPanel runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
    ...Some postbacks
</telerik:RadAjaxPanel>
Konstantin Dikov
Telerik team
 answered on 06 Sep 2013
1 answer
170 views
I am trying to replicate my asp.net ajax control toolkit autocompletes with the telerik version of the autocomplete.  I have everything working but one portion of it.  I have the control set to select one item only and the control to postback.  On text change I would like to populate the page with a users information from the value of the autocomplete box, but the text_changed event seems not to work for this control as I get no value in teh response.write

Protected Sub radAutoComplete_TextChanged(sender As Object, e As AutoCompleteTextEventArgs) Handles radAutoComplete.TextChanged
      Dim value As String = radAutoComplete.Entries(0).Value
 
      Response.Write(value)
      Response.End()
  End Sub


I do get a value if I attach to a linkbutton and do it this way, however then they have to pick on a button to produce results.  Currently on my Ajax toolkit autocompltes it is able to show results on a text_changed event.  So is there a way to do this with telerik autocomplete.
Protected Sub lnkView_Click(sender As Object, e As EventArgs) Handles lnkView.Click
       Dim value As String = radAutoComplete.Entries(0).Value
 
       Response.Write(value)
       Response.End()
   End Sub






































Nencho
Telerik team
 answered on 06 Sep 2013
3 answers
141 views
I'm trying to achieve the same effect while loading a grid as the demos (e.g. http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/partialajaxification/defaultcs.aspx). But when my grid is updating, the RadAjaxPanel is set to display:hidden while the RadAjaxLoadingPanel is displayed. I want the semi-transparent contents of the loading panel to be displayed on top of the grid, like the demo. How can I make the ajax panel contents remain visible?
Eyup
Telerik team
 answered on 06 Sep 2013
4 answers
97 views
Hi, i have a radscheduler with many resources. 
There is a way to set color or background color to the resources labels?
I have to set different colors by a condition, so i have to do that by code.
It's possible?
TT
Top achievements
Rank 1
 answered on 06 Sep 2013
2 answers
89 views
I am trying to line up my linkbutton with the rad autocomplete but no matter what I do it always goes to the next line and the linkbutton is on next line instead of inline with the autocomplete.  Dont know hat kind of wierd styling this thing has but it will not allow anything inline with it.  how can I put my linkbutton inline with the autocomplete.  Even tried using a div but also no go.

<table style="width:100%">
       <tr>
           <td style="width:100%;text-align:center">
                <telerik:RadAutoCompleteBox ID="radAutoComplete" runat="server" OnClientRequesting="requesting" EmptyMessage="Enter Users Last Name First Name."
                   InputType="Text" TextSettings-SelectionMode="Single">
                   <WebServiceSettings path="../AutoComplete.asmx" Method="UserAccounts" />
               </telerik:RadAutoCompleteBox>
                <asp:LinkButton ID="lnkView" runat="server" Text="ViewUser"></asp:LinkButton>   
           </td>
       </tr>
   </table>


<div class="CenterDiv">
                <telerik:RadAutoCompleteBox ID="radAutoComplete" runat="server" OnClientRequesting="requesting" EmptyMessage="Enter Users Last Name First Name."
                   InputType="Text" TextSettings-SelectionMode="Single">
                   <WebServiceSettings path="../AutoComplete.asmx" Method="UserAccounts" />
               </telerik:RadAutoCompleteBox>
                <asp:LinkButton ID="lnkView" runat="server" Text="ViewUser"></asp:LinkButton>   
      </div>



































Kevin
Top achievements
Rank 1
 answered on 06 Sep 2013
2 answers
121 views
Thanks all in advance.

We understand how the set_cancel method works within the OnClientFileUploading event.  However, we need to confirm the behaviour when set_cancel(true) is executed.  Does it cancel all the files in a multiple file upload or just the one file?

Also, we would like to do some custom validation within the OnClientFileUploading event but need to get the file extension in order to do this.  We see how to issue args.get_fileName() but need to inspect the extension based on our own invalid extension list.  Is there a file extension method available for this?

Thanks...Bob Baldwin
Trabon Solutions
Bob
Top achievements
Rank 1
 answered on 06 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?