Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
567 views
I have two RadComboBoxes on my page that I can not reset.  Below is their definition and the code behind I am using to reset them.  I have two other RadComboboxes on that same page that I CAN reset.  The main difference is that the two I can not reset are "LoadOnDemand".  I've searched the forums and found a few people with the same problems, but I don't see an answer that works yet.

See attached image for example...

Help?

Thanks

Mark

HTML:
<telerik:RadComboBox ID="cboAgencies" runat="server" EmptyMessage="Type to 
Search..."<BR>                                                            
EnableAutomaticLoadOnDemand="true" EnableVirtualScrolling="true" 
ItemsPerRequest="100"<BR>                                                            
AutoPostBack="true" MarkFirstMatch="True" Skin="WebBlue" Width="205px" 
OnSelectedIndexChanged="cboAgencies_SelectedIndexChanged"><BR>                                                            
<WebServiceSettings Method="GetAgencies" Path="Talent.aspx" 
/><BR>                                                        
</telerik:RadComboBox><BR><BR> <telerik:RadComboBox ID="cboAgents" 
runat="server" EmptyMessage="Type to 
Search..."<BR>                                                            
EnableAutomaticLoadOnDemand="true" EnableVirtualScrolling="true" 
ItemsPerRequest="100"<BR>                                                            
MarkFirstMatch="True" Skin="WebBlue" Width="205px" AutoPostBack="true" 
OnSelectedIndexChanged="cboAgents_SelectedIndexChanged"><BR>                                                            
<WebServiceSettings Method="GetAgents" Path="Talent.aspx" 
/><BR>                                                        
</telerik:RadComboBox><BR>

Code Behind(on a Button Click):

 

<P>cboAgencies.Text = null;    //Also tried 
""<BR>cboAgencies.SelectedValue = null;<BR>cboAgencies.ClearSelection();</P>
<P><BR>cboAgents.Text = null;<BR>cboAgents.SelectedValue = 
null;<BR>cboAgents.ClearSelection();</P>
Kalina
Telerik team
 answered on 11 May 2011
1 answer
46 views
Hi,
I've been developing project using the RadDock control and have just noticed, when a user drags a dock, it can be dragged infinitely to the right or to the bottom of the page. I tried it on your demo page and saw the same thing - try it. Go here: http://demos.telerik.com/aspnet-ajax/dock/examples/default/defaultcs.aspx
Pick up one of the docks and drag your mouse out to the right...it just keeps going. Is there a way to stop this, so that it won't allow dragging outside the width or height of the main dock area? 

Thanks
Pero
Telerik team
 answered on 11 May 2011
3 answers
142 views
I was just wondering if there was a way to limit floating RadDocks to within the screen bounds? 
Pero
Telerik team
 answered on 11 May 2011
5 answers
291 views
Hello,

I have a dynamically created raddcok and  in which user control is loaded.

I want to update the user control contents on one of the command item click event. Well how is it possible to refresh the contents (may be page load event of the user control need to be called) ?

Protected Sub RadDock_Command(ByVal sender As Object, ByVal e As DockCommandEventArgs)
      if  e.Command.Name = "doRefresh" Then
            Dim doc2Refresh As String = DirectCast(sender, RadDock).UniqueName
            ' expect to refresh user control loaded within raddock.
           End If
    End Sub


Thanks.
Pero
Telerik team
 answered on 11 May 2011
1 answer
73 views
Why are the hot fixes not done as .msp files - due to local administrative rights policies in place at our organization we're finding it difficult to simply copy/paste the hot fix files over the originall installed files.  If we had a simple .msp file our lives would be made so much simpler.
Erjan Gavalji
Telerik team
 answered on 11 May 2011
1 answer
364 views
Hello,

We are using the following column definition for a button column that should display a DateTime:

<telerik:GridButtonColumn UniqueName="STARTDATE" ButtonType="LinkButton"
       DataTextField="STARTDATE" DataTextFormatString="{0:g}" HeaderText="[START DATE]"
       CommandName="GoToItem" />

The problem is that it is standard in our app to display just the date if the time is "12:00 am", as this usually indicates that the exact time was not entered. Therefore, I need to conditionally use "{0:d}" for my format string instead of "{0:g}" when StartDate.TimeOfDay.Ticks=0.

We have a server-side function with the following format that we usually use for this logic:
public static string GetShortDateTimeString(DateTime? aDateTime)

In the past, we've either called the function in the ItemDataBound event or used a GridTemplateColumn with a LinkButton to call the function:
<telerik:GridTemplateColumn HeaderText="[START DATE]"DataField="STARTDATE" UniqueName="STARTDATE">
    <ItemTemplate>
      <asp:LinkButton ID="lnkSTARTDATE" runat="server"
            Text='<%#GetShortDateTimeString((DateTime?)Eval("STARTDATE"))%>'
            OnCommand="lnkViewGrid_Command" CommandArgument='<%# Eval("OID").ToString() %>'/>
    </ItemTemplate>
     </telerik:GridTemplateColumn>

My question is whether there is something I can do in the GridButtonColumn definition to create this complex formatting logic, or if I have to use one of those two options. I tried using the GridButtonColumn "Text" field but got an error when I tried to load the page:

Databinding expressions are only supported on objects that have a DataBinding event. Telerik.Web.UI.GridButtonColumn does not have a DataBinding event.


--Christina

Marin
Telerik team
 answered on 11 May 2011
1 answer
51 views
I'm starting to manage RadSheduler, and I know how to change the Tooltip of dating.Thanks for your help
Veronica
Telerik team
 answered on 11 May 2011
2 answers
129 views
The MaxTextLength property checks the limit on submit, but I need a way of stopping any characters being entered once the limit has been reached, I'm prepared to take the performance hit.

I can display an alert message once the limit is reached, but how can I stop any more text being entered?

NB: The users can only see the text entry view, the HTML view is hidden, and the character limit is for the text entered, not the html length.

The function I have so far is:-
<script type="text/javascript">
    function OnClientLoad(editor) {
        editor.attachEventHandler("onkeydown", function (e) {
            var content = editor.get_text(); //returns the editor's content as plain text
            var words = 0;
            if (content) {
                var punctRegX = /[!\.?;,:&_\-\-\{\}\[\]\(\)~#'"]/g;
                var contentcontent = content.replace(punctRegX, "");
                var trimRegX = /(^\s+)|(\s+$)/g;
                contentcontent = content.replace(trimRegX, "");
                if (content) {
                    splitRegX = /\s+/;
                    var array = content.split(splitRegX);
                    words = array.length;
                }
            }
            var counter = $get("counter");
              
            var limit =<%  Response.Write(charimit.ToString());%>
            counter.innerHTML = "Words: " + words + " Characters: " + content.length;
            if(content.length > limit)
            {
                alert("Too many characters!");
                 
            }
  
        });
    }
  
</script>

Ideally, after the alert has popped up, the character that had just been entered would be deleted, or at least future entry would be prevented (although any deletions would have to be allowed).

Thanks
AP
Top achievements
Rank 1
Iron
Iron
Veteran
 answered on 11 May 2011
1 answer
96 views
Hello Telerik,

I have a question, in our project we are using Dundas Charts, and we have a requirement that charts we are displaying should be exported to PDF on a button click. I see that telerik provide PDF export option but I was wondering weather it supports Dundas charts if it dose can you please provide some sample or tutorial kind of thing !!!


Thanks,
Education Dynamics
Sebastian
Telerik team
 answered on 11 May 2011
1 answer
236 views
Hello.
I am creating a servercontrol that inherits the radgrid.
I am creating it on "OnLoad"
I want to create a GridDropDownColumn that will be filled by a DataSet.
From what i read i saw i have 3 options :
1) GridDropDownColumn with DataSourceID  ,
 2) DropDownColumn that can "bind" to the gridDataSource ( the gridatasource must have both id and text - and i can only have the id) 
3) Template.
I can't use number 1 and 2. so the only option is template.
I created a class for ItemTemplate, and one for EditItemTemplate.
The problem i have is with the EditItemTemplate

   class DropDownListTemplate : IBindableTemplate<br>
    {<br>
        string dataField = null;<br>
        bool enabled;<br>
        DropDownList ddl = null;<br>
<br>
        public DropDownListTemplate(string dataField, bool enabled)<br>
        {<br>
            this.dataField = dataField;<br>
            this.enabled = enabled;<br>
        }<br>
<br>
        void ITemplate.InstantiateIn(Control container)<br>
        {<br>
            ddl = new DropDownList();<br>
            ddl.Enabled = enabled;<br>
            ddl.DataBinding += ddl_DataBinding;<br>
            container.Controls.Add(ddl);<br>
        }<br>
<br>
        void ddl_DataBinding(object sender, EventArgs e)<br>
        {<br>
            ddl = (DropDownList)sender;<br>
            ddl.ID = dataField;<br>
            GridEditFormItem bidingContainer = ddl.NamingContainer as GridEditFormItem;<br>
            string value =  ((DataRowView)bidingContainer.DataItem)[dataField].ToString();<br>
<br>
            ddl.Items.Add(value);<br>
<br>
        }<br>
  <br>
<br>
        IOrderedDictionary IBindableTemplate.ExtractValues(Control container)<br>
        {<br>
            OrderedDictionary dick = new OrderedDictionary();<br>
            dick.Add(dataField, ddl.SelectedValue.ToString());<br>
            return dick;<br>
        }<br>
    }




I wanted to make it only ITemplate but i got an error saying i need to make it IBindableTemplate.

On ItemDataBound i find the template, get the dropdownlist and bind it to my DataSet.
When i push the "Edit" command it works. The problem appears when i push "Update".

On the "GridTelerik_UpdateCommand" event i need to Extract the new values.
But i get an error at : ((GridEditableItem)e.Item).ExtractValues(newValues);

The error is : "Editor cannot be initialized for column :  <columnName> - where columnName is the uniqueName of the TemplateColumn.

Is there a way i can resolve it. Does it have a problem because i instantiate the column editItemTemplate on Load? In case there is a better solution for this situation please advice me.
Thanks.
Radoslav
Telerik team
 answered on 11 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?