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

Rad spell is not triggering RadTextBoxChanged on  RadTextBox.
 I am using the updateDisplayValue on OnClientDialogClosed.
Please let me know if you need more info.

PS
Dimo
Telerik team
 answered on 17 Dec 2009
2 answers
97 views
Hi,

I have an application which works well on my development environment including a series of RadComboBox's that are populated (onItemRequested) through a webservice.
This works all well, when i deploy the solution to another machine, which uses the same .net framework (and it's deployed correctly, including web.config settings etc.) it will not retrieve any data within the first combobox (no matches found).

  • I've checked the webservices and it gives a good response with data
  • I have another ComboBox on the screen that uses another service which does get populated
  • I have populated other controls through the same webservice that the not-working combobox is using

please help.
Pieter Vugts
Top achievements
Rank 1
 answered on 17 Dec 2009
3 answers
614 views
Everything I have read on this forum and in the samples says this should work.  I have the following code in C# page_load:

SearchResultGrid.MasterTableView.CurrentPageIndex = 0;

 

GridSortExpression ge = new GridSortExpression();

 

ge.FieldName =

"CustomerID";

 

ge.SortOrder =

GridSortOrder.Descending;

 

SearchResultGrid.MasterTableView.SortExpressions.Add(ge);

SearchResultGrid.Rebind();

The code above sorts the data in the grid with no issues... However, it does not select the column and visually show that it is sorted.  Here is the grid code:

 

<

 

telerik:RadGrid ID="SearchResultGrid" EnableAJAX="False" ShowStatusBar="True" PageSize="25" Width="99%" AllowPaging="True"

 

 

AllowSorting="True" runat="server" Skin="Green" EnableEmbeddedSkins="false" GridLines="Both" OnNeedDataSource="SearchResultGrid_NeedDataSource">

 

 

<clientsettings allowkeyboardnavigation="True">

 

 

<Selecting AllowRowSelect="false" />

 

 

<Resizing AllowColumnResize="True" AllowRowResize="False" />

 

 

<Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="false" />

 

 

<ClientEvents OnActiveRowChanged="ActiveRowChanged" OnRowSelected="RowSelected" OnKeyPress="GridKeyPressed"/>

 

 

</clientsettings>

 

 

<mastertableview autogeneratecolumns="false" clientdatakeynames="CustomerID,SiteID">

 

 

<Columns>

 

 

<telerik:GridTemplateColumn UniqueName="CustomerID" HeaderText="Customer" SortExpression="CustomerId" >

 

 

<itemtemplate>

 

 

<a href="javascript:document.getElementById('SearchTracker').value = '0';CloseWindowWithArgument('<%# Eval("CustomerID")+"','"+ Eval("SiteID") %>');"><%# Eval("CustomerId") %></a>&nbsp;

 

 

</itemtemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn Visible="false" HeaderText="Customer" UniqueName="ExportCustomerID" DataField="CustomerId" DataFormatString="{0}&nbsp;" SortExpression="CustomerId"/>

 

 

<telerik:GridBoundColumn HeaderText="Site Id" HeaderStyle-Width="5%" DataField="SiteID" UniqueName="SiteID" DataFormatString="{0}&nbsp;" SortExpression="SiteID" />

 

 

<telerik:GridBoundColumn HeaderText="Customer Name" HeaderStyle-Width="30%" DataField="CustomerName" UniqueName="CustomerName" SortExpression="CustomerName" />

 

 

<telerik:GridBoundColumn HeaderText="Address" HeaderStyle-Width="30%" DataField="AddressLine1" UniqueName="Address" SortExpression="AddressLine1" />

 

 

<telerik:GridBoundColumn HeaderText="City" HeaderStyle-Width="20%" DataField="City" UniqueName="City" SortExpression="City" />

 

 

<telerik:GridBoundColumn HeaderText="State" HeaderStyle-Width="5%" DataField="State" UniqueName="State" SortExpression="State" />

 

 

</Columns>

 

 

<NoRecordsTemplate>

 

 

<div class="NoRecordText">No records to display.</div>

 

 

</NoRecordsTemplate>

 

 

</mastertableview>

 

 

<pagerstyle mode="NumericPages" AlwaysVisible="true" />

 

 

</telerik:RadGrid>

The grid is in a table cell, in a div.  How can I get the grid to visually show the sort expression?

Thanks,

- Adam

 

Radoslav
Telerik team
 answered on 17 Dec 2009
1 answer
254 views

 I am trying to put raddatetime picker and some other control inside my Gridview for editing purpose but always getting errors like in subject could not find control inside gridview pls help me how can I solve this problem. All help will be appreciated and thank you in advance

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"   
            DataSourceID="SqlDataSource1" DataKeyNames="ID"   
            PageSize="20"  > 
            <PagerSettings Position="TopAndBottom" /> 
            <Columns> 
                <asp:CommandField ButtonType="Button" CancelText="Çık" EditText="Düzenle"   
                    ShowEditButton="True" UpdateText="Güncelle" /> 
                <asp:TemplateField HeaderText="ID" InsertVisible="False" SortExpression="ID">  
                    <ItemTemplate> 
                        <asp:Label ID="Label8" runat="server" Text='<%# Bind("ID") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="UserName" SortExpression="UserName">  
                    <ItemTemplate> 
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("UserName") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="Name" SortExpression="Name">  
                    <ItemTemplate> 
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("Name") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="SicilNo" SortExpression="SicilNo">  
                    <ItemTemplate> 
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("SicilNo") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="CartNo" SortExpression="CartNo">  
                    <EditItemTemplate> 
                 <asp:TextBox ID="txtCard" runat="server" Text='<%# Bind("CartNo") %>'   
                   ToolTip="5 karakter" Width="50px"></asp:TextBox> 
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("CartNo") %>'></asp:Label> 
                    </ItemTemplate> 
                    <ItemStyle Width="50px" /> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="CartNoStartDate"   
                    SortExpression="CartNoStartDate">  
                    <EditItemTemplate> 
                        <telerik:RadDatePicker ID="RadDatePicker1" SelectedDate='<%# Bind("CartNoStartDate") %>' runat="server">  
                        </telerik:RadDatePicker> 
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("CartNoStartDate") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="CartNoEndDate" SortExpression="CartNoEndDate">  
                    <EditItemTemplate> 
                        <telerik:RadDatePicker ID="RadDatePicker2" SelectedDate='<%# Bind("CartNoEndDate") %>' runat="server">  
                        </telerik:RadDatePicker> 
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("CartNoEndDate") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField> 
                <asp:TemplateField HeaderText="IsDeleted" SortExpression="IsDeleted">  
                    <EditItemTemplate> 
                        <asp:DropDownList ID="ddlBool" runat="server" SelectedValue'<%# Bind("IsDeleted") %>'>      
                        <asp:ListItem Text="Evet" Value="1" />      
                        <asp:ListItem Text="Hayır" Value="0" /> 
                        </asp:DropDownList> 
                    </EditItemTemplate> 
                    <ItemTemplate> 
                        <asp:Label ID="Label7" runat="server" Text='<%# Bind("IsDeleted") %>'></asp:Label> 
                    </ItemTemplate> 
                </asp:TemplateField> 
            </Columns> 
        </asp:GridView> 
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"   
            ConnectionString="<%$ ConnectionStrings:pdksConnectionString %>"   
            SelectCommand="SELECT UserName, Name, SicilNo, CartNo, CartNoStartDate, CartNoEndDate, IsDeleted, ID FROM Users WHERE (SicilNo LIKE '%' + @SicilNo + '%') OR (UserName LIKE '%' + @username + '%') ORDER BY Name, SicilNo, CartNo"   
            UpdateCommand="UPDATE Users SET CartNoEndDate = @CardNoEndDate, CartNoStartDate = @CardNoStartDate,CartNo = @CartNo,IsDeleted = @IsDeleted WHERE (ID = @ID)"   
            InsertCommand="INSERT INTO Users(UserName, Name, SicilNo, CartNo, CartNoStartDate, CartNoEndDate, IsDeleted, vardiya) VALUES (@username, @name, @SicilNo, @CartNo, GETDATE(), @CartNoEndDate, 0, 1)">  
            <SelectParameters> 
                <asp:ControlParameter ControlID="txtSicil" DefaultValue="NULL" Name="SicilNo"   
                    PropertyName="Text" Type="String" /> 
                <asp:ControlParameter ControlID="txtSicil" DefaultValue="" Name="username"   
                    PropertyName="Text" /> 
            </SelectParameters> 
            <DeleteParameters> 
                <asp:Parameter Name="ID" /> 
            </DeleteParameters> 
            <UpdateParameters> 
               <asp:ControlParameter ControlID="RadDatePicker1"   
                    ConvertEmptyStringToNull="False" DbType="DateTime" DefaultValue=""   
                    Name="CardNoStartDate" PropertyName="SelectedDate" />    
                <asp:ControlParameter ControlID="RadDatePicker2"   
                    ConvertEmptyStringToNull="False" DbType="DateTime" DefaultValue=""   
                    Name="CardNoEndDate" PropertyName="SelectedDate" />    
                <asp:ControlParameter ControlID="txtCard"   
                    ConvertEmptyStringToNull="False" DbType="String" DefaultValue=""   
                    Name="CartNo" PropertyName="Text" />    
                <asp:ControlParameter ControlID="ddlBool"   
                    ConvertEmptyStringToNull="False" DbType="Boolean" DefaultValue=""   
                    Name="IsDeleted" PropertyName="Value" />    
                <asp:ControlParameter ControlID="GridView1" DefaultValue="0" Name="ID"   
                    PropertyName="SelectedValue" Type="Int32" /> 
            </UpdateParameters> 
            <InsertParameters> 
                <asp:Parameter Name="username" /> 
                <asp:Parameter Name="name" /> 
                <asp:Parameter Name="SicilNo" /> 
                <asp:Parameter Name="CartNo" /> 
                <asp:Parameter Name="CartNoEndDate" /> 
            </InsertParameters> 
        </asp:SqlDataSource> 
Pavlina
Telerik team
 answered on 17 Dec 2009
1 answer
105 views
Hello,

I want' to put my treeView in an iFrame.

So I can't work with
var tree = $find('navTree')

So I'm trying to implement a function in the iFrame

function

 

getTree() {

 

 

     return $find('navTree')

 

}

and now I'm trying to access the tree from then parent object like that:

 

tree = document.getElementById(

"iFrameTreeview").contentWindow.getTree()

 

 

 

var nodes = tree.get_Nodes();

But the broser reports: tree.get_Nodes is not a function

What should I do to get Access to the tree from the parent-site?

Thanks for your support.

 

Christian Sommer
Top achievements
Rank 1
 answered on 17 Dec 2009
2 answers
398 views
How do I read the content of my item template on the server side by looping thru my collection of RadListBoxItems?

Suppose I have  a template as follows:

                    <ItemTemplate> 
                        <div id="TheValue" runat="server">> 
                            Test Id: 
                            <%#DataBinder.Eval(Container, "Value")%> 
                            <br /> 
                        </div> 
                        <div id="TheText" runat="server"
                            Name: 
                            <%#DataBinder.Eval(Container, "Text")%> 
                            <br /> 
                        </div> 
                        <div id="dateadded" runat="server"
                            Date Added: 
                            <%=DateTime.Now.ToShortDateString()%> 
                        </div> 
                        <hr style="height: 1px; border-color: Black; border-style: solid; width: 95%" /> 
                    </ItemTemplate> 


So in VB.NET in the code behind I expect to be able to  do something like this:

        For Each item As RadListBoxItem In RadListBoxDestination.Items 
           'Grab variables from ItemTemplate (e.g. dateadded ) and do stuff
        Next 


Any insight appreciated, thanks!

- David
Genady Sergeev
Telerik team
 answered on 17 Dec 2009
10 answers
243 views
Hello,

we've experienced a problem with the formdecorator control when using client-side-scripting.
If we add new nodes to a radtreeview on the client-side these checkboxes were not decorated.

For better understanding we have attached an example.
Could you please help us solving this issue.

function addNode(parentNode,nodeText,nodeValue,nodeCheckable,nodeChecked)
                {
                    var treeView= $find("navTree");
                    
                    treeView.trackChanges();
                    
                    //Instantiate a new client node
                    var node = new Telerik.Web.UI.RadTreeNode();
                    //Set its text
                    
                    node.set_text(nodeText);
                    node.set_value(nodeValue);
                    if (!nodeCheckable) { node.set_checkable(nodeCheckable); }
                    if (nodeCheckable && nodeChecked) { node.check() }
                    node.set_postBack(false);
                   
                     //Add the new node as the child of the selected node or the treeview if no node is selected
                    if (!parentNode) {
                        parentNode = treeView.get_selectedNode() || treeView;
                    }
                    parentNode.get_nodes().add(node);
                    
                    //Expand the parent if it is not the treeview
                    if (parentNode != treeView && !parentNode.get_expanded()) {
                        parentNode.set_expanded(true);
                    }
                    treeView.commitChanges();
                    return false;
                }

Christian Sommer
Top achievements
Rank 1
 answered on 17 Dec 2009
1 answer
309 views

I am trying to get an Eval value from my radgrid to my c# codebehind.  The value is binded to a hiddenfield and I want to get the value after I hit the built in edit button.  To achieve this I am trying to get the hiddenvalue1 to javascript and then somehow get it to my c# code behind.  The closest thing I have come to that is binding the value to a hyperlink that when clicked shows an alert with the binded value as shown below.  I need something that is automatic where I don’t need to hit a button.  Can anyone help?

 

<asp:HyperLink id="hklk" runat="server" Text='<%# Eval("id") %>' onclick="return GiveAlert(this);"></asp:HyperLink>

 

function GiveAlert(con)

{

 

     alert(con.innerHTML);

 

     return false;

}

Shinu
Top achievements
Rank 2
 answered on 17 Dec 2009
7 answers
165 views
Hi, I've encountered a problem with the rad editor. Whenever i click the end of text or enter <br/>'s into the content field it resets the font to Times New Roman 3... Any idea what could be causing that and/or how i could prevent that from happening?

Thanks!
Rumen
Telerik team
 answered on 17 Dec 2009
1 answer
171 views
Hi

i am currently trying to bind a object property to a RadTextBox and am getting the following error when using the <%# Bind(DataItem.Name) %> method:
System.InvalidOperationException: Databinding methods such as Eval(), XPath(),  
and Bind() can only be used in the context of a databound control. 

I can bind using the following, but it is only one way:
%# DataBinder.Eval(this, "DataItem.Name") %> 

How can i get two way binding?





Pavlina
Telerik team
 answered on 17 Dec 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?