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

I need to generate custom XML from RadTreeList control. Can you please help me how can I traverse the TreeList. 

Thanks
Marin
Telerik team
 answered on 29 Oct 2012
3 answers
172 views
I have a 4.0 RadGrid on my page that I'm trying to bind to a LinqDataSource.  I originally tried to bind the grid to a LinqDataSource that had a detailed select statement that included crossreferences to foreign keys.  This did not work when it came to updates. 

2 questions.

1.  Do I understand correctly?  The only way I can get Linq to automatically take care of updates is to not have a Select statement in my LinqDataSource.

2. If (1) is correct then am I also correct in assuming that if I want cross-references to other tables I need to manually code them in the <Grid name>_ItemDataBound event?
Daniel
Telerik team
 answered on 29 Oct 2012
1 answer
146 views
Hi,

We are currently using Visual Studio 2005 for our ASP.NET web site. We bought telerik .NET 2.0 dlls and used them in the web site.

Now, we want to upgrade to Visual Studio 2012. If we buy telerik .NET 4.5 dlls, would it work or do we have to do some manual code changes? 

Also, Is there is a converter or tool that can help us with?

Thanks.
Genady Sergeev
Telerik team
 answered on 29 Oct 2012
1 answer
183 views
Hi,

How to add, update and delete on radgrid? My Add and update form should be in modal popup window in the same page of the grid where i should able to design the form.

I was implemented the samething in two pages one is grid page and another for new and edit.

Suggest to do it in single page


Thanks,
Prathap
Shinu
Top achievements
Rank 2
 answered on 29 Oct 2012
1 answer
100 views
I'm trying to do a database lookup based on what the user selects from the radcombobox.  The SelectedIndexChanged event isn't firing. Well, actually, it does fire but I'm not seeing the result of the postback (textbox.text = result) until I change a different field on the form (RadTextBox field). When I change the value of that field the TextChanged event runs and does what it's supposed to and I can then see the result of the SelectedIndexChange event from the combobox.


MARKUP
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="reg.aspx.vb" Inherits="TelerikWebForm" MasterPageFile="~/masterpage.master" maintainScrollPositionOnPostback = "true" %>
<asp:Content id="content1" ContentPlaceHolderID="cph_content" runat="server">
 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
 
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Web20">
    </telerik:RadSkinManager>
    <div id="main">
        <div id="content">
        
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="680px" LoadingPanelID="RadAjaxLoadingPanel1">
            <!--COMPANY / ISSUE-->
            <telerik:RadComboBox ID="RadComboBox1"
                Label="Name of Stock: "
                runat="server"
                Width="300px"
                LabelWidth="133px" 
                Height="150px"
                EmptyMessage="Enter Name of Company whose stock you own"
                DataSourceID="sqldatasource1"
                DataTextField="coname"
                DataValueField="issuenum"
                EnableAutomaticLoadOnDemand="True"
                ShowMoreResultsBox="true"
                EnableVirtualScrolling="True"
                OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
                AllowCustomText="false"
                LoadingMessage="Searching..."
                MinFilterLength="0"
                AutoPostBack="true">
                </telerik:RadComboBox>
             
                <asp:Label ID="lblConameLookup" runat="server" Text=" " Width="275" CssClass="label1" Visible="true"></asp:Label>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="Name of Stock is required." ControlToValidate="RadComboBox1" CssClass="label1error"></asp:RequiredFieldValidator>
                 
                <asp:SqlDataSource ID="SqlDataSource1" runat="server"  ConnectionString="..."></asp:SqlDataSource>
            <br />
 
             
            <!--USERNAME-->
            <telerik:RadTextBox ID="txtUsername" runat="server" Label="Username:" EmptyMessage="30 character max" MaxLength="30" LabelWidth="130" Width="300" OnTextChanged="txtUsername_TextChanged" AutoPostBack="true">
            </telerik:RadTextBox>
            <img alt="Info" src="/images/icon_info.png" title="Username Rules: 8 - 30 characters in length; can only contain the following: A-Z, a-z, 0-9, ! @ . _ - " class="infoicon" />
            <asp:Label ID="lblUsernameValidatorMsg" runat="server" Text=" " CssClass="label1error" Visible="false"></asp:Label>
            <asp:TextBox ID="txtUsernameValidatorStatus" visible="false" Text="Invalid" runat="server"></asp:TextBox>
            </telerik:RadAjaxPanel>
 
 
            <!--BUTTONS-->
            <telerik:RadButton ID="RadButton1" runat="server" Text="Submit" CausesValidation="true" >
                </telerik:RadButton>
 
         
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" >
    </telerik:RadAjaxLoadingPanel>
        
    </div></div>
 
    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" RelativeTo="Element"
            Position="MiddleRight" AutoTooltipify="true" ContentScrolling="Default" Width="225"
            Height="10" AutoCloseDelay="10000">
        </telerik:RadToolTipManager>
 
</asp:Content>



