Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
76 views
Hello Friends,

I am planning to add images in place of the expanders which are present in the RadTreeView control.

I want to accomplish my task using C#.

Any help would be appreciated.
Thanks.


Best Regards,
Ruchit


Dimitar Terziev
Telerik team
 answered on 14 Dec 2010
3 answers
204 views
I have a hierarchical grid and when i am exporting it to excel, resulted excel contains not working hyperlinks in header row.
I need to remove these links and need to show as a normal text header.
In my rad grid sorting is enabled.

Please give me a solution how to replace header.
madu
Top achievements
Rank 1
 answered on 14 Dec 2010
2 answers
72 views
Hi,
I'm using the classic AJAX controls (as required by the client for the project upon which I am working - not negotiable).

I am having trouble rendering a RadDatePicker.
The end of the control is not being rendered correctly (I am unable to upload a picture owing to my office's lockdown on uploads).
The table cell in which the RadDatePicker is housed is much wider than the control itself, so it should not be getting cut off.

Does anyone recognise this symptom and have any suggestions as to how I can get the control to render correctly.

Cheers
David
Top achievements
Rank 1
 answered on 14 Dec 2010
12 answers
985 views
Hi,
When I am trying to make the Rad grid header static by setting "UseStaticHeaders = true", the grid columns automatically shrinks to the length of data present in the particular cell and hence the total width of the grid also decreases. But the width of the grid and column remains intact if I remove the property. Again when the "AllowScroll" is true and there is not enough rows so that the scrollbar  will appear, a small gap (exactly width of the scrollbar) between the grid and the panel which contains the grid  is coming. I have given the grid width as 100% and column width in % also. Please let me know if any property settings missing or any solution.

Thanks.
JK
Dimo
Telerik team
 answered on 14 Dec 2010
1 answer
66 views
I would like to know if there is way to get my nested view to expand when a user clicks on a row instead of clicking on the little arrow on the left?
Princy
Top achievements
Rank 2
 answered on 14 Dec 2010
1 answer
180 views
Dear all

I want a Panel Container like those in the pictures below:

Sample 1

Sample 2

Does Rad Controls for ASP.NET AJAX has sth like that ?

Regards,
Shinu
Top achievements
Rank 2
 answered on 14 Dec 2010
1 answer
155 views
I have a grid that uses a form template for edit and insert.  I would like to change the heading in the grid to reflect that the user is doing.  How to I determine which mode I am in.  I have found .IsInEditMode but this is true if in insert or edit.
Princy
Top achievements
Rank 2
 answered on 14 Dec 2010
4 answers
600 views

Hi,

Does anyone have any recent examples of saving and retrieving images to/from a database? I'm using visual Studio 2008, Sql 2008 and ASP.Net AJAX Q3 2010 NET35 .

I'm using varbinary(MAX) to store the image stream and I store the contenttype and filesize in the database as well.

This is what I'm doing to save the image:

Private Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click
        If Page.IsValid Then
            Dim oProduct As New Product
            Dim iProductID As Integer = CInt(hdnProductID.Value)
            oProduct = ProductBL.GetProductByID(iProductID)
            oProduct.Name = txtName.Text.Trim
            oProduct.Description = txtDescription.Text.Trim
            Dim imgStream As Stream = fleUpload.PostedFile.InputStream
            oProduct.Filename = fleUpload.PostedFile.FileName
            oProduct.ContentType = fleUpload.PostedFile.ContentType
            oProduct.Filesize = fleUpload.PostedFile.ContentLength
            Dim imgData(oProduct.Filesize) As Byte
            oProduct.imgContent = imgData
  
            Dim oProductBL As New ProductBL
            If oProductBL.Save(oProduct) > 0 Then
                '== Show save message
            Else
                '== Show error message
            End If
        End If
  
    End Sub

Everything saves to the database without errors...but when I view the page I get an error.
This is my RadGrid:

<telerik:RadGrid ID="gridProducts" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" GridLines="None" 
        Skin="Outlook" width="675px">
        <MasterTableView allowcustompaging="True">
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
        <RowIndicatorColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
  
        <ExpandCollapseColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
          <Columns>
            <telerik:GridTemplateColumn HeaderText="Item" UniqueName="Item">
              <ItemTemplate>
                <telerik:RadBinaryImage ID="rbiItem" runat="server" />
              </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Item Description" UniqueName="ItemDescription">
              <ItemTemplate>
                <asp:Label ID="lblItem" runat="server" Text=""></asp:Label>
                <br />
                <asp:Label ID="lblDescription" runat="server" Text=""></asp:Label>
              </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Price" UniqueName="Price">
              <ItemTemplate>
                <asp:Label ID="lblPrice" runat="server" Text=""></asp:Label>
              </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Add to Cart">
              <ItemTemplate>
                <asp:ImageButton ID="imgCart" OnCommand="imgCart_Command" CommandName="Add" runat="server" />
              </ItemTemplate>
            </telerik:GridTemplateColumn>
          </Columns>
        </MasterTableView>
        <ClientSettings>
          <Selecting AllowRowSelect="True" />
        </ClientSettings>
      </telerik:RadGrid>

I'm trying to retrieve the image into the RadBinaryImage control rbiItem.
This is how I retrieve the images into a gridview:

Private Sub LoadGrid()
gridProducts.DataSource = ProductBL.GetActiveProducts
gridProducts.DataBind()
End Sub
  
Private Sub gridProducts_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gridProducts.ItemDataBound
        If (TypeOf (e.Item) Is GridDataItem) Then
            Dim dr As PawnShop.Entities.Product = CType(e.Item.DataItem, PawnShop.Entities.Product)
  
            Dim lblItem As Label = CType(e.Item.FindControl("lblItem"), Label)
            lblItem.Text = dr.Name
  
            Dim lblDescription As Label = CType(e.Item.FindControl("lblDescription"), Label)
            lblDescription.Text = dr.Description
  
            Dim lblPrice As Label = CType(e.Item.FindControl("lblPrice"), Label)
            lblPrice.Text = String.Format(Constants.CURRENCY, dr.Price)
  
            Dim imgCart As ImageButton = CType(e.Item.FindControl("imgCart"), ImageButton)
            imgCart.ImageUrl = "~/images/shoping_cart_sm.png"
            imgCart.CommandArgument = dr.ProductID.ToString
            imgCart.CommandName = "Add"
                                '==Get the image from the database
            Dim rbiItem As RadBinaryImage = CType(e.Item.FindControl("rbiItem"), RadBinaryImage)  
            Response.ContentType = dr.ContentType
            rbiItem.DataValue = CType(dr.imgContent, Byte())
        End If
    End Sub
And this is the error I get:
Server Error in '/' Application.
--------------------------------------------------------------------------------
  
Parameter is not valid. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.ArgumentException: Parameter is not valid.
  
Source Error: 
  
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  
  
Stack Trace: 
  
  
[ArgumentException: Parameter is not valid.]
   System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData) +1062379
   System.Drawing.Image.FromStream(Stream stream) +8
   Telerik.Web.UI.ImageFilterHelper.CreateImgFromBytes(Byte[] image) +99
  
