Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
52 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
921 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
51 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
152 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
115 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
547 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
101 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
143 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
4 answers
155 views
Hi,

I have a Radgrid connected to an entitydatasource with a select button, the selected row is changed and highlighted when the row is clicked. However, when the select button is clicked the selected row is changed but the highlighting does not, it only changes when the row is clicked.

I need the selected row to be highlighted when either the row is clicked or the select button is clicked.

I am new to Telerik software, can anyone point me in the right direction.

Regards

Dave 
Dave
Top achievements
Rank 1
 answered on 13 Dec 2010
10 answers
127 views
Hello,
I am receiving a strange error when a user changes their RadCombobox selection more than once.  I have a user control that contains the RadComboBox and a label that is then placed inside of RadAjax panel then depending on the user's selection I hide and show other controls.  An issue is occuring after a user does the following:
1 - They can change the drop down selection once without an issue
2 - When they change the drop down selection a second time a JavaScript error occurs


Message: Object required
Line: 292
Char: 28
Code: 0
URI: https://secure.site.com/ScriptResource.axd?d=5ut_6SXy3r9CJ2AeDds-Izp-Bg0U7_3Wu8lOt1YeQI50q7gpperlCnkV19Nk2WLlaKx9WcQKWlUj5uVQFKbhmULObFseGkumXegL3O_oU1SM3Cc7S_2xpMbRUtFsca8OdmLluHRcPbmjWamXmckZiisXYrLQhE6PANVGzpcMFMD3OhJj0&t=634078171387790179

The script resource does exist, when I copy and paste the real URL content comes back:
Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadInputComponent=function(){Telerik.Web.UI.RadInputComponent.initializeBase(this);
this._inputs=new Array();
this._radInputExtender=null;
this._emptyMessage="";
this._errorMessage="";
this._emptyMessageCss="RadInputMgr_Default RadInput_Empty_Default";
this._readOnlyCss="RadInputMgr_Default RadInput_Read_Default";
this._invalidCss="RadInputMgr_Default RadInput_Error_Default";
this._hoveredCss="RadInputMgr_Default RadInput_Hover_Default";
this._enabledCss="RadInputMgr_Default RadInput_Enabled_Default";
this._focusedCss="RadInputMgr_Default RadInput_Focused_Default";
this._disabledCss="RadInputMgr_Default RadInput_Disabled_Default";
this._selectionOnFocus=Telerik.Web.UI.SelectionOnFocus.CaretToEnd;
this._targetControlIDs=null;
this._initializeOnClient=false;
this._isRequired=false;
this._validationGroup="";
this._validateOnEvent=2;
this._location="";
this._method="";
this._onTextBoxKeyPressDelegate=null;
this._onTextBoxBlurDelegate=null;
this._onTextBoxFocusDelegate=null;
this._onTextBoxMouseOutDelegate=null;
this._onTextBoxMouseOverDelegate=null
};
Telerik.Web.UI.RadInputComponent.prototype={initialize:function(){Telerik.Web.UI.RadInputComponent.callBaseMethod(this,"initialize");
var a;
...etc.
jgill
Top achievements
Rank 1
 answered on 13 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?