Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
217 views
I am attempting to assign the imageurl to the image control in the code behind.

I have it working somewhat however, I must not have the code looping correctly because if there is more than one item associated with the IDOrder, the grid displays images correctly unless there are two of the same types in the same IF statement. If there is more than one of the same type in any one IF statement then only the first image will show and the rest will simply display the dreaded X.

Here is my code.

Protected Sub rgd_OrderItems_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgd_OrderItems.ItemDataBound
 
    Dim IDOrder = Request.QueryString("IDOrder")
 
    Dim cn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("ETP_OPS_ConnectionString").ToString)
    cn.Open()
    Dim SqlCmd As SqlCommand
    SqlCmd = New SqlCommand("SELECT ImageFilePath FROM vw_Orders_Items WHERE ([IDOrder] = @IDOrder)", cn)
 
    SqlCmd.Parameters.Add("@IDOrder", SqlDbType.NVarChar, 36).Value = IDOrder
 
    Dim ImageFilePath = CType(SqlCmd.ExecuteScalar, String)
    cn.Close()
 
    If TypeOf e.Item Is GridDataItem Then
 
        For Each item As GridDataItem In rgd_OrderItems.Items
 
            'Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
            Dim img As Image = DirectCast(item.FindControl("ImageFilePath"), Image)
 
            If ImageFilePath.Contains(".jpg") _
            Or ImageFilePath.Contains(".jpeg") _
            Or ImageFilePath.Contains(".gif") _
            Or ImageFilePath.Contains(".png") Then
 
                img.ImageUrl = ImageFilePath
 
            ElseIf ImageFilePath Like ("*.doc*") Then
 
                img.ImageUrl = "../../images/icon_word.gif"
 
            ElseIf ImageFilePath Like ("*.pdf*") Then
 
                img.ImageUrl = "../../images/icon_pdf.gif"
 
            Else
 
                img.ImageUrl = "../../images/icon_unknown.gif"
 
            End If
 
            'item("ImageFilePath").Attributes.Add("onclick", "OPenPopuP('" + ImageFilePath + "');")
        Next
    End If

Thank you in advance.

Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Dec 2013
5 answers
137 views
Hi,
I have an aspx page with some text boxes, buttons and a radgrid with edit template column. when i click on "add new row" i get some editable boxes in grid to add value. it is having "insert" and "cancel" buttons next to it. i dont want these buttons. instead i have a "save" button in the page. I want all the values from textboxes and grid needs to be saved when clicking on save button.

I dont want to seperately click on "insert" button in the grid to be clicked.
Princy
Top achievements
Rank 2
 answered on 02 Dec 2013
4 answers
280 views

Hello team,

 I am working on a requirement in my application, where I have to save the values from the grid. The grid looks like below
      

Period

Amount

Column1

Column2

Column3

Column4

January

 33,445.00

 textbox

textbox

textbox

textbox

February

 22,000.00

textbox

textbox

textbox

textbox

March

 12,000.00

textbox

textbox

textbox

textbox

April

 

textbox

 textbox

textbox

textbox


The dataset the gets binded to the grid would contain periodID,periodname,amount,column1ID,column1value,column2ID,column2value,column3ID,column3value...
. The periodID would be the datakey value for the grid and the columns from column1  to column4 would be input text boxes. I want to bind the columnID values to the grid columns( column1ID to column1 , column2ID to column2....
).The users will enter some value in columns say column1 and I want to save the value entered in textbox to the database table. But the parameters I need to save would be periodID,textbox input and columnID.

I have two questions here , 

1. Can I bind columnIDs to columns (here in particular when it is having textbox)
2. If the columnIDs can be binded to the grid, can those values be retrieved when the text change event in the grid is called to save data.

I hope I am clear on the explanation. Could you please help me in this.

Thanks,
Kaushik

Princy
Top achievements
Rank 2
 answered on 02 Dec 2013
13 answers
233 views
Hi Telerik,

I am using Telerik.Web.UI 2010.3.1317.40 and on Google Chrome 10.0.648.204 and I am not seeing the FieldSet's legend become decorated as it should be. I do not see this issue in IE 8. The RadFormDecorator is set to decorate all controls, yet the legend stays black text when it is blue in IE8.

Any suggestions on why this would be happening? 

EDIT:

Hi, I am experiencing a different issue for IE8 that is also related to RadFormDecorator.

I have a field set with static height. Sometimes, though, I add more controls or hide controls from inside this field set. In these scenarios I have to change the height to another value. When I do this, the rendering for the control breaks when RadFormDecorator is decorating the control. How can I solve this issue?

Attached are two images. NoDecor shows the RadWindow without the decorator active. Decor shows it with the decorator active. Both are after I have changed the height of the FieldSet using javascript.

Shinu
Top achievements
Rank 2
 answered on 02 Dec 2013
1 answer
187 views
I have datapickers on sevaral webpages. On IE en Firefox the datepickers show correcly however on chrome the width property is apparently not working correctly. See attached images. Any ideas how to solve this
Shinu
Top achievements
Rank 2
 answered on 30 Nov 2013
1 answer
252 views
Hi

How can I switch to a radtab from C# code without clicking it? I tried radtabstripid1.FindTabByText("Consumer").Selected=true; This make the tab looks like selected but the tab content has not changed from previous tab.

Please provide a solution
Needha
Shinu
Top achievements
Rank 2
 answered on 30 Nov 2013
1 answer
96 views
Is it possible to have dynamic page heights in a RadMultiPages, so that the tabpage height is automatically adjusted to the content of each indidual page?
(We're not loading external content.)
Shinu
Top achievements
Rank 2
 answered on 30 Nov 2013
1 answer
138 views
I am displaying a radconfirm from javascript and I want to prevent the user from dragging/moving the confirm window. Is it possible to restrict this?

Thankyou
dan
Shinu
Top achievements
Rank 2
 answered on 30 Nov 2013
1 answer
215 views

I am trying to find a solution to exclude the DetailItemTemplate from export to Excel and Word. 



I have tried the following code in the export onclick event and whilst debugging shows that whilst it does change visible to false for each item, the detail still appears in Excel and Word:

For Each item As GridDataItem In RadGrid1.MasterTableView.Items

item.DetailTemplateItemDataCell.Visible = False

Next

Me.RadGrid1.MasterTableView.ExportToExcel()


(Note by default without any additional code Export to CSV or PDF appears to be excluding the DetailItemTemplate)

 

Any idea?



Thanks



Glenn



Glenn
Top achievements
Rank 1
 answered on 30 Nov 2013
1 answer
181 views
Is it possible to fire an event when the radwindow is minimized?

Thankyou
dan
Shinu
Top achievements
Rank 2
 answered on 30 Nov 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?