Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
72 views
Hello All,
In my codebehind I set the sqldatasource controls filterExpression based on selecting items.

So when the page load I use the sqldatasource and bring back all records, when the user selects "sold Items" I use the sqldatasources FilterExpression to bring back just the "Sold Items" this works just fine, but when I page to the next page all my record show and not just the "Sold Items".

So each time they select an item, I add a diffent filter to the sqldatasource and then I set teh grids DataSourceID to my sqldatasource control then do a grid DataBind();

Like I said it works fine, except when I page to the next page, it's like the filter is removed and is gets everything as if there was no filter, but it should have not gotten everything in the first place because of the filter on the sqldatasource.

How can I fix this,
Thanks,
KS.
Pavlina
Telerik team
 answered on 08 Apr 2011
1 answer
100 views
Hi,

We are currently using a RadListbox in our software as follow:

<telerik:RadListBox ID="MyListBox" runat="server" OnItemDataBound="BindMyItems" EnableDragAndDrop="false" AutoPostBackOnReorder="true" 
AllowReorder="true" OnReordering="ReOrderMyItems" ViewStateMode="Disabled">
<ItemTemplate>
<telerik:RadTextBox ID="MyTextBox" runat="server" />
</ItemTemplate>
</telerik:RadListbox>


My challenge is, when the RadTextBox has got focus and we press shit+ctrl+ <- (back arrow) for selecting the text in the RadTextBox the RadTextBox are removed from the RadListBox. We have a client KeyPress event on the RadTextBox that is added in the codebehind. When this combination of keys are pressed the KeyPress event is triggered, but I get the ctrl key and then the shift key and that is it. It seems like I am not able to catch the combination of the keypress and therefore I am struggling a bit preventing the RadTextBox from being removed

This is how I add the KeyPress event in the codebehing, I am adding it in the BindMyItems(); For IE I am using onkeydown and other browsers I am using onkeypress.
Code behind adding of attribute : MyTextBox.Attributes.Add(lBrowser.Browser == "IE" ? "onkeydown" : "onkeypress", "return MyKeyPressEvent(this, event)");


My Question is, is there a way of catching this keypress combination to prevent this from happening?

Kind Regards,
David.
Helen
Telerik team
 answered on 08 Apr 2011
1 answer
101 views
Hi,

We are using version 2010.2.826.35 of the ASP.NET for AJAX components.

Q.  I want to be able to create a custom attribute key / value on each TimeSlot in server side code, and then access that custom attribute in javascript when the time slot is clicked.  If it matters, my Scheduler will only be displayed in Monthly View.

On the server I have:
Private Sub DployRadScheduler_TimeSlotCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.TimeSlotCreatedEventArgs) Handles DployRadScheduler.TimeSlotCreated
  
    e.TimeSlot.Control.Attributes.Add("divName", "week1")
  
End Sub

I don't know how to retrieve that Attribute in javascript when the user clicks on the timeslot.  I already have the javascript function in place to handle the OnClientTimeSlotClick event, but I can't seem to get the object that contains the attribute.

Any ideas?  Or is there another way to do this?  Basically, in Month View, I just want to know what week they clicked in, within the current Scheduler (where the Scheculer is always displaying 5 weeks...).

By the way, I do see that my Attribute and Value are getting written into the source of the HTML, but I obviously don't want to try to navigate through the DOM to find the one that corresponds to the timeslot I clicked.

Thanks In Advance.

 

Peter
Telerik team
 answered on 08 Apr 2011
1 answer
97 views
Hello All,

I am making use of Telerik's RadSiteMap control to display the hyperlinks of all the pages residing in my site. I have a requirement wherein I have to use the 'rel="nofollow"' attribute of the anchor tag for some of the hyperlinks (but not for all of them).

Is it possible to control this using the ".sitemap" file itself. Otherwise is there any javascript workaround to add this attribute? I went through the html source of my aspx page once the page was rendered in my browser. There was no unique identifier for any of the hyperlinks. Any insights on how I could achieve this?

Regards,
Raghuraman.V
Dimitar Terziev
Telerik team
 answered on 08 Apr 2011
3 answers
123 views

I have a rad grid in my page with template columns

On applying filter it gives  

<>"Specified argument was out of the range of valid values.
Parameter name : Index" error.


Can any one suggest me the cause and what can i do to rectify the same

Iana Tsolova
Telerik team
 answered on 08 Apr 2011
3 answers
83 views
I have control as part of a master page where I have added a RadAjaxPanel to the toolbar (TopNavigationControl.ascx.cs) as follows:

<telerik:RadAjaxPanel ID="panelAjaxPersonShortcut" runat="server" EnableAJAX="True"><br><div id="topNavigationControl-contentDiv"><br>    <div id="textSize"><br>        <asp:LinkButton ToolTip="Sign out" CausesValidation="false" ID="signOut" runat="server"<br>            OnClick="signOut_Click">Sign Out</asp:LinkButton><br>    </div><br>    <asp:LinkButton ToolTip="Home" CausesValidation="false" ID="home" runat="server"<br>        OnClick="home_Click">Home</asp:LinkButton><br>    <asp:LinkButton ToolTip="Help" CausesValidation="false" ID="help" runat="server"<br>        OnClick="help_Click">Help</asp:LinkButton><br>    <ps:PersonShortcut ID="ucPersonShortcut " runat="server" />        <br></div><br></telerik:RadAjaxPanel>

