Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
354 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
78 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
102 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
152 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
84 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
836 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
116 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
138 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
1 answer
136 views
I have a RadTreeView and a RadScheduler. When I drag and drop items from the TreeView into the scheduler, i want an appointment inserted. I do not use a datasource for the Scheduler, and what I do here is on the RadTreeView.OnNodeDropping i have the following JavaScript:

 

 

function nodeDropping(sender, eventArgs) {

 

 

 

var node = eventArgs.get_sourceNode();

 

 

 

var args = node.get_value();

 

 

__doPostBack(

 

'ctl00$ContentPlaceHolder1$upTest', args);
}

Then in the page load, I catch these arguments and insert an appointment.
My problem is: how to get the date and time of the Scheduler? Meaning the spot I dropped my item on. I have searched the documentation, but I can not find a list of the functions like get_sourceNode() etc that I can use. I can use

 

eventArgs.get_htmlElement() to get a referance to the element where I dropped the item (the Scheduler), but how to get the exact position I dropped it into?

Plamen
Telerik team
 answered on 10 Oct 2011
3 answers
114 views
Hi. I am about to start using the scheduler. I have a rather complex situation and need to provide a lot of control and functionality from code behind.

I may have missed some capability but it would be useful (as a suggestion for future consideration) to have a "read only" property for appointments. I realise that there is a property for the scheduler but I have a situation where the user can view not only their appointments but also other users' appointments. I could easily set "read only" in the data source (table.userId == myId) but unless I've missed something don't see any capability that supports this.

My application is a little complex. I cannot therefore predefine a simple datasource and the code behind will have to create and bind the datasource (which I can easily do). However, that means (again unless I've missed some trick or capability) that the scheduler will not have queries for insert, delete and update. Can anyone provide a link to a simple tutorial/example of how to control these events in code behind.

In my application delete, insert and update are also complicated by the functionality being dependant on the data itself (ie whether the related appointment is the user's appointment or someone else's). Thus my code behind has to really control the whole process and probably the easiest thing is to display custom templates or user controls for the job. Again any link to simple examples would be appreciated and also just confirmation of how to override or cancel the default scheduler behaviour would be appreciated.

Thanks

PS in the documentation about the appointment class I noticed some information about "categories". If anyone can provide a link for further information about how to use them I'd appreciate it.
Plamen
Telerik team
 answered on 10 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?