[ArgumentException: The provided binary data may not be valid image or may contains unknown header]
   Telerik.Web.UI.ImageFilterHelper.CreateImgFromBytes(Byte[] image) +173
   Telerik.Web.UI.RadBinaryImage.AutoAdjustImageElementSize(Byte[] dataValue) +51
   Telerik.Web.UI.RadBinaryImage.ProcessImageData() +188
   Telerik.Web.UI.RadBinaryImage.OnPreRender(EventArgs e) +41
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
  
   
  
  
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4955

Does this mean that I'm not storing it correctly or am I not retrieving it correctly?

Can anyone help me on this?
Thanks
Rob Venable
Top achievements
Rank 1
 answered on 14 Dec 2010
4 answers
119 views

I really like the ConfirmDialogType="RadWindow" of the GridClientDeleteColumn
 and I have repurposed the Filter row as a add to grid row via other column's FilterTemplates

so instead of:

"

 

 

 

<telerik:GridTemplateColumn>

 

 

<ItemTemplate>

 

 

 

 

<asp:LinkButton ID="DeleteButton" runat="server" CommandName="Delete" OnClientClick="return Confirm('Do you really want to delete this?');"><img style="border:0px;vertical-align:middle;" alt="Delete" src="Images/Delete.png" /></asp:LinkButton>

 

 

 

 

</ItemTemplate>

 

 

 

<FilterTemplate>

 

 

 

 

<asp:LinkButton ID="AddButton" runat="server" CommandName="Add"><img style="border:0px;vertical-align:middle;" alt="Add" src="Images/Add.png" /></asp:LinkButton>

 

 

 

 

</FilterTemplate>

 

 

 

 

</telerik:GridTemplateColumn>

 

 

 

 

 

"
I want to:

"

 

<

 

telerik:GridClientDeleteColumn ConfirmDialogType="RadWindow" ButtonType="ImageButton" HeaderText="Delete" ConfirmText="Do you really want to delete this?"   ImageUrl="Images/Delete.png" UniqueName="Delete" >
<FilterTemplate>

 

 

 

 

<asp:LinkButton ID="AddButton" runat="server" CommandName="Add"><img style="border:0px;vertical-align:middle;" alt="Add" src="Images/Add.png" /></asp:LinkButton>

 

 

 

 

</FilterTemplate>

</telerik:GridClientDeleteColumn>
"

but nothing shows when its a GridClientDeleteColumn, Any ideas?

kavitha
Top achievements
Rank 1
 answered on 14 Dec 2010
2 answers
182 views
2009.3.1503.35

<meta http-equiv="x-ua-compatible" content="IE=8" />

On my page I indicated to be compatible with IE8, however if the user forces the setting to "Display all websites in Compatibility View" then the Upload's add/select button will not do anything when clicked.

Is this the expected behavior or fixed in later version of Upload?

Update:  My page has this, if this exists plus in Compatibility View is turned on, then [Select] doesn't do anything.
    <meta http-equiv="x-ua-compatible" content="IE=8" />

                    <telerik:RadUpload ID="myUpload" runat="server" InputSize="80" Width="700px" Skin="Simple"  
                        ControlObjectsVisibility="RemoveButtons"  
                        AllowedFileExtensions=".msg,.mht,.txt,.pdf,.htm,.html,.doc,.docx,.xlsx,.xls,.pptx,.ppt,.gif,.jpg,.tif" 
                        OnClientFileSelected="checkExtension"     
                        OnClientDeleting="OnClientDeletingHandler" 
                        OnClientDeletingSelected="OnClientDeletingSelectedHandler"
                    </telerik:RadUpload>  

Chris
Top achievements
Rank 1
 answered on 14 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?