Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
420 views
Hi Telerik,

I have a problem where I set all 'input' to call a javascript function from my $(document).ready (as you can see below). The problem is that:

$(':input, textarea, select').not(".rgFilterBox, .RadGrid, .rgPagerTextBox").change

is not fired when I go to my comoboBox and select a different index. ( code for radbox below). Yes I have a "OnClientSelectedIndexChanged"
on the control, but I don't want to use that property in this case. I want to use the one from $(document).ready. 

Is there a way to pick up the selected index change from $(document).ready? 

------------------------------------------code here --------------------------------------------
$(document).ready(function () {

    $(':input, textarea, select').not(".rgFilterBox, .RadGrid, .rgPagerTextBox").change(function () {
        setIsDirtyFlag();
    });

});

<telerik:RadComboBox ID="RadComboBoxClearance" runat="server" TabIndex="9" MaxHeight="100" OnClientSelectedIndexChanged="setIsDirtySARFlag"
 Width="215px" EmptyMessage="Select..." MarkFirstMatch="true" Filter="StartsWith"
 RenderMode="Auto">
</telerik:RadComboBox>


Boyan Dimitrov
Telerik team
 answered on 13 Oct 2014
1 answer
254 views
I have a stored procedure which returns multiple result sets. The code calls the procedure with ExecuteReader(CommandBehavior.CloseConnection), and then proceeds to fill several grids, as follows:

thisgrid.DataSource = dr
thisgrid.DataBind()
dr.NextResult()
thatgrid.DataSource = dr
thatgrid.DataBind()
dr.NextResult()
theothergrid.DataSource = dr
theothergrid.DataBind()
dr.NextResult()

Up until now, we've been using Infragistics grids. But now we're converting to Telerik, and I'm running into a problem. After the first grid is bound, the DataReader closes, and the call to NextResult() results in a "reader is closed" error.

So, my first question is, how do I tell the DataBind method, "Hey, don't close that connection - there are more result sets coming"?

I know that if I remove CommandBehavior.CloseConnection from the ExecuteReader command, the DataReader stays open, but then I'm left with an open connection. So my second question is, how do insure that the connection gets closed? Is it automatically closed when the DataReader closes?
Konstantin Dikov
Telerik team
 answered on 13 Oct 2014
1 answer
156 views
Hello,

I searched a while but didn't find an appropriate Example.

I have a RadGridView bound to a EntityDataSource (EF 6). Everthing works fine (Sorting, Filtering), but now I ran into some Gotchas:

I have a primary key column ( = Entity Property) that is not shown in the grid, but I want to set a default filter on that column. When I try to use the where-property (AutoGenerateWhereClause = true) of the EntityDataSource I run into conflicts with the standard grid column filters. Which is the best way to achieve that?

I neet to fill additional column values when inserting new items, especially the primary keys. How should i do this?

Greetings Jochen
Marin
Telerik team
 answered on 13 Oct 2014
1 answer
105 views
Hi,

what ist the best practice to bind the CheckboxColumn to a non boolean column / property (we have a legacy database that uses smallint instead - like null or 0 for false and 1 for true)? I tried it with a partial class with wrapper properties on entity Level, but then ran into errors when inserting / updateing / editing within RadGrid


Exception = {"A property named 'BSPERRUNG' was not found on the entity during an insert, update, or delete operation. Check to ensure that properties specified as binding expressions are available to the data source."}

BSPERRUNG is the wrapper property for SPERRUNG, that is the original smallint column.

Are there any possibilities to achieve this with built in RadGridView features?

Greets Jochen
Marin
Telerik team
 answered on 13 Oct 2014
2 answers
90 views
HI,