Protected Sub RadComboBox1_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles RadComboBox1.SelectedIndexChanged
 
        Dim strConn As String = System.Configuration.ConfigurationManager.ConnectionStrings("CONN").ConnectionString
        Dim MySQL As String = "SELECT ticker FROM [table] WHERE [issuenum] = @issuenum"
 
        Dim MyConn As New Data.SqlClient.SqlConnection(strConn)
        Dim Cmd As New Data.SqlClient.SqlCommand(MySQL, MyConn)
        Dim DR As SqlDataReader
 
        With Cmd.Parameters
            .Add(New SqlClient.SqlParameter("@issuenum", UCase(Trim(RadComboBox1.SelectedValue))))
        End With
 
        lblConameLookup.Visible = True
        Try
            MyConn.Open()
            DR = Cmd.ExecuteReader()
            DR.Read()
            lblConameLookup.CssClass = "label1"
            lblConameLookup.Text = DR("ticker")
        Catch ex As Exception
            lblConameLookup.CssClass = "label1error"
            lblConameLookup.Text = "Please select a company from the dropdown menu."
        End Try
        MyConn.Close()
 
    End Sub
 
 
    'VALIDATION FOR USERNAME FIELD
    Protected Sub txtUsername_TextChanged(sender As Object, e As System.EventArgs) Handles txtUsername.TextChanged
       
        'CHECK DATABASE
        Dim strConn As String = System.Configuration.ConfigurationManager.ConnectionStrings("CONN").ConnectionString
        Dim MySQL As String = "SELECT X1,X2 FROM Ytable WHERE [field] = @param"
 
        Dim MyConn As New Data.SqlClient.SqlConnection(strConn)
        Dim Cmd As New Data.SqlClient.SqlCommand(MySQL, MyConn)
        Dim DR As SqlDataReader
 
        With Cmd.Parameters
            .Add(New SqlClient.SqlParameter("@param", Trim(txtUsername.Text)))
        End With
 
        Try
            MyConn.Open()
            DR = Cmd.ExecuteReader()
            DR.Read()
            lblUsernameValidatorMsg.Visible = True
            If DR.HasRows = True Then
                lblUsernameValidatorMsg.Text = "This username is unavailable."
                txtUsername.Focus()
            End If
        Catch ex As Exception
            'lblUserNameStatus.Text = ex.Message
        End Try
        MyConn.Close()
    End Sub


I omitted some of the fields on the input form for simplicity and changed some of the SQL.  I may have some unmatching divs and stuff like that but you can ignore it.

Any help would be greatly appreciated.

Thanks.
Kalina
Telerik team
 answered on 29 Oct 2012
1 answer
70 views
Hello,
I have a web application (Visual Studio.net, v.2008) that uses the RadGrid control.  The grid works fine when viewing the application from localhost on my desktop development environment.  It also works fine when connected to the server and running it from the web address.  The issue is that if I run it from another pc using the web address, I can not see the grid.  Please help!
Maria Ilieva
Telerik team
 answered on 29 Oct 2012
1 answer
236 views
hi expert,
i am working with telerik file explorer form last 2 weeks can you please suggest the way / possibility
1 ) to show the size uint like (kb ,mb ) beside the the size number in the second pane
2) when we upload the file ,in the upload window when we click on add button we get unlimited select (browse) s
is there any way to restrict to some n number of selects
let me know the possibility for those if possible please suggest me how can we show the unit metric along with file

i hope you understand my issue .

Thanks & Regards,
m.koteswara Rao.
Princy
Top achievements
Rank 2
 answered on 29 Oct 2012
4 answers
155 views
Hi,
I need to remove the rows in radgrid on click of "Del" in keyboard. So I browsed the forum and got a solution to remove the radgrid rows from client side from this link
http://www.telerik.com/community/forums/aspnet-ajax/grid/delete-all-rows-in-a-radgrid-with-javascript.aspx#917286
So i got the below code

 

 

 

 

 

