Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
163 views
How do I go about making the tabstrip's selected tab rotate?

For example, every 3 seconds the selected tab would change from the 1st, to 2nd, 3 seconds later, from 2nd to 3rd, and 3 seconds later, back to the 1st. 

I hope I didn't overlook anything in the forums or documentation, but I didn't see anything like this

<telerik:RadTabStrip
            ID="RadTabStrip1" runat="server"
    MultiPageID="RadMultiPage1" SelectedIndex="0" BackColor="#FBFCDD"
            CssClass="RadTabStrip_Default" EnableEmbeddedSkins="False" >
    <Tabs>
        <telerik:RadTab runat="server" Text="News" CssClass="rtsLink" SelectedCssClass="rtsSelected" Selected="True">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Sports" CssClass="rtsLink" SelectedCssClass="rtsSelected">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Weather" CssClass="rtsLink" SelectedCssClass="rtsSelected">
        </telerik:RadTab>
        <telerik:RadTab runat="server" Text="Publications & Photo Galleries" CssClass="rtsLink"  SelectedCssClass="rtsSelected">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
 <telerik:RadMultiPage ID="RadMultiPage1" Runat="server" SelectedIndex="0">
    <telerik:RadPageView ID="RadPageView1" runat="server"><uc3:News_Latest ID="News_Latest1" runat="server" NewsTag="General" ShowTop="5" /></telerik:RadPageView>
    <telerik:RadPageView ID="RadPageView2" runat="server"><uc3:News_Latest ID="News_Latest2" runat="server" NewsTag="Sports" ShowTop="5" /></telerik:RadPageView>
    <telerik:RadPageView ID="RadPageView3" runat="server"><asp:Literal
            ID="ltWeather" runat="server"></asp:Literal>
        <br /></telerik:RadPageView>
    <telerik:RadPageView ID="RadPageView4" runat="server"><asp:Literal
            ID="ltPhotos" runat="server"></asp:Literal></telerik:RadPageView>
</telerik:RadMultiPage>
.
DTech
Top achievements
Rank 1
 answered on 08 Aug 2012
11 answers
240 views
Hello all,

I have a scenario that I'm hoping will be relatively painless for those who are better versed in radgrid than I am.  I have a grid which I'm using to record component replacement serial numbers but in this scenario it is up to the user to determine if the component will be replaced or not meaning some of the serial numbers change while others do not.  I would like the grid to come up with the old serial numbers (as shown in the attached picture) and empty fields for all of the new serial # column (the last column).  If the user determines that a part is being kept then they'll click the "keeping" checkbox which will copy the old serial to the new serial field and disable the new serial field so it cannot be edited.  When they're all done they'll click a submit button which will then submit the data to be saved.  My problem is that I have no idea how to get just the last column with text entry fields that are editable as soon as the grid loads.  The same goes for the checkboxes.  I followed the article about putting all items in edit mode during pre-render but it only seems to work on the last row, not all of the rows.  I'm at a loss.  Any help guiding me in the right direction would be very much appreciated!

FYI - this site is currently using RadControls 2010 Q3 but we're considering upgrading it to 2012 Q2.  It's more of a cost/benefit question right now but if it'll help make this process any easier then the upgrade to 2012 Q2 will definitely be approved.

Regards,
Tim
Shinu
Top achievements
Rank 2
 answered on 08 Aug 2012
0 answers
98 views
How can i load .aspx page in below code instead of usercontrol page

< protected void Page_Load(object sender, System.EventArgs e)
            {
                if (!Page.IsPostBack)
                {
                    AddTab("Orders");
                    AddPageView(RadTabStrip1.FindTabByText("Orders"));
                    AddTab("Products");

                   
                }
            }

       private void AddTab(string tabName)
       {
           RadTab tab = new RadTab();
           tab.Text = tabName;
           RadTabStrip1.Tabs.Add(tab);
       }

       

       protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
       {
           string userControlName = e.PageView.ID + ".ascx";

           Control userControl = Page.LoadControl(userControlName);
           userControl.ID = e.PageView.ID + "_userControl";

           e.PageView.Controls.Add(userControl);
       }

            private void AddPageView(RadTab tab)
            {
                RadPageView pageView = new RadPageView();
                pageView.ID = tab.Text;
                RadMultiPage1.PageViews.Add(pageView);
                pageView.CssClass = "pageView";
                tab.PageViewID = pageView.ID;
            }

            

            protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
            {
                AddPageView(e.Tab);
                e.Tab.PageView.Selected = true;
            }>
Atif
Top achievements
Rank 1
 asked on 08 Aug 2012
3 answers
314 views
I need to hide control called dtParticipationEndDate only on add mode. How i can achive?


<telerik:RadGrid ID="rdParticipationList" runat="server" OnNeedDataSource="ParticipationGrid_NeedDataSource" 
                                    OnItemDataBound="ParticipationGrid_ItemDataBound" OnItemCommand="ParticipationGrid_ItemCommand"
                                    AllowPaging="true" AllowSorting="true" Width="930px" OnInsertCommand="ParticipationGrid_ItemInserted"
                                    OnEditCommand="ParticipationGrid_EditCommand" OnUpdateCommand="ParticipationGrid_ItemUpdated">
                                    <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="false" DataKeyNames="ParticipationID"
                                        EditMode="InPlace" InsertItemPageIndexAction="ShowItemOnCurrentPage">
                                        <CommandItemTemplate>
                                            <asp:LinkButton ID="add" runat="server" Text="Add New Record" CommandName="InitInsert"></asp:LinkButton>
                                            <asp:LinkButton ID="save" runat="server" Text="Add new Record" CommandName="PerformInsert" Visible="false"></asp:LinkButton>
                                        </CommandItemTemplate>
                                        <Columns>
                                            
                                            <telerik:GridTemplateColumn HeaderText="Participant" ItemStyle-Width="240px" UniqueName="Participant">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "FullName")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                   
                                                     <telerik:RadComboBox ID="ddlStudentList" runat="server" DataSourceID="dsFullName" DataTextField="StudentName" DataValueField="EnrolmentID" 
                                                     SelectedValue = '<%# Eval("EnrolmentID") %>'>  
                                                        <Items>
                                                            <telerik:RadComboBoxItem Value="0" Text="-- Select a Value --" />
                                                        </Items>
                                                    </telerik:RadComboBox>
                                                   
                                                    <asp:RequiredFieldValidator ID="vStudentList" runat="server" ErrorMessage="*"
                                                        ControlToValidate="ddlStudentList"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                         
                                  
                                            <telerik:GridTemplateColumn HeaderText="Start Date" UniqueName="StartDate" HeaderStyle-Width="10%" DataType="System.DateTime">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "ParticipationStart","{0:dd MMMM yyyy}")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadDatePicker ID="dtParticipationStartDate" runat="server" Skin="Office2007" DateInput-DateFormat="dd MMM yyyy" DbSelectedDate='<%# Eval("ParticipationStart") %>'
                                                        DateInput-Width="20px" DateInput-CssClass="controlText" DateInput-Enabled="true"
                                                        Calendar-ShowRowHeaders="false" AutoPostBack="true">
                                                    </telerik:RadDatePicker>
                                                   <asp:RequiredFieldValidator ID="vDateStart" runat="server" ErrorMessage="*"
                                                        ControlToValidate="dtParticipationStartDate"></asp:RequiredFieldValidator>
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>


                                            <telerik:GridTemplateColumn HeaderText="End Date" UniqueName="EndDate" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "ParticipationEnd", "{0:dd MMMM yyyy}")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                    <telerik:RadDatePicker ID="dtParticipationEndDate" runat="server" Skin="Office2007" DateInput-DateFormat="dd MMM yyyy" DbSelectedDate='<%# Eval("ParticipationEnd") %>'
                                                        DateInput-Width="20px" DateInput-CssClass="controlText" DateInput-Enabled="true"
                                                        Calendar-ShowRowHeaders="false" AutoPostBack="true">
                                                    </telerik:RadDatePicker>
                                                  
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>


                                            <telerik:GridTemplateColumn HeaderText="Reason For Leaving" ItemStyle-Width="240px" UniqueName="ReasonForLeaving" DataType="System.DateTime">
                                                <ItemTemplate>
                                                    <%#DataBinder.Eval(Container.DataItem, "ReasonForLeaving")%>
                                                </ItemTemplate>
                                                <EditItemTemplate>
                                                     <telerik:RadComboBox ID="ddlReasonLeaving" runat="server" DataSourceID="odsReasonForLeaving" DataTextField="ReasonForLeaving" DataValueField="ReasonForLeavingID" 
                                                     SelectedValue = '<%# Eval("ReasonForLeavingID") %>'>  
                                                        <Items>
                                                            <telerik:RadComboBoxItem Value="0" Text="-- Select a Value --" />
                                                        </Items>
                                                    </telerik:RadComboBox>
                                                   
                                                </EditItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn DataField="ParticipationNotes" HeaderText="Notes" HeaderStyle-Width="30%" UniqueName="Note" Visible="false" />
                                  
                                           <telerik:GridEditCommandColumn UniqueName="EditColumn" ButtonType="LinkButton"></telerik:GridEditCommandColumn>
                                        </Columns>
                                    </MasterTableView>
                                </telerik:RadGrid>
Mark de Torres
Top achievements
Rank 1
 answered on 08 Aug 2012
2 answers
162 views
Dear Telerik support team,

In the "Grid / Form Template Edit Form" example on this website, in Default.CS.aspx.cs class, there's a code block which runs when the user updates a record as shown below.



protected void RadGrid1_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
{
if (e.Exception != null)
{
e.KeepInEditMode = true;
e.ExceptionHandled = true;
DisplayMessage(true, "Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " cannot be updated. Reason: " + e.Exception.Message);
}
else
{
DisplayMessage(false, "Employee " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"] + " updated");
}
}



The code above displays the notification message "Employee 3 updated"
If I want this notification message to display a message like "Employee Robert King updated"  how do I accomplish this?

I tried to use the code shown below but I don't think the code works correctly because the variable IDNumber gets the value from the field EmployeeID rather than the RadGrid's ItemIndex which starts from 0.

int IDNumber = (int)e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["EmployeeID"];

string EmployeeName = RadGrid1.MasterTableView.Items[IDNumber]["FirstName"].Text;

DisplayMessage(false, "Employee " + EmployeeName + " updated")

 

Many thanks,

ILJIMAE
Top achievements
Rank 1
 answered on 08 Aug 2012
0 answers
126 views
I have a grid that I am trying to add a column to.  Everything works except I need to be able to call a Javascript method, which also works, and pass a value to it, which does not work.  Here is my code:



                columns.Template(x =>
                { %>
                    <% if (SiteContext.Session.IsAdmin) {%>
                       <a href="javascript:void(0);" onclick= "DeleteDisposition('" + id +'");">Delete</a>  
                    <% } %>
                <%
                }).Title("Delete")
                .Width(80)
                .Visible(SiteContext.Session.IsAdmin);

Can someone tell me what I am doing wrong here?  I cannot figure this out.  Thanks...
Greg
Top achievements
Rank 1
 asked on 07 Aug 2012
1 answer
156 views
The client-side function get_textBoxValue(); of radtextbox will return the value of EmptyMessage if the textbox is left empty. Seems like this used to not be the case. I can lo longer determine if the textbox has an empty value on the client-side. Please help.
Psichi
Top achievements
Rank 1
 answered on 07 Aug 2012
1 answer
355 views
When exporting the radgrid using Biff Excel format, the resulting excel file has columns that are far too wide for the data they contain. I am confused because the Biff export demo seems to work just fine. The only major difference between my grid and the grid used in the demo is that I am not auto-generating my columns. Here is an example definition of one of my columns:

<telerik:GridBoundColumn DataField="FirstName" UniqueName="FirstName" HeaderText="First Name"
                    AutoPostBackOnFilter="True" ShowFilterIcon="False" FilterControlWidth="60px">
                    <ItemStyle Width="80px"/>
                    <HeaderStyle Width="80px"/>
</telerik:GridBoundColumn>

I have attached a screenshot of the resulting excel file's extremely wide columns.

Am I doing something wrong? Should I not be setting the ItemStyle and HeaderStyle in this manner? Is there a way for me to fix the column widths on export? The BiffExporting event did not seem to have a means of doing so.
Kyle Smith
Top achievements
Rank 1
 answered on 07 Aug 2012
6 answers
413 views
i have a grid with a checkbox on each row for users to select records for deletion.

however clicking on the row enables the user to edit that record.

checking or deselecting the checkbox is firing the rowclick and showing the edit popup, how do i prevent this happening ?

i dont want this rowclick to fire when the checkbox is ticked or unticked....
Mark
Top achievements
Rank 1
 answered on 07 Aug 2012
2 answers
291 views
I am currently in the eval stage and my company will most likely purchase the product in the near future.

I have two questions and hoping for quick answers thinking someone must have done similar things.

1. I have a tree view in one pane and some fields in the second pane that are related to the selected item in the treeview. Each node click refreshes the field values in the second pane. Clicking on each node causes a partial post back so it can refresh the fields in the second pane - this is expected. However, it doesn't retain the focus and therefore no longer allows arrow-key navigation until focus is manually moved to it.

2. When navigating by the arrow key, I have to hit Enter to actually select the node and to fire the server side click event. Is it possible to select the node and fire the even on just the up-down keys instead of having to hit Enter to select a node?


Thank you so much in advance
Plamen
Telerik team
 answered on 07 Aug 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?