Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
221 views
I downloaded and installed RadControls_for_ASP.NET_AJAX_2009_2_826_dev.msi, and it seems to have only installed this folder at C:\Program Files\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025, which only contains System.Web.Extensions.Design.dll and System.Web.Extensions.dll.  Where are the Telerik AJAX assemblies???


Phil Hadley
Top achievements
Rank 1
 answered on 30 Sep 2009
1 answer
92 views
Hi,

MY table has field  LIveData.  When livedate is "D"  i want colour that perticular grid row from red.
How can i do that?

lakmal
Daniel
Telerik team
 answered on 30 Sep 2009
6 answers
177 views
Hello,

I have a RadGrid embedded inside of an AJAX panel.  I have an AJAXLoadingPanel that is supposed to be displayed for page changes and filtering.  The loading panel works perfectly when I click on the different page numbers or when I use the filter and CLICK on the filter option.  The problem I am having is when the AutoPostBackOnFilter option is set to TRUE, the loading panel flickers over the grid and then disappears.  The filtering still happens properly, but after the loading panel flickers on, to the end user it is unclear what is happening.  Any ideas?

Thanks,
--nick

Nicholas Walker
Top achievements
Rank 1
 answered on 30 Sep 2009
1 answer
156 views
I have a treeview (2008 Q3) and I am trying to change the node height ont he client side.   I did nto see a method for doing this so I am just trying to apply a new CSS class to change the height.   It is not working though, so what am I doing wrong?

Here is the CSS

.addPartsNode
{
width: 100%;
height: 20px;
vertical-align :top;
padding-top: 0px;
}
.addPartsNodePartInfoShown
{
width: 100%;
height: 40px !Important;
vertical-align :top;
padding-top: 0px;
}

All nodes are set to addPartsNode style to start. 

Then I use this JS to change the css class for the node. The var currNode is the Current Treeview Node as set by a mouseover function.

if (currNode != null) {
document.body.style.cursor = 'wait';
var element = currNode.get_element();
var lblStock = $telerik.findElement(element, "lblInStock");
if (lblStock.style.visibility == "hidden")
{
lblStock.innerText="1";
var tblPartInfo = $telerik.findElement(element, "tblPartInfo");
tblPartInfo.style.visibility = "visible";
var tbPartInfo = $telerik.findElement(element, "tbPartNotes");
tbPartInfo.style.visibility = "visible";


currNode.set_cssClass="addPartsNodePartInfoShown"
}
else
{
lblStock.innerText=parseFloat(lblStock.innerText)+1;
}
lblStock.style.visibility = "visible";
document.body.style.cursor = 'default';
}
}
Pat Huesers
Top achievements
Rank 1
 answered on 30 Sep 2009
1 answer
105 views
I have a treeview (Q3 2008) control that I am bulding the nodes for programmatically.   The node I am working with has 15 controls in it. I am trying to execute some js to access the controls in this node so I can change the text and other things.  Here is what I have tried.  Please excuse the fact that I am lost!

Here is the code that builds the Node.

This is the calling code from the populatenodeondemand sub

Dim node As New RadTreeNode()
node.Controls.Add(FormatNode(row))

Here is the function that makes the node.

Function FormatNode(ByVal rowData As DataRow) As Table

Dim tblReturn As New Table
Dim rowReturn As New TableRow

Dim cellCallOut As New TableCell
Dim cellDescription As New TableCell
Dim cellQuad As New TableCell
Dim cellLabor As New TableCell
Dim cellPartNumber As New TableCell
Dim cellPrice As New TableCell
Dim cellInStock As New TableCell
Dim cellAddandRemove As New TableCell
Dim cellInventoryCount As New TableCell

Dim intDescriptionCellIndentSpacing As Integer = 10
Dim intDescriptionCellWidth As Integer = 180

rowReturn.VerticalAlign = VerticalAlign.Top

cellDescription.VerticalAlign = VerticalAlign.Top

cellDescription.HorizontalAlign = HorizontalAlign.Left
cellCallOut.ForeColor = Drawing.Color.Crimson

cellInventoryCount.ForeColor = Drawing.Color.Blue

With rowData
If Not IsDBNull(.Item("Callout")) Then
cellCallOut.Text = .Item("Callout").ToString
Else
cellCallOut.Text = ""
End If

Dim intIndent As Integer
Try
If Not IsDBNull(.Item("IndentCode")) Then
intIndent = CInt(.Item("IndentCode"))
End If
Catch ex As Exception
intIndent = 0
End Try