I try to get the 'Standalone Tiles' example from your demo Website ( http://demos.telerik.com/aspnet-ajax/tilelist/examples/standalonetiles/defaultcs.aspx )
to run on my System.

In the mentioned example you have the following JavaScript code:

function liveTileOnClientTemplateDataBound(sender, args) {            var index = args.get_dataItem().index + 1;            if (index > 2) {                index = 0;            }            sender.set_value(index.toString());        }

Inside the code you use a function with Name set_value().
I assume what this function should do is to set the 'Value' property of the live tile.
Unfortunately there is no place in the online doc to a 'set_value()' function, at least I did not find it. Also no mentioning in the Forum.

What I THOUGHT I can do with this function is to set the value of the 'context' object Parameter to Server side pagemethod specified in the WebServiceSettings tag of the live tile.

But to what ever I set the value in set_value() it has no influence to the context object in the pagemethod.

Since set_value is not documented- Is this function really doing something or is the code in the demo wrong ?

I really WOULD like to set the value of the context object of the pagemethod.
How can I do this (if set_value is NOT the way to do it) ????

Hope that someone knows an answer.
Best regards
Hans-Juergen















 
Marin Bratanov
Telerik team
 answered on 13 Oct 2014
4 answers
815 views
Hello Team,
                    I am facing an issue with RadAsyncUpload when i upload a file we used to get green mark as symbol of successfully inserted int database,but now we are facing an issue, as we upload a file we getting a red symbol mark after we upload,but uploaded file is not saved and also getting red mark.Help me out from this issues ?? 
Hristo Valyavicharski
Telerik team
 answered on 13 Oct 2014
2 answers
140 views
I need to create a rotator that dynamically adds and removes items, because the items will be changing in real time. I was trying to get the web service to work, and it does work the first time, but it never gets called a second time. Here is my code:

[code language="csharp"]
[System.Web.Script.Services.ScriptService]
public class OverstockService : System.Web.Services.WebService 
{
    [WebMethod]
public RadRotatorItemData[] RSGetImages(int itemIndex, string argument)
{
List<RadRotatorItemData> result = new List<RadRotatorItemData>();
RadRotatorItemData item; 
for (int i = 0; i < 3; i++)
{
item = new RadRotatorItemData();
item.Html = "test "+(itemIndex+i) + "arg=" + argument;
result.Add(item);
}
return result.ToArray();
}
}
[/code]

[code language="html"]
<script type="text/javascript">
var index = 0;
function OnClientItemsRequesting(sender, args) {
var dbg = document.getElementById("debug");
dbg.innerHTML += "Request<br/>";
args.set_argument(index.toString());
index++;
}

</script>
<span id="debug"></span>
<telerik:RadRotator ID="rrGallery" runat="server" Width="250px" Height="250px" ScrollDuration="500" 
ItemHeight="200" ItemWidth="200" OnClientItemsRequesting="OnClientItemsRequesting" RotatorType="AutomaticAdvance">
<WebServiceSettings Path="/WebServices/OverstockService.asmx" Method="RSGetImages" />
</telerik:RadRotator>

[/code]

My plan was to remove items from the list once it got to a certain size, but the web service only gets called once. Can anyone help please?


Shawn
Top achievements
Rank 1
 answered on 13 Oct 2014
6 answers
730 views
Hi All

I want to open a pdf file wiithin a Rad Window, Is that possible? I am currently opening the pdf file from the database and that is always opeing in new window.

If any one can help please!

thanks
Rick
Marin Bratanov
Telerik team
 answered on 13 Oct 2014
2 answers
52 views
Hi support team,

Telerik TreeView is awesome, all my requirements are met. Great job!
But here I am stuck:

- I have a tree and the user can select multiple nodes.
- Initially, some nodes are expanded, so that all selected nodes are displayed. I do this with a datasource and with the OnNodeDataBound. 
- All nodes can be expanded with TreeNodeExpandMode.WebService

All works fine but when I collapse a initially loaded node, and then expand it again, the number of child nodes doubles, each child node is contained twice. When I do this again, it is still contained twice (not tree times).

How does the control do the "identity". Is is not the RadTreeNode.Value? 
One workaround is the set the ExpandMode of RadTreeNode to Server to all nodes that are initially expanded. But then the user can not collapse it (nothing happens when the user clicks -).  Best regards, a good customer 








Claude
Top achievements
Rank 1
 answered on 13 Oct 2014
1 answer
459 views
I have looked at the following forum post: http://www.telerik.com/forums/strange-behavior-when-using-args-set-cancel-true and although my code is similar still having odd behavior. 

When clicking on the radButton it will fire the validation but it takes clicking on the "OK" button twice before the validation summary disappears.

Suggestions?

<telerik:RadCodeBlock runat="server">
    <script type="text/javascript">
        function ShowConfirm(clickedButton, args) {
            var validated = Page_ClientValidate('Form');
            if (validated) {
                args.set_cancel(true);
                function callBackFunction(arg) {
                    if (arg == true) {
                        clickedButton.click();
                    }
                }
                //Open the window
                $find("<%=confirmWindow.ClientID %>").show();
                //Focus the Yes button
                $find("<%=btnYes.ClientID %>").focus();
                //Cancel the postback
                args.set_cancel(true);
            }
        }
 
        function YesOrNoClicked(sender, args) {
            var oWnd = $find("<%=confirmWindow.ClientID %>");
            oWnd.close();
            if (sender.get_text() == "Yes") {
                $find("<%=_btnFinish.ClientID %>").click();
            }
        }
    </script>
</telerik:RadCodeBlock>

    <asp:Panel runat="server" ID="ShowHistorical" Visible="false">
    <tr>
        <td style="text-align: center;" align="center">There is no <strong>Historical data for <asp:Label ID="_Step2CUName" runat="server"></asp:Label>.</strong>  Please select this credit unions Member Type before proceeding.<br />
            <br />
            <telerik:RadDropDownList ID="_ddMember" runat="server" AutoPostBack="true" DefaultMessage="Select Member Type"></telerik:RadDropDownList>  
            <asp:RequiredFieldValidator ID="_reqValMemberType" runat="server" ControlToValidate="_ddMember" Text="*" ForeColor="Red"
                ErrorMessage="You must select a Member Type before you can submit this Credit Union to be reinstated!<br />"
                ValidationGroup="Form" Display="Dynamic" EnableClientScript="true"></asp:RequiredFieldValidator>
        </td>
    </tr>
    </asp:Panel>
    <tr>
        <td align="center">
            <telerik:RadButton ID="_btnFinish" runat="server" Text="Finish" CommandName="Continue" ValidationGroup="Form"  Visible="false"
                OnClientClicking="ShowConfirm"></telerik:RadButton>
            <asp:ValidationSummary ID="ValidationSummary2" runat="server" ValidationGroup="Form" ShowMessageBox="true" ShowSummary="false"  DisplayMode="BulletList" />
        </td>
    </tr>
</table>

<telerik:RadWindowManager ID="windowManager1" runat="server">
</telerik:RadWindowManager>
<telerik:RadWindow ID="confirmWindow" runat="server" VisibleTitlebar="false" VisibleStatusbar="false"
    Modal="true" Behaviors="None" Height="200px" Width="350px">
    <ContentTemplate>
        <div style="margin-top: 30px; float: left;">
                <div style="width: 60px; padding-left: 15px; float: left;">
                    <img src="/images/ModalDialogAlert.gif" alt="Confirm Page" />
                </div>
                <div style="width: 230px; float: left;">
                    <asp:Label ID="lblConfirm" Font-Size="14px" Text=""
                        runat="server"></asp:Label>
                    <br />
                    <br />
                    <telerik:RadButton ID="btnYes" runat="server" Text="Yes" AutoPostBack="false" OnClientClicked="YesOrNoClicked">
                        <Icon PrimaryIconCssClass="rbOk"></Icon>
                    </telerik:RadButton>
                    <telerik:RadButton ID="btnNo" runat="server" Text="No" AutoPostBack="false" OnClientClicked="YesOrNoClicked">
                        <Icon PrimaryIconCssClass="rbCancel"></Icon>
                    </telerik:RadButton>
                </div>
        </div>
    </ContentTemplate>
</telerik:RadWindow>







Danail Vasilev
Telerik team
 answered on 13 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?