Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
249 views
Hi,

I'm trying to incorporate the RadFileExporer inside my radgrid edit form to select a image.   I have it working with the open button in a grid templatecolumn and the Explorer.aspx file but I cant figure out how to get the file value back to the text field in the edit form.

In my grid page I added the OnFileSelected java but I relized that it wont be able to find the text control to set the value for saving back to the database.

So basiccly I want to have the textbox with the filename,  then a open button to select the file from explorer.aspx in a radwindow then have it put the filename value in the textbox in the edit form.

Are there any examples of this that I can look at?

Thanks
-Keith
Jaimie
Top achievements
Rank 1
 answered on 01 Oct 2009
1 answer
101 views
Just wondering what the recommended way it to find multiple nodes that have a certain attribute for example.

Since FindNodeByAttribute only returns one result.  I'm mainly concerned with the server side that the moment, but wouldn't mind knowing the answer for client side as well.

Thanks
Schlurk
Top achievements
Rank 2
 answered on 30 Sep 2009
1 answer
98 views
I have a N-tier application patterned after the Northwind N-tier example.

Page Codebehind:

**** this is where my problem is ("Object reference not set to an instance of an object")

        protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e) 
        { 
            IDictionary dict = new Hashtable(); 
            GridEditFormItem editedItem = (GridEditFormItem)e.Item; 
            editedItem.OwnerTableView.ExtractValuesFromItem(dict, editedItem); 
 
            User editeduser = new User(); 
 
    ****        editeduser.Uid = int.Parse(dict["Uid"].ToString()); 
            editeduser.First = dict["First"].ToString(); 
            editeduser.Last = dict["Last"].ToString(); 
            editeduser.Username = dict["Username"].ToString(); 
 
            dataProvider.UpdateUser(editeduser); 
        } 

Since the column "Uid" is both hidden and read only it doesn't show up in "dict".

How can I work around this? What is the correct way to access the value of a hidden read only value from UpdateCommand event?


ScalarSyS
Top achievements
Rank 1
 answered on 30 Sep 2009
3 answers
143 views
Hi,

I'm trying to work out the best way of handling forms with the Telerik controls.  I've started to use the form view ASP component but it seems somewhat basic.  Are there any plans for a Telerik enhanced formview component?

Alternatively does anyone have any suggestions for RAD creation of forms complete with the view, edit (update and create) functionality.

Thanks in advance for any assistance.

Regards,

Jon

keith robideau
Top achievements
Rank 1
 answered on 30 Sep 2009
3 answers
428 views
I have two date pickers that I am trying to validate for a start and end date. I have this in my code but it always returns back as an invalid entry, even when the end date is later than the start date. Any ideas why? Here is my code. Thanks,
        <tr>
            <td>
                <center>
                    <span class="adminTableLabel">Start Date</span>
                    <telerik:RadDateTimePicker ID="startDate" Skin="Web20" runat="server" Width="150px">
                    </telerik:RadDateTimePicker>
                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="startDate"
                        ErrorMessage="Please enter a start date." CssClass="errorMessage"></asp:RequiredFieldValidator>
                </center>
            </td>
            <td class="addBusinessSpacing">
            </td>
            <td>
                <center>
                    <span class="adminTableLabel">End Date</span>
                    <telerik:RadDateTimePicker ID="endDate" Skin="Web20" runat="server" Width="150px">
                    </telerik:RadDateTimePicker>
                    <asp:CompareValidator ID="dateCompareValidator" runat="server"
                        ControlToValidate="endDate" ControlToCompare="startDate"
                        Operator="GreaterThan" Type="date"
                        ErrorMessage="The end date must be later than the start date."
                        CssClass="errorMessage">
                    </asp:CompareValidator>
                </center>
            </td>
        </tr>
Pavlina
Telerik team
 answered on 30 Sep 2009
6 answers
214 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
84 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
169 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
152 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
99 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
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?