If Not IsDBNull(.Item("IndentCode")) Then
cellDescription.Text += .Item("Description").ToString
cellDescription.Style.Add("padding-left", (intIndent * intDescriptionCellIndentSpacing).ToString + "px")
cellDescription.Attributes.Add("width", (intDescriptionCellWidth - (intIndent * intDescriptionCellIndentSpacing)).ToString + "px")
Else
cellDescription.Text = " "
cellDescription.Attributes.Add("width", intDescriptionCellWidth.ToString + "px")
End If

If Not IsDBNull(.Item("QuadRight1")) Then
cellQuad.Text += .Item("QuadRight1").ToString
End If

If Not IsDBNull(.Item("QuadRight2")) Then
cellQuad.Text += .Item("QuadRight2").ToString
End If

If Not IsDBNull(.Item("LaborHours")) Then
cellLabor.Text = .Item("LaborHours").ToString
End If

If Not IsDBNull(.Item("PartNumber")) Then
cellPartNumber.Text = .Item("PartNumber").ToString

Dim imgAddIcon As New ImageButton
imgAddIcon.ImageUrl = "Img/AddIcon.png"
imgAddIcon.OnClientClick = "addPart('" + .Item("PartNumber").ToString + "');return false;"
cellAddandRemove.Controls.Add(imgAddIcon)

Dim imgRemoveIcon As New ImageButton
imgRemoveIcon.ImageUrl = "Img/RemoveIcon.png"
imgRemoveIcon.OnClientClick = "removePart('" + .Item("PartNumber").ToString + "');return false;"
cellAddandRemove.Controls.Add(imgRemoveIcon)
End If

If Not IsDBNull(.Item("InvCount")) Then
If .Item("InvCount") > 0 Then
cellInStock.ToolTip = .Item("InvCount").ToString + " In Stock"
Dim imgInStock As New ImageButton
imgInStock.ImageUrl = "Img/InStock.png"
imgInStock.OnClientClick = "showInventory('" + .Item("PartNumber").ToString + "');return false;"
cellInStock.Controls.Add(imgInStock)
End If
End If

If Not IsDBNull(.Item("StockNumberInvCount")) Then
If .Item("InvCount") > 0 Then
cellInventoryCount.Text = .Item("StockNumberInvCount").ToString
End If
End If


If Not IsDBNull(.Item("Price")) Then
cellPrice.Text += Format(.Item("Price"), "C")
Else
cellPrice.Text += ""
End If

End With

cellAddandRemove.CssClass = "cellAddandRemove"
cellInventoryCount.CssClass = "cellInventoryCount"
cellCallOut.CssClass = "cellCallOut"
cellQuad.CssClass = "cellQuad"
cellLabor.CssClass = "cellLabor"
cellPartNumber.CssClass = "cellPartNumber"
cellPrice.CssClass = "cellPrice"
cellInStock.CssClass = "cellInStock"

rowReturn.Cells.Add(cellAddandRemove)
rowReturn.Cells.Add(cellInventoryCount)
rowReturn.Cells.Add(cellCallOut)
rowReturn.Cells.Add(cellDescription)
rowReturn.Cells.Add(cellQuad)
rowReturn.Cells.Add(cellLabor)
rowReturn.Cells.Add(cellPartNumber)
rowReturn.Cells.Add(cellPrice)
rowReturn.Cells.Add(cellInStock)

tblReturn.Rows.Add(rowReturn)


Return tblReturn
End Function

And here is the js.  I really have just been trying to get to the controls.  So please show me how to find to control and then to modify it.  Specifically the text in a cell.  The var currNode is set to the current node by the Mouseovernode event.

 function addPart(partnumber) {
var tree = $find("<%= tvSection.ClientID %>");
var pn;
if (currNode != null) {
var nodeControls = currNode.get_textElement();
var tbQuantity = nodeControls[2];
var tbQuantity2 = currNode.findControl("cellInventoryCount");
var nodeAttrib= currNode.get_attributes();
}

}

 

Pat Huesers
Top achievements
Rank 1
 answered on 30 Sep 2009
2 answers
686 views
Hello,

I have an issue where the drop down list for my radcombobox needs to open to the left instead of the right.  At this moment, the list is extended past the right hand side of my window.  Is there a property setting that can easily take care of this?  I have tried the OffsetX and OffsetY properties but the dropdown still not move past the left-most position of the combobox. 

Thanks,
Rick
 
troyski8
Top achievements
Rank 1
 answered on 30 Sep 2009
2 answers
162 views

I've created a grid where I edit the data InPlace.  The grid has just one editable column and when I press Enter/Return I want the row to save.  This seems to be partly working without me having to code it but only if I am editing row 1 on the grid (or the add new line if inserting a new record).  If I edit row 2 or more then it's not saving my row and instead just moves the focus to row 1 on the grid!