function keyPress(sender, eventArgs) {
        // Del button pressed
        if (eventArgs.get_keyCode() == 127) {
            var masterTable = sender.get_masterTableView();
            for (i = 0; i < masterTable.get_selectedItems().length; i++) {
                var it = masterTable.get_selectedItems()[i];
                var element = it.get_element();
                element.deleteRow(element.rowIndex);
            }
        }

After selecting the rows and Del key clicked in keyboard the event is called correctly. But the value of get_selectedItems() is incrementing without the newly selected list of items. Lets say first time if I select 1 row then the value of masterTable.get_selectedItems().length is 1 then Del click removed the row. Next time when i selected 2 rows and checked the value of masterTable.get_selectedItems().length, it is 3.
Why the selected items length is incrementing without being refreshed to 0.
Is my approach correct?

Eyup
Telerik team
 answered on 29 Oct 2012
3 answers
273 views

Hello group,

I'am trying to add a gridview to a radgrid detailtable from code behind. De radgrid is databound from the code behind with datatables. Now i want to add a gridview on the ItemDataBound event of the radgrid. I have the following snippet aspx:

<telerik:GridTableView Name="Sales" AutoGenerateColumns="false" Width="100%" DataKeyNames="DetailCode,DetailSubCode"
                                       ShowHeadersWhenNoRecords="false" HierarchyDefaultExpanded="true" HierarchyLoadMode="ServerOnDemand">
                                       <DetailTables>
                                           <telerik:GridTableView Name="Planning">
                                               <ItemTemplate>
                                               <asp:GridView ID="GridView1" runat="server">
                                                   </asp:GridView>
                                               </ItemTemplate>
                                           </telerik:GridTableView>
                                           <telerik:GridTableView AutoGenerateColumns="false" DataKeyNames="ProdHeaderDossierCode"
                                               HierarchyDefaultExpanded="false" Name="ProdDossier">
                                               <ParentTableRelation>
                                                   <telerik:GridRelationFields DetailKeyField="DetailCode" MasterKeyField="DetailCode" />
                                                   <telerik:GridRelationFields DetailKeyField="DetailSubCode" MasterKeyField="DetailSubCode" />
                                               </ParentTableRelation>
                                               <Columns>
                                                   <telerik:GridBoundColumn DataField="ProdHeaderDossierCode" HeaderText="ProdDossier">
                                                   </telerik:GridBoundColumn>
                                                   <telerik:GridBoundColumn DataField="ProdStatusCode" HeaderText="St.">
                                                   </telerik:GridBoundColumn>
                                                   <telerik:GridBoundColumn DataField="StartDate" HeaderText="Start">
                                                   </telerik:GridBoundColumn>
                                                   <telerik:GridBoundColumn DataField="EndDate" HeaderText="Eind">
                                                   </telerik:GridBoundColumn>
                                               </Columns>
                                               <NoRecordsTemplate>
                                                   <div style="text-align: center;">
                                                       Geen gegevens</div>
                                               </NoRecordsTemplate>
                                               <DetailTables>
                                                   <telerik:GridTableView Name="Oper" AutoGenerateColumns="false" Width="100%" DataKeyNames="ProdHeaderDossierCode"
                                                       ShowHeadersWhenNoRecords="false" HierarchyDefaultExpanded="false" HierarchyLoadMode="ServerOnDemand">
                                                       <ParentTableRelation>
                                                           <telerik:GridRelationFields DetailKeyField="ProdHeaderDossierCode" MasterKeyField="ProdHeaderDossierCode" />
                                                       </ParentTableRelation>
                                                       <Columns>
                                                           <telerik:GridBoundColumn DataField="MachGrpCode" HeaderText="Bew.">
                                                           </telerik:GridBoundColumn>
                                                           <telerik:GridBoundColumn DataField="ProdBooStatusCode" HeaderText="St.">
                                                           </telerik:GridBoundColumn>
                                                           <telerik:GridBoundColumn DataField="MachPlanTime" HeaderText="Bew.PT">
                                                           </telerik:GridBoundColumn>
                                                           <telerik:GridBoundColumn DataField="StartDate" HeaderText="Start">
                                                           </telerik:GridBoundColumn>
                                                           <telerik:GridBoundColumn DataField="EndDate" HeaderText="Eind">
                                                           </telerik:GridBoundColumn>
                                                           <telerik:GridCheckBoxColumn DataField="OperStartedInd" HeaderText="Gestart" ItemStyle-HorizontalAlign="Center">
                                                           </telerik:GridCheckBoxColumn>
                                                           <telerik:GridCheckBoxColumn DataField="OperFinishedInd" HeaderText="Gereed" ItemStyle-HorizontalAlign="Center">
                                                           </telerik:GridCheckBoxColumn>
                                                       </Columns>
                                                       <NoRecordsTemplate>
                                                           <div style="text-align: center;">
                                                               Geen gegevens</div>
                                                       </NoRecordsTemplate>
                                                   </telerik:GridTableView>
                                               </DetailTables>
                                           </telerik:GridTableView>
                                       </DetailTables>




And the code for ItemDataBound:



    Protected Sub RgNav_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RgNav.ItemDataBound
        If e.Item.ItemType = GridItemType.Item Then
            If e.Item.OwnerTableView.Name = "Sales" Then
                Dim DetailCode As String = e.Item.Cells(2).Text
                Dim DetailSubCode As String = e.Item.Cells(3).Text
                For Each Table As GridTableView In e.Item.OwnerTableView.DetailTables
                    If Table.Name = "Planning" Then
                        Dim Gv As GridView = Table.FindControl("GridView1")
                        Gv.DataSource = "Something"
                        Table.Controls.Add(Gv)
                    End If
                Next
            End If
        End If
    End Sub

Any help is welcome.

Thanks in advance,

René

Princy
Top achievements
Rank 2
 answered on 29 Oct 2012
6 answers
321 views
Is there any way to force a the grid to refresh when a treeview node is selected in the RadFileExplorer? On the first selection is appears to load up okay, but after that is seems to use the preloaded data. I need it to refresh each time the folder is selected if possible.
Rohan
Top achievements
Rank 1
 answered on 29 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?