Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
518 views
Hi, I am trying to export 3 different radgrids to three excel worsheets (sheet1, sheet2, sheet3) within the same excel file. Could you please suggest some code on this.
Angel Petrov
Telerik team
 answered on 30 Jan 2014
1 answer
56 views
 <asp:label ID="rtStartTimelbl" AssociatedControlID="rtStartTime" Runat="server" meta:resourcekey="rtStartTimelblResource1" Text="Start Time"></asp:label>
 <telerik:RadTimePicker ID="rtStartTime" Font-Size="Medium" SelectedDate='<%# setdefaultStartTime %>' DateInput-ID="rtStartTimeInput"  
                Runat="server" Culture="en-US" DateInput-DateFormat="M/d/yyyy" DateInput-DisplayDateFormat="M/d/yyyy" meta:resourcekey="rtStartTimeResource1">
                <DatePopupButton ImageUrl="/icons32/clock.png" HoverImageUrl="/icons32/clock.png"
                    CssClass="" />
            </telerik:RadTimePicker>

When I try to validate the page using WAVE, this code prompts an error of a missing label for the rtStartTime - I've tried just regular labels as well but still doesn't work.  I've read something about changing the AssociatedControlID to rtStartTime_Input but that didn't work either.  I'm using an older version of Telerik so perhaps this has been addressed in future versions but shouldn't this be straight forward?  What am I missing.

Thanks as always!
Deyan Enchev
Telerik team
 answered on 30 Jan 2014
1 answer
52 views
Hi ,
i have a grid in edit mode with bound columns. One of the column is of date type. To this i have set format string as MMM/yyyy , dat works fine, but in edit mode this format is not maintained. How to have same format in edit mode?
Shinu
Top achievements
Rank 2
 answered on 30 Jan 2014
5 answers
309 views
Code below allow me to loops through all rad controls on the page. it is working except when I have 2 raddatepicker. it doesn't know which dateinput textbox to hight light even though it gets the right id of the current selected one. please help. thanks


function Validation() {
            var allRadComboBoxes = [];
            var allRadControls = $telerik.radControls;
            for (var i = 0; i < allRadControls.length; i++)
            {
                var element = allRadControls[i];
                if (Telerik.Web.UI.RadComboBox && element instanceof Telerik.Web.UI.RadComboBox) {
                    Array.add(allRadComboBoxes, element);
                }
            }
             
            for (var i = 0; i < allRadComboBoxes.length; i++)
            {
                var CurrentControlID = allRadComboBoxes[i].get_id();
                var TextControlID = CurrentControlID.replace("ddl", "txt");
                var TextControl = $find(TextControlID);
                switch (allRadComboBoxes[i].get_text().toLowerCase())
                {
                    case "figure":
                        if (allRadComboBoxes[i].get_text().toLowerCase() == "actual date")
                        {
                            TextControlID = CurrentControlID.replace("ddl", "dp");
                            TextControl = $find(TextControlID);
                            alert(TextControlID);
                        }
                        if (document.getElementById(TextControlID).value == "")
                        {
                            if (TextControlID.indexOf("txt") >= 0)
                            {
                                TextControl.get_styles().EnabledStyle[0] += "background-color: red;";
                                TextControl.updateCssClass();
                                return false;
                            }
                            else
                            {
                                alert($find("<%=dp_DateArtworkAcquired%>"));
                                TextControl.get_dateInput()._textBoxElement.style.backgroundColor = "red";
                                return false;
                            }
                        }
                }
            }
            return false;
        }
Viktor Tachev
Telerik team
 answered on 30 Jan 2014
1 answer
85 views
 
         protected void Page_Init(object sender, EventArgs e)
       {
           if (!Page.IsPostBack)
           {
               AddPageView(tabstripPersoneel.FindTabByText("Personeelsfiche"));
           }
       }
 
       protected void Sidebar_TabClick(object sender, RadTabStripEventArgs e)
       {
           AddPageView(e.Tab);
           e.Tab.PageView.Selected = true; //NullReferenceException happens Here
       }
 
       private void AddPageView(RadTab tab)
       {
           RadPageView pageView = new RadPageView();
           pageView.ID = tab.Text;
           ContentMultiPage.PageViews.Add(pageView);
           tab.PageViewID = pageView.ID;
       }
 
       protected void ContentMultiPage_OnPageViewCreated(object sender, RadMultiPageEventArgs e)
       {
           string userControlName ="/Controls/"+ e.PageView.ID + "Weergave.ascx";
 
           Control userControl = Page.LoadControl(userControlName);
           userControl.ID = e.PageView.ID + "_userControl";
 
           e.PageView.Controls.Add(userControl);
       }



I have 3 radstrips which call the Sidebar_Tabclick method, each nested in a different pageview in a multipage. The sidebar looks like this:

<telerik:RadMultiPage runat="server" ID="SideMultiPage" SelectedIndex="0">
                    <telerik:RadPageView runat="server" ID="PageviewPersoneelsleden">
                        <telerik:RadTabStrip ID="tabstripPersoneel" runat="server" Orientation="VerticalLeft" OnClientTabSelecting="onTabSelecting" OnTabClick="Sidebar_TabClick">
                            <Tabs>
                                <telerik:RadTab Text="Personeelsfiche" runat="server" Selected="True">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Arbeidsovereenkomst" runat="server">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Asset" runat="server">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Certificaten" PageViewID="Certificaat" runat="server">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Ervaringen" PageViewID="Ervaring" runat="server">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="PageviewAfwezigheden" runat="server">
                         <telerik:RadTabStrip ID="tabstripAfwezigheden" runat="server" Orientation="VerticalLeft" OnTabClick="Sidebar_TabClick">
                            <Tabs>
                                <telerik:RadTab Text="Afwezigheid inplannen" PageViewID="Afwezigheid" runat="server" Selected="True">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Maandoverzicht afwezigheden" PageViewID="Maandoverzicht" runat="server">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Jaaroverzicht afwezigheden" PageViewID="Jaaroverzicht" runat="server">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Kalenderoverzicht" PageViewID="Kalender" runat="server">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                    </telerik:RadPageView>
                    <telerik:RadPageView ID="PageviewWagens" runat="server">
                         <telerik:RadTabStrip ID="TabstripWagens" runat="server" Orientation="VerticalLeft" OnTabClick="Sidebar_TabClick">
                            <Tabs>
                                <telerik:RadTab Text="Wagens" PageViewID="Wagen" runat="server" Selected="True">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Tankkaarten" PageViewID="Tankkaart" runat="server">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Technische onderhouden" PageViewID="Onderhoud" runat="server">
                                </telerik:RadTab>
                                <telerik:RadTab Text="Expertiseverslagen" PageViewID="Expertiseverslag" runat="server">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                    </telerik:RadPageView>
                </telerik:RadMultiPage>

Each tab corresponds to a different custom control. the intent is to copy the workings of http://demos.telerik.com/aspnet-ajax/tabstrip/examples/multipage/dynamic-pageview-creation/defaultcs.aspx. When I execute this, the first pageview loads fine, but when I try to load the second one, it gives me a nullreferenceException on the line with the comment at the end. It seems like it doesn't assign Pageview a value.
Nate
Top achievements
Rank 1
 answered on 30 Jan 2014
1 answer
102 views
Hi,

I use your "Rotator - Slide Show" which is great. But how do I change the language of the Title? In the xml-File you can find:

 <Title>
    <![CDATA[               <h1>Marketing Strategy</h1>          ]]>
</Title>

But how can I make this multilingual. I tried:

<Title>
<![CDATA[
<ul>
<li><asp:label runat="server" id="Bannertxt1" meta:resourcekey="Banner1_rsc" CssClass="ProgBannertxt" /></li>
</ul>
]]>
</Title>

But the text is not shown. What can I do here?

Thanks
Best Regards
rene
Slav
Telerik team
 answered on 30 Jan 2014
1 answer
246 views
hi,
  I want to maintain checkbox state after paging
here is my code
<telerik:RadGrid ID="grid1" runat="server" AllowPaging="True"
                                              CssClass="rgHeaderDiv"  AllowMultiRowSelection="True"
                                              AutoGenerateColumns="False" 
                                              onneeddatasource="grid1_NeedDataSource" ShowFooter="true"
                                              GridLines="None" ShowGroupPanel="True" >
                                               <ClientSettings AllowDragToGroup="True">
                                                          <Scrolling AllowScroll="true"  UseStaticHeaders="true" SaveScrollPosition="true" />                                                         
                                               </ClientSettings>
                                     
                                         <MasterTableView  AutoGenerateColumns="false" >  <FilterItemStyle HorizontalAlign="Left" />
                                         <FilterItemStyle HorizontalAlign="Left" />
                                             <Columns>
                                                 <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" HeaderStyle-Width="5%">
                                                     <ItemTemplate>
                                                         <asp:CheckBox ID="chk_ItemProperty" runat="server" OnCheckedChanged="chk_ItemProperty_CheckedChanged"
                                                         AutoPostBack="True" />
                                                     </ItemTemplate>
                                                     <HeaderTemplate>
                                                         <asp:CheckBox ID="chk_HeaderProperty" runat="server" OnCheckedChanged="chk_HeaderProperty_CheckedChanged"
                                                         AutoPostBack="True" />
                                                     </HeaderTemplate>
                                                 </telerik:GridTemplateColumn>
                                               <telerik:GridBoundColumn Display="false" DataField="col" DataType="System.Int32" HeaderText="col" FilterControlAltText="Filter column column" UniqueName="col"/>
                                               <telerik:GridBoundColumn DataField="Col1" DataType="System.Decimal" HeaderText="Col1" FilterControlAltText="Filter column column" UniqueName="Col1" HeaderStyle-Width="15%" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"/>
                                               <telerik:GridBoundColumn DataField="Col2" DataType="System.String" HeaderText="Col2" FilterControlAltText="Filter column column" UniqueName="Col2" HeaderStyle-Width="15%" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" />
                                               <telerik:GridBoundColumn DataField="Col3" DataType="System.Int32" HeaderText="Col3" FilterControlAltText="Filter column column" UniqueName="Col3" HeaderStyle-Width="15%"  ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"/>
                                             </Columns>
                                         </MasterTableView>
                                         </telerik:RadGrid>
in cs file
protected void chk_ItemProperty_CheckedChanged(object sender, EventArgs e)
    {
        ((sender as CheckBox).NamingContainer as GridItem).Selected = (sender as CheckBox).Checked;
        bool checkHeader = true;
        foreach (GridDataItem dataItem in grid1.MasterTableView.Items)
        {
            if (!(dataItem.FindControl("chk_ItemProperty") as CheckBox).Checked)
            {
                checkHeader = false;
                break;
            }
        }
        GridHeaderItem headerItem = gv_LeaseProperty1.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
        (headerItem.FindControl("chk_HeaderProperty") as CheckBox).Checked = checkHeader;
    }
 
    protected void chk_HeaderProperty_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox headerCheckBox = (sender as CheckBox);
        foreach (GridDataItem dataItem in grid1.MasterTableView.Items)
        {
            (dataItem.FindControl("chk_ItemProperty") as CheckBox).Checked = headerCheckBox.Checked;
            dataItem.Selected = headerCheckBox.Checked;
        }
    }
its works fine ... but when I change page index then selected state of check box not maintain.
please suggest me how to solve this problem.
Jayesh Goyani
Top achievements
Rank 2
 answered on 30 Jan 2014
3 answers
73 views
I've implemented a custom handler to save uploaded files to a database, and within the Process function I add the ID of the database row into a custom AsyncUploadResult.

How do I get access to that additional property (ID) from the page (server-side) on postback? The property isn't even appearing in the FileUploaded sub after I cast the UploadResult to my custom version. 

My goal is to save files to the database, and upon submission of the completed web form, iterate through the UploadedFiles collection of the AsyncUpload control and get the individual IDs.

Thanks in advance!
Hristo Valyavicharski
Telerik team
 answered on 30 Jan 2014
1 answer
242 views
Hi.
I have a grid which has edit and insert operation performed. During the insert mode for one of the column textbox i want to show a default text. How to do this when grid is in insert mode?
Princy
Top achievements
Rank 2
 answered on 30 Jan 2014
3 answers
90 views
Hello,

I have a fairly difficult situation. Let me start by saying that I am very familiar with the ASP.NET AJAX RadControls, particularly RadTabStrip & RadMultiPage. I have already used these controls successfully in several different scenarios.

Now, for the situation. I have a primary page with a RadTabStrip at the top and a RadMultiPage filling the rest of the page. When the primary page loads, I create all the tabs and their associated PageViews. Each PageView has a ContentURL value assigned. So far so good.

Where it gets tricky is that each ContentURL value is for a page with a Frameset containing 3 iFrames. This allows us to reuse a single Search Results page throughout the site, by loading the Search Results page with a different module (specified by URL parameter) into one of the Frames of each page's Frameset. It's somewhat inefficient, but it works for now and we are in the process of redoing these pages.

The problem doesn't come up immediately. The 1st PageView loads its ContentURL page correctly, so I click a tab to load a 2nd PageView and that one loads correctly too. Clicking the tab associated with the 1st PageView in order to go back works fine as well.

So at this point, I click another tab to load a 3rd PageView's ContentURL page. For this 3rd PageView, 2 of the 3 iFrames in the FrameSet page load their content correctly, but the 3rd iFrame (Search Results page with 3rd PageView's module) does not load. So I click the tab to go back to the 1st PageView, and I see that the iFrame content that did not load (Search Results page with 3rd PageView's module) has been loaded into the corresponding iFrame of the Frameset on this 1st PageView.

This is absolutely bizarre and I am confounded. This method has worked for us for a long time, only we used hyperlinks with an iFrame target instead of a RadTabStrip and an iFrame instead of a RadMultiPage. However, this method did not allow pages to persist when switching between tabs. We are not looking to change the structure of our application--I just need all pages to load correctly, as they are written.

Since each of the pages with a Frameset are essentially copies of each other (just with different sources set for each iFrame), I think that maybe the RadMultiPage is getting mixed up and it's loading one iFrame's content from one page into the iFrame of another page, because both iFrames share the same Control ID & URL, just with different URL parameters (modules) specified. Everything works fine until too many PageViews' content is loaded, and then iFrames' content gets crossed between different Frameset pages.

The simplest solution would be to have the PageViews refresh their content each time they load, rather than having the ViewState persist between clicking other tabs. However, I'd prefer to have the ViewState persist between pages if possible, since if the PageViews refresh each time they load, it's really no better than the current way we are doing it.

Any assistance would be appreciated! Thanks!
Nencho
Telerik team
 answered on 30 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?