The grid is created entirely with code.  Here it is...

default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title></title>  
</head> 
<body> 
    <form id="form1" runat="server">  
      
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager> 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnableAJAX="true" DefaultLoadingPanelID="AjaxLoadingPanel1"></telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel id="AjaxLoadingPanel1" runat="server" ></telerik:RadAjaxLoadingPanel>   
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager> 
    
    <div> 
        <asp:Panel ID="pnlContent" runat="server">  
    
        </asp:Panel> 
    </div> 
      
    </form> 
</body> 
</html> 
 

default.aspx.vb

Imports Telerik.Web.UI  
 
Partial Public Class _Default  
    Inherits System.Web.UI.Page  
 
    Protected WithEvents grdCategories As New RadGrid  
    Protected WithEvents sqlDataSource As New SqlDataSource  
 
    Private Function CreateRadGridBoundColumn(ByVal Datafield As String, Optional ByVal Width As Integer = 0) As GridColumn  
 
        Dim col As New GridBoundColumn  
        With col  
            .AllowSorting = True 
            .DataField = Datafield  
            .HeaderText = Datafield  
            .UniqueName = Datafield  
 
            If Width = 0 Then 
                .HeaderStyle.Width = (Len(.HeaderText) * 8) + 32  
            Else 
                .HeaderStyle.Width = Width + 16  
            End If 
        End With 
 
        Return col  
 
    End Function 
 
    Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init  
 
        SetGridSettings()  
 
    End Sub 
 
    Private Sub grdCategories_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdCategories.ItemCreated  
 
        If (TypeOf e.Item Is GridDataInsertItem AndAlso e.Item.IsInEditMode) Then 
            Dim InsertItem As GridDataInsertItem = DirectCast(e.Item, GridDataInsertItem)  
 
            Dim CategoryTextBox As TextBox = DirectCast(InsertItem("CategoryName").Controls(0), TextBox)  
            CategoryTextBox.MaxLength = 25  
            CategoryTextBox.Width = 450  
            CategoryTextBox.Focus()  
        ElseIf (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then 
            Dim EditItem As GridEditableItem = DirectCast(e.Item, GridEditableItem)  
 
            Dim CategoryTextBox As TextBox = DirectCast(EditItem("CategoryName").Controls(0), TextBox)  
            CategoryTextBox.MaxLength = 25  
            CategoryTextBox.Width = 450  
            CategoryTextBox.Focus()  
        End If 
 
    End Sub 
 
    Protected Sub SetGridSettings()  
 
        With sqlDataSource  
            .ID = "SqlDataSource" 
            .ConnectionString = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString  
            .SelectCommandType = SqlDataSourceCommandType.Text  
            .SelectCommand = "SELECT CategoryID, CategoryName FROM Categories" 
            .DeleteCommandType = SqlDataSourceCommandType.StoredProcedure  
            .DeleteCommand = "DeleteCategory" 
            .InsertCommandType = SqlDataSourceCommandType.StoredProcedure  
            .InsertCommand = "InsertCategory" 
            .UpdateCommandType = SqlDataSourceCommandType.StoredProcedure  
            .UpdateCommand = "UpdateCategory" 
 
            .InsertParameters.Add("CategoryName", TypeCode.String)  
            .UpdateParameters.Add("CategoryName", TypeCode.String)  
        End With 
 
        pnlContent.Controls.Add(sqlDataSource)  
 
        With grdCategories  
            .ID = "grdCategories" 
            .AllowSorting = True 
            .DataSourceID = "SqlDataSource" 
            .AllowAutomaticDeletes = True 
            .AllowAutomaticInserts = True 
            .AllowAutomaticUpdates = True 
 
            .ShowStatusBar = True 
 
            With .MasterTableView  
                .AutoGenerateColumns = False 
                .AllowMultiColumnSorting = False 
                .EditMode = GridEditMode.InPlace  
 
                .DataKeyNames = New String() {"CategoryID"}  
                .DataSourceID = "SqlDataSource" 
 
                .CommandItemDisplay = GridCommandItemDisplay.Top  
                .TableLayout = GridTableLayout.Fixed  
                .Width = New Unit(100, UnitType.Percentage)  
 
                .Columns.Add(CreateRadGridBoundColumn("CategoryName", 450))  
 
                Dim EditCommand As New GridEditCommandColumn  
                With EditCommand  
                    .ButtonType = GridButtonColumnType.ImageButton  
                    .UniqueName = "EditCommandColumn" 
                    .HeaderStyle.Width = 50  
                End With 
                .Columns.Add(EditCommand)  
 
                Dim DeleteButton As New GridButtonColumn  
                With DeleteButton  
                    .HeaderStyle.Width = 35  
                    .CommandName = "Delete" 
                    .ButtonType = GridButtonColumnType.ImageButton  
                    .ConfirmDialogType = GridConfirmDialogType.RadWindow  
                    .ConfirmText = "Are you sure you wish to delete this category?" 
                    .ConfirmTitle = "Delete Category" 
                End With 
                .Columns.Add(DeleteButton)  
            End With 
        End With 
 
        pnlContent.Controls.Add(grdCategories)  
 
    End Sub 
 
End Class 

Northwind sample script to create my stored procedures:

USE Northwind  
GO  
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[DeleteCategory]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)  
drop procedure [dbo].[DeleteCategory]  
GO  
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[InsertCategory]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)  
drop procedure [dbo].[InsertCategory]  
GO  
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[UpdateCategory]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)  
drop procedure [dbo].[UpdateCategory]  
GO  
CREATE PROCEDURE [DeleteCategory]  
    (@CategoryID    [int])  
AS   
DELETE [Northwind].[dbo].[Categories]   
WHERE ([CategoryID]  = @CategoryID)  
GO  
CREATE PROCEDURE [InsertCategory]  
    (@CategoryName  [nvarchar](15))  
AS   
INSERT INTO [Northwind].[dbo].[Categories]   
     ([CategoryName],  
      [Description],  
      [Picture])   
VALUES   
    (@CategoryName,  
     NULL,  
     NULL)  
GO  
CREATE PROCEDURE [UpdateCategory]  
    (@CategoryID        [int],  
     @CategoryName  [nvarchar](15))  
AS   
UPDATE [Northwind].[dbo].[Categories]   
SET [CategoryName]   = @CategoryName   
WHERE ([CategoryID]  = @CategoryID)  
GO  

Steps to reproduce (firstly make sure you've a connection to Northwind setup in Web.Config)
1. Click Edit on row 3
2. Change the text
3. Press Enter to try and save the row.  You will see the cursor move to row 1 and the data will not be saved.

Thanks

Chris
Top achievements
Rank 2
 answered on 30 Sep 2009
3 answers
280 views
How would load a RadComboBox from database with HTML Formatting?

Is there a way to perform validation to make sure that user selected a choice from the drop down?

Would you have sample code?

Thank you very much 
Rogério
Top achievements
Rank 2
 answered on 30 Sep 2009
1 answer
90 views
I want to have a multi line text box in my grid, heres how Ive done it

<telerik:GridTemplateColumn UniqueName="TickerColumn" HeaderText="Ticker Text">  
                          
                        <ItemTemplate> 
                            <%#DataBinder.Eval(Container.DataItem,"TickerContent")%> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <telerik:RadTextBox ID="RadTextBoxTickerContent" runat="server" TextMode="MultiLine" MaxLength="500" Rows="5" Width="350px">  
                            </telerik:RadTextBox> 
                              
                        </EditItemTemplate> 
                    </telerik:GridTemplateColumn> 
 
in the insert method I have this code

protected void RadGridTicker_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)  
        {  
              
 
            Telerik.Web.UI.GridEditFormInsertItem insertedItem = (Telerik.Web.UI.GridEditFormInsertItem)e.Item;  
 
            RadComboBox cbPage = (e.Item as GridEditableItem)["ddlDisplayPage"].Controls[0] as RadComboBox;  
            Telerik.Web.UI.RadTextBox tbContent = (insertedItem.FindControl("RadTextBoxTickerContent") as Telerik.Web.UI.RadTextBox);     
 
 
              
            string content = tbContent.Text;  
 
            string res = tickermanager.Add(cbPage.SelectedValue, content);  
 
            if (!string.IsNullOrEmpty(res))  
            {  
                this.RadGridTicker.Controls.Add(new LiteralControl("Unable to insert ticker. Reason: " + res));  
                e.Canceled = true;  
            }  
        } 

stepping through the code shows that an instance of the text box is created, but the text property is null  even though ive typed in several lines of text.  What am I doing wrong here ?
Mira
Telerik team
 answered on 30 Sep 2009
2 answers
174 views
Hello

i am trying to make a RadPanelBar with a behaviour like with ExpandMode="SingleExpandedItem" for all items except the last..
So the last RadItem should always be expanded and the other RadItems should behave like with SingleExpandedItem mode.
Can you please tell me if this possible?

Thanks
Achim
Achim
Top achievements
Rank 1
 answered on 30 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?