Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
150 views
I have a tabstrip on my page with a handful of tabs...
<rad:RadTabStrip ID="radDetailsTabs" CssClass="radDetailsTabs" runat="server" MultiPageID="radmultipage"
                    BorderWidth="0" OnClientTabSelected="" Skin="Vista" Style="padding: 0; margin: 0;">
                    <Tabs>
                        <rad:RadTab Text="Details" Selected="true" Width="95px">
                        </rad:RadTab>
                        <rad:RadTab Text="Specifications" Width="95px">
                        </rad:RadTab>
                        <rad:RadTab Text="Reviews" Width="95px">
                        </rad:RadTab>
                        <rad:RadTab Text="How To" Width="95px">
                        </rad:RadTab>
                        <rad:RadTab Text="Custom" Width="95px">
                        </rad:RadTab>
                    </Tabs>
                </rad:RadTabStrip>

Then I have some JS that runs on pageload that will remove one of the tabs if its not needed...
function pageLoad() {      
        if (document.getElementById('ctl00_ContentPlaceHolder1_hidShowHowToTab').value == "0") {
            hideTab("How To");
        }
}
function hideTab(strTabName) {
        var tabStrip = $find('ctl00_ContentPlaceHolder1_radDetailsTabs');
        var tab = tabStrip.findTabByText(strTabName);
        if (tab) {
           var parentTab = tab.get_parent();
           tabStrip.trackChanges();
           parentTab.get_tabs().remove(tab);
           tabStrip.commitChanges();
         }
    }

This worked great, until I added the new Custom tab. Now when I click on Custom tab, it shows the content of the How To tab instead. You can see from the attached that the how to tab is set to display block and the clientstate selected index is set to 3 instead of 4. the custom tab is show correctly as selected, but the content revealed is incorrect. Am I missing something?
Nik
Top achievements
Rank 1
 answered on 10 Oct 2011
9 answers
218 views
Hi there, I made a post on Adjusting Telerik RadTreeList to display visually separated items with depth level margins maybe someone will find it usefull :)

Attachment shows the main idea

P.S.: I always wanted to have that feature built it :)

Colin
Top achievements
Rank 1
 answered on 10 Oct 2011
2 answers
347 views
Greetings,

I have a buttonColumn in each row. I'd like to get the ID of the row when i click on it since i need it to make a query afterwards...

I tried to do it intuitively with e.Item.ClientID but it's not working
Thank you in advance
Adigard
Top achievements
Rank 1
 answered on 10 Oct 2011
1 answer
69 views
Hi,

I am facing the following problem in safari 5.

1. I have a button which is disabled in design mode
2. I am enabling this button via javascript.
3. Though the button gets enabled, the button looks like it is still disabled

The style used is Office 2007 and the version of telerik used is 2009 or 2010 [not sure].

Regards,
Shashank


 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<head runat="server">
    <title></title>
  
    <script type="text/javascript">
        function EnableButton() {
  
            var btn = document.getElementById("btnTarget");
            btn.disabled = false;
        }
        
    </script>
  
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadFormDecorator Skin="Office2007" ID="RadFormDecorator1" DecoratedControls="all"
            runat="server" DecorationZoneID="zoneButtons" />
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <div id="zoneButtons">
                    <asp:Button ID="btnTarget" Text="Target" runat="server" Enabled="false" />
                    <asp:Button runat="server" ID="btnSource" Text="Click to enable 'Target'" Enabled="true"
                        OnClientClick="EnableButton();return false;" />
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>

 

 

 

 

Niko
Telerik team
 answered on 10 Oct 2011
2 answers
93 views
I have a EditItemTemplate column with dropdownlist in der...i want to access dropdown list in the code behind but enable access it

Code snipshot

ASPX:
<
telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="false" AllowAutomaticInserts="True"

AllowSorting="true" AllowAutomaticUpdates="True" AllowPaging="false"

AutoGenerateColumns="False" DataSourceID="ObjectDataSource1" ShowStatusBar="true"

Width="950px" OnItemDataBound= "rgQueue2_OnItemDataBound">

<MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataSourceID="ObjectDataSource1"

HorizontalAlign="NotSet" AllowSorting="false" EditMode="InPlace">

<Columns>

<telerik:GridTemplateColumn HeaderText="Source" DataField="SourceName" UniqueName="Source"

 HeaderStyle-Width="250px" ItemStyle-HorizontalAlign="Left">

<ItemTemplate>

<asp:Label ID="lblsource" runat="server"> <%# DataBinder.Eval(Container.DataItem, "SourceName")%> </asp:Label>

</ItemTemplate>

<EditItemTemplate>

<asp:DropDownList ID="ddlsource" runat="server">

</asp:DropDownList>

</EditItemTemplate>

</telerik:GridTemplateColumn>

ASPX.CS:

protected void rgQueue2_OnItemDataBound(object sender, GridItemEventArgs e)

if ((e.Item is GridEditableItem) && e.Item.IsInEditMode)

GridEditableItem item = e.Item as GridEditableItem;
DropDownList list = item.FindControl("ddlsource") as DropDownList;

 

}

}


Problem is its not entering the if statement even...can anyone suggested me to get through it..!!!
Thanks

Nani
Top achievements
Rank 1
 answered on 10 Oct 2011
1 answer
147 views
Hi,
is there any way to limit floating of the RadDock to a specific web element like div etc?
My requirement is if I have a RadDock with Floating DockMode and but I want to limit the Floating mode only to a specific DIV, i.e. the RadDock should only be moved inside a specific DIV.

thanks in advance for any help!!
Slav
Telerik team
 answered on 10 Oct 2011
1 answer
77 views
I think I've found a bug with the PageSize property in the TreeList control.  I'm setting the PageSize property in the HTML markup using a static property in code behind called "GlobalPageSize" like this:

PageSize='<%# GlobalPageSize %>'

GlobalPageSize is a property in my code that reads a value from a cookie.  If no cookie is found, it returns a default value of 15.  When I set the PageSize property like this, the paging doesn't work.  For example, if I try to go to page 2, it will refresh and still be on page 1.  If I try and change the page size using the dropdown, it refreshes and it still has the original value selected.

If I set the PageSize property to a hard coded value like this:

PageSize='15'

the paging works.  It also works if I set the PageSize property in PageLoad event in code behind.  So, after all my testing, it looks like the bug has to do with setting the PageSize property in markup using a value retrieved from code.  Any thoughts?
Veli
Telerik team
 answered on 10 Oct 2011
7 answers
803 views
Hi.

I am using RadDatePicker in connection with asp:RequiredFieldValidator and I encountered some strange behaviour.
This is my aspx file:
<telerik:RadDatePicker ID="dpVeljaOd" AutoPostBack="false" CausesValidation="false" runat="server">
   <DateInput CausesValidation="false" runat="server"></DateInput>
   <DatePopupButton Enabled="true" runat="server" />
 </telerik:RadDatePicker>
 <asp:RequiredFieldValidator ID="valrqVeljaOd" CssClass="errorText" ErrorMessage="Obvezno polje" ControlToValidate="dpVeljaOd" Enabled="true" runat="server"></asp:RequiredFieldValidator>

The strange behaviour:
If you type or select a valid date, delete it and move away from input field (i.e. click in some other field), then validation is triggered. Validator is static and not dynamic, it is executed on server side and there is no postback detected (postback is disabled anyway).
Validation is not triggered, if you have entered and later deleted invalid date. It is also not triggered, if you haven't enter a date at all.
Same thing happens in Telerik validation demo .

How can I get rid of this annoying behaviour?
Vasil
Telerik team
 answered on 10 Oct 2011
1 answer
107 views
Hello all,

     I have a grid in which i have few template columns. I would like to set the 2 grid template columns visibility based on the Internet connection.

Here are the controls in the template column.

  <telerik:GridTemplateColumn HeaderText="Time" UniqueName="Time" Visible = "true">
                                                              <ItemTemplate>

 <telerik:RadMaskedTextBox ID="txtTime" runat="server" PromptChar="_" Width="80px" Mask="<0..2><0..9>:<0..5><0..9>">
                            </telerik:RadMaskedTextBox>
                 </ItemTemplate>
                                <ItemStyle Wrap="False" />
                            </telerik:GridTemplateColumn>
                           
                            <telerik:GridTemplateColumn HeaderText="Odometer" UniqueName="Odometer" Visible = "true">
                                <EditItemTemplate>
                                   <asp:TextBox ID="txtOdometer"  runat="server" ToolTip="Odometer" Text='<%# Eval("Odometer") %>' Width="120px"
                                        onkeydown="return CheckKeyCode()" onfocus="this.value = this.value;" >
                                    </asp:TextBox>
                                    <asp:RegularExpressionValidator Display="Dynamic" ID="regOdometer" runat="server"
                                        ErrorMessage="Only Numbers are allowed." ControlToValidate="txtOdometer" ValidationExpression="\d+\.?\d*" /></EditItemTemplate>
                                <ItemTemplate>
                                 <asp:TextBox ID="txtOdom"  runat="server" ToolTip="Odometer" Text='<%# Eval("Odometer") %>' Width="80px"
                                        onkeydown="return CheckKeyCode()" onfocus="this.value = this.value;" >
                                    </asp:TextBox>
                                </ItemTemplate>
                                <ItemStyle Wrap="False" />
                            </telerik:GridTemplateColumn>

1) I have to set those columns visibilty based on the internet check.. How do i do this?

I am trying something like this..

function hideColumn()
{
    var grid = $find("<%=RadGrid1.ClientID %>");
    var MasterTable = grid.get_masterTableView();
     var rows = MasterTable.get_dataItems();
    var cell = MasterTable.getCellByColumnUniqueName(rows, "Time");
for(i=0;i <rows.length-1;i++)
{
 rows[i].cells[cell].style.display="none";
}
}

2) How do i access a column?
3) Where should i call this hidefunction in the below script.

$(document).ready(function() {
        $("form").submit(function(e) {
            var r = $.ajax({ "url": 'http://www.xxxxxxxxx.com/xxxxx', "async":false }).responseText;
           
            if( r==null ) e.preventDefault();
        })
    })


  if r is async then  i am removing the postback. and  probably at that time i have to call the hidefunction.
How do i do this?
 

Appreciate the help

Thanks
Iana Tsolova
Telerik team
 answered on 10 Oct 2011
1 answer
125 views
Hi all,

I'm implementing a user control which uses a radtreeview as filter, I need to have access to the checkbox element of each radtreenode in order to attach an onclick=Function(param1,param2..). The "OnClientNodeChecked" event does not work for me because the user control has several other controls inside, which makes obtaining clientId's a bit tricky...I tried making a template with the checkboxes for the radTreeView, but that makes useless a lot of the javascript that handles checkbox behavior (like the get_checked()).

A bit like going through a client select column in a grid...and doing something with the check...

Thanks in advance.
Plamen
Telerik team
 answered on 10 Oct 2011
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?