The control ucPersonShortcut was added late in the project and was ajax-ified to prevent postback problems with existing pages when the user clicks buttons on this shortcut that stay on the same page.  My problem is that existing pages that contain other Telerik controls seems to be adversely affected  e.g. a telerik RadDatePicker no longer shows the calendar when the popup button is clicked...

   <telerik:RadDatePicker ID="DateBirthDate" runat="server" CssClass="input" MinDate="1850-01-01"><br>                        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x"><br>                        </Calendar><br>                        <DatePopupButton HoverImageUrl="" ImageUrl="" /><br>                        <DateInput DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy" CssClass="input"><br>                        </DateInput><br>                        <ClientEvents OnPopupOpening="PopupOpening" OnPopupClosing="PopupClosing" /><br>                    </telerik:RadDatePicker>

Interestingly, the page where this calendar resides is in a user control 'ucManagePerson' and this page has a RadAjaxManagerProxy on it..not sure if this has anything to do with it.

<asp:Content id="cntMain" contentplaceholderid="mainContent" runat="server"><br>    <asp:Label runat="server" id="CaptionNumberPersons" class="caption"/><br>    <telerik:RadAjaxManagerProxy ID="ajaxManagerProxy" runat="server"><br>        <AjaxSettings><br>            <telerik:AjaxSetting AjaxControlID="ucViewPersons"><br>                <UpdatedControls><br>                    <telerik:AjaxUpdatedControl ControlID="ucManagePerson" /><br>                </UpdatedControls><br>            </telerik:AjaxSetting><br>        </AjaxSettings><br>    </telerik:RadAjaxManagerProxy><br>        <br>        <vp:ViewPersons ID="ucViewPersons" runat="server" /><br>        <mp:ManagePerson ID="ucManagePerson" runat="server" /><br></asp:Content><br>


Basically if I take the RadAjaxPanel off the person shortcut the calendar works, I put it back on, it does not pop up. Any ideas??

Retards
Colin
Maria Ilieva
Telerik team
 answered on 08 Apr 2011
1 answer
130 views
I have a column in a RadGrid that has a customised Filter control. Rather than the standard text box, I have used the column's FilterTemplate to display a RadCombo list containing possible filter values. I have a couple of questions relating to this scenario.

In addition to the list, I would like to show the standard list of filter operators that normally appears next to the text box in filter controls. Does a control exist to implement this feature? How is it configured?

When the user selects a value from the list, in code-behind the filter is applied and the grid is rebound. As a result, the combo is repopulated and its SelectedValue property is initialised to null. However, I want the SelectedValue property to be set to the value the user has just selected, so that selecting all other items in the list produces the appropriate re-filtering action. How can I do that?

Suggestions welcome, thanks in advance!


                <telerik:GridBoundColumn DataField="CaseStatus" FilterControlAltText="Filter status column"
                    HeaderText="Case Status" UniqueName="Status">
                    <FilterTemplate>
                        <telerik:RadComboBox runat="server" ID="ddlStatus" AutoPostBack="true"
                                      OnSelectedIndexChanged="ddlStatus_SelectedIndexChanged">
                        </telerik:RadComboBox>
                    </FilterTemplate>
                </telerik:GridBoundColumn>


        protected void ddlStatus_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            string filterExpression = string.Format("CaseStatus = {0}", (byte)Enum.Parse(typeof(CaseStatus), e.Value));
            rgResults.MasterTableView.FilterExpression = filterExpression;
            rgResults.MasterTableView.Rebind();
        }
Mira
Telerik team
 answered on 08 Apr 2011
9 answers
333 views
Our IT department deployed a new desktop image.  Previously the Telerik controls loaded flawlessly.  Now I have a problem.  I have gone as far as re-imaging the machine, so it must be something on this particular image that is causing the telerik controls to not load, but I need your help to identify the problem.

Attempt: I load Visual Studio 2010 and attempt to load the Telerik tools.  Result: It says I need Visual Studio loaded that is 2005 or greater.  I did that and it doesn't recognize that its loaded.

Attempt: I load Visual Studio 2008 and attempt to load the Telerik tools.  Result:  Same result.  It doesn't recognize that its loaded.

Attempt: I load Visual Studio 2005 and attempt to load the Telerik tools.  Result:  The telerik tools load, however Visual Studio 2008 or Visual Studio 2010 do not recognize that they are loaded. 

I have a log file of the install for you to take a look at, however you do not provide a way for me to upload this to this forum.

Any thoughts ?

Drew
Teodor
Telerik team
 answered on 08 Apr 2011
1 answer
183 views
I am needing that depending on a condition verified in the code behind, I update certain controls by ajax. I researched some ways and I believe that would solve, is to add AJAX settings dynamically. But still could not solve the problem.

I have based on this example http://demos.telerik.com/aspnet-ajax/ajax/examples/manager/dynamicajaxsettings/defaultcs.aspx

An example to demonstrate the problems that can not solve, basically a ComboBox that selects which of the divs should be updated:

<telerik:RadScriptManager ID="telerik_ajax_manager" runat="server" OutputCompression="Forced" />
<telerik:RadAjaxLoadingPanel ID="ajax_Loaging_Panel" Enabled="true" runat="server" MinDisplayTime="1000" BackColor="#cccccc" Transparency="50" />
 
<div id="div_1" runat="server">
    <asp:Label ID="lbl_1" runat="server" Text="Div 1"></asp:Label>
    <br />
    Update:
    <telerik:RadComboBox ID="cbx_update" runat="server">
        <Items>
            <telerik:RadComboBoxItem Value="div_2" Text="Div 2" />
            <telerik:RadComboBoxItem Value="div_3" Text="Div 3" />
        </Items>
    </telerik:RadComboBox>
</div>
<br />
<div id="div_2" runat="server">
    <asp:Label ID="lbl_2" runat="server" Text="Div 2"></asp:Label>
</div>
<br />
<div id="div_3" runat="server">
    <asp:Label ID="lbl_3" runat="server" Text="Div 3"></asp:Label>
</div>
<br />
<telerik:RadButton ID="btn_submit" runat="server" onclick="btn_submit_Click" Text="Submit"></telerik:RadButton>
 
<telerik:RadAjaxManager ID="ajax_manager" runat="server" DefaultLoadingPanelID="ajax_Loaging_Panel">
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="btn_submit">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="div_1" />
        </UpdatedControls>
    </telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>

protected void btn_submit_Click(object sender, EventArgs e)
{
    if (cbx_update.SelectedValue == "div_2")
    {
        lbl_2.Text = "Div 2 Updated";
        ajax_manager.AjaxSettings.AddAjaxSetting(btn_submit, div_2);
    }
    else
    {
        lbl_3.Text = "Div 3 Updated";
        ajax_manager.AjaxSettings.AddAjaxSetting(btn_submit, div_3);
    }
}

That the error occurs:
Erro: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_MainContent_ctl00_MainContent_div_2Panel'. If it is being updated dynamically then it must be inside another UpdatePanel.
Arquivo-fonte: http://localhost:10677/Telerik.Web.UI.WebResource.axd?_.......

This occurs because the telerik previously did not know what I would update divs. So do not create the Panels.

If I add these tags, even if this case does not make sense. works because the telerik creates the Panels, but I think we can bring me some trouble in the future.

<telerik:AjaxSetting AjaxControlID="div_3">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="div_2" />
        <telerik:AjaxUpdatedControl ControlID="div_3" />
    </UpdatedControls>
</telerik:AjaxSetting>


I think that's why the example of the telerik site works. (<telerik:AjaxUpdatedControl ControlID="DivExternalForm"...)

Following the recommendation of the error, add RadAjaxPanels on divs:

<telerik:RadAjaxPanel ID="pnl_2" runat="server">
    <div id="div_2" runat="server">
        <asp:Label ID="lbl_2" runat="server" Text="Div 2"></asp:Label>
    </div>
</telerik:RadAjaxPanel>
<br />
<telerik:RadAjaxPanel ID="pnl_3" runat="server">
    <div id="div_3" runat="server">
        <asp:Label ID="lbl_3" runat="server" Text="Div 3"></asp:Label>
    </div>
</telerik:RadAjaxPanel>


protected void btn_submit_Click(object sender, EventArgs e)
{
    if (cbx_update.SelectedValue == "div_2")
    {
        lbl_2.Text = "Div 2 Updated";
        ajax_manager.AjaxSettings.AddAjaxSetting(btn_submit, pnl_2);
    }
    else
    {
        lbl_3.Text = "Div 3 Updated";
        ajax_manager.AjaxSettings.AddAjaxSetting(btn_submit, pnl_3);
    }
}


But now another error occurs:
Erro: Sys.WebForms.PageRequestManagerServerErrorException: Object reference not set to an instance of an object.
Arquivo-fonte: http://localhost:10677/Telerik.Web.UI.WebResource.axd?_TSM_....

Searched these errors on the forums, but have not found a solution, can anyone help?
Iana Tsolova
Telerik team
 answered on 08 Apr 2011
2 answers
117 views
Hi

We are evaluating Telerik ASP.NET AJAX controls for upcoming project. One of the requirements is ability to display grid values in form of a horizontal color bar with its size depends on the cell value and color depends on the sign (positive numbers in green and negative in red). I could think of creating dynamic images based on the values and place them inside the grid which I think it would be very slow, or maybe somehow can use the Rating Column type template but was wondering if there is a better solution for this.

I would appreciate your help in advance.
Ron Farko
Ron
Top achievements
Rank 1
 answered on 08 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?