Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
143 views
Hi,

We are using Telerik RadBinaryImage in our application, now I have a problem.

We create binary images dynamically and add them to a table cell. Depending on the number of images in the tabel cell we resize the images. Now the images that we add have the following conditions:

rbiImg.ResizeMode = Telerik.Web.UI.

BinaryImageResizeMode.Crop;

 

rbiImg.AutoAdjustImageControlSize =

false;

So when we resize the image it should be cropped.
We start out with an image 20px * 20px

We then resize the image to 10px * 20px and add an extra image also 10px * 20px (so in total we have 20 pixels * 20 pixels)

In the next round we resize the first image to 10x10 and the second 10x10 and add an extra image 10x20.

The second image is cropped correctly but the first image isn't cropped but it uses fit.

See the attached image:

You can see that the image (10x10) with the black has a different hatch style as the light grey image (10x10). Both images should look like the lightgrey image.

Is it because the original image (the one with the black background) was 20x20 and is at the end resized to 10x10 and the other image is resized from 10x20 to 10x10? They should be the same.

Any help would be appreciated.

Best regards Patrick

 

Rosen
Telerik team
 answered on 06 Jul 2010
1 answer
158 views
Hi,

I'm having an issue trying to get multiple events to fire within a RadGrid.  
What I'm  trying to accomplish:
1. I have a summary grid page with 5 out of 15 fields displaying in the grid.  I have set the editing to be inline since I only have a few items
2. I have a column with an image that by clicking the image the detail form with all 15 fields will display allowing the user to modify the detail form

How can this be accomplished?:

Thanks,

Here is my code - base:
C# Code for the grid item command:
  protected void dbgPolicyInformation_ItemCommand(object source, GridCommandEventArgs e) 
        { 
            if (null != e.Item) 
            { 
                switch (e.CommandName) 
                { 
                    case "Navigate"
                        string popupScript = "<script language='javascript'>" + "window.open('/vpcleads/vpcpolicies/vpcpolicyinformation.aspx', 'CustomPopUp', " + "'width=350, height=350, menubar=yes, resizable=no')" + "</script>"
                        ScriptManager.RegisterStartupScript(thisthis.GetType(), "PopupScript", popupScript,false); 
                        break
                } 
            } 
        } 

HTML Code
RAD WINDOW MANAGER: 
<telerik:RadWindowManager Behaviors="Close" runat="server" ID="AddPolicy" Opacity="90" 
        ShowContentDuringLoad="true" KeepInScreenBounds="true" VisibleStatusbar="false" 
        Modal="true" Width="500px" Height="700px" Skin="Office2007"
    </telerik:RadWindowManager> 
GRID OBJECT: 
 <telerik:RadGrid ID="dbgPolicyInformation" runat="server" AutoGenerateColumns="false" 
                                        OnNeedDataSource="dbgPolicyInformation_NeedDataSource" OnItemDataBound="dbgPolicyInformation_ItemDataBound" 
                                        OnInsertCommand="dbgPolicyInformation_InsertCommand" OnDeleteCommand="dbgPolicyInformation_DeleteCommand" 
                                        OnUpdateCommand="dbgPolicyInformation_UpdateCommand" OnCancelCommand="dbgPolicyInformation_CancelCommand" 
                                        OnItemCreated="dbgPolicyInformation_ItemCreated" Skin="Office2007" ShowFooter="true" 
                                        OnItemCommand="dbgPolicyInformation_ItemCommand"
                                        <MasterTableView Name="Policy" DataKeyNames="PolicyId,NewPolicyId" EditMode="InPlace" 
                                            CommandItemDisplay="Top" AllowMultiColumnSorting="True" CommandItemSettings-AddNewRecordText=""
                                            <Columns> 
                                                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Navigate" HeaderText="View Policy Details" 
                                                    Resizable="false" Reorderable="false" UniqueName="GoToLeadDetails" ImageUrl="~/Images/preview.gif" 
                                                    Text="View Policy Details" ButtonCssClass="pointerMouseCursor" Groupable="false"
                                                    <HeaderStyle Width="45px" HorizontalAlign="Center" /> 
                                                    <ItemStyle Width="45px" HorizontalAlign="Center" /> 
                                                </telerik:GridButtonColumn> 
                                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1" 
                                                    HeaderText="Quick Edit"
                                                    <HeaderStyle Width="20px" /> 
                                                    <ItemStyle CssClass="MyImageButton" /> 
                                                </telerik:GridEditCommandColumn> 
                                                <telerik:GridBoundColumn DataField="PolicyId" HeaderText="PolicyId" Visible="false"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="RenewalDate" HeaderText="Renewal Date"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company Name"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="PolicyNumber" HeaderText="Policy"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn DataField="MarketingSourceDesc" HeaderText="Marketing Source"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridButtonColumn ConfirmText="Delete This Policy?" ButtonType="ImageButton" 
                                                    CommandName="Delete" Text="Delete Policy" UniqueName="DeleteColumn1"
                                                    <HeaderStyle Width="20px" /> 
                                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" /> 
                                                </telerik:GridButtonColumn> 
                                            </Columns> 
                                        </MasterTableView>                                        
                                    </telerik:RadGrid> 
 
 

Yavor
Telerik team
 answered on 06 Jul 2010
1 answer
166 views
hello,

i want to help to find combobox  selected value in datalist(1), and the datalist(1) in datalist(2) using javascript and i want change the enable this combox when i check the checkbox in same location the combobox using javascript

thanks,
Shinu
Top achievements
Rank 2
 answered on 06 Jul 2010
1 answer
54 views
Hi.

The issue I have is a bit fiddly to explain.  We have styled our site using an IE filter to generate a background gradient.  This is defined in a stylesheet and applied via a masterpage.  Some of our pages make use of a RadWindow and the pages displayed within the RadWindow contain a Telerik TabStrip.  These pages also contain javascript to set the selected tab, as we use Response.Redirect to prevent repeating postback actions. 

It appears that the javascript is preventing the gradient filter being processed.  Curiously, this is only a problem on the inital load - if you perform a refresh / reload of the RadWindow content page, the gradient is correctly applied.

I have a sample project demonstrating the issue if required (thought I could attach it but apparently not...)
 
Any assistance would be appreciated.

Many thanks,

Keith.
Georgi Tunev
Telerik team
 answered on 06 Jul 2010
1 answer
123 views
I am attempting to dynamically change the ColumnEditor of a RadGrid based on if the value for that row is a TimeDate value or not.  As it stands right now, I am doing this in the OnEditCommand event by getting the value stored, checking if it can be parsed as a Date time, then either assigning the ColumnEditor to a custom TimePickerEditor or a custom TextColumnEditor.  This meaning that different rows can have different editors.

The issue is that when I switch from on row that has a timepicker to a row that has a texteditor, the viewstate is no longer valid and an exception is raised.  If I set EnableViewState to false, I cannot find a way to access those controls to get the new selected values from them.

At this point I am running in circles, any help or instruction on the proper way to adjust the columneditor per row would be appreciated.

Thanks,  Tyler
Tsvetoslav
Telerik team
 answered on 06 Jul 2010
3 answers
296 views
I have a RadGrid (I post the ASPX code below) and I want a different behavior in Edit/insert: when I enter in Edit mode I want AziendaRadCombobox to be disabled. Instead when I enter in Insert mode I want it Enabled. EditItemTemplate seems not to distinguish between edit and insert. Is there a simple way? Can you provide me a solution?

Thanks.

<telerik:RadGrid ID="RadGridAziendeForUser" runat="server" DataSourceID="ObjectDataSourceAziendeUtente" 
                EnableEmbeddedSkins="False" GridLines="None" Skin="MachinaWeb" AllowAutomaticUpdates="True" 
                AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowMultiRowSelection="True" 
                OnItemCommand="RadGridAziendeForUser_ItemCommand" OnItemDataBound="RadGridAziendeForUser_ItemDataBound" 
                AllowPaging="True" PageSize="5">  
                <ClientSettings EnablePostBackOnRowClick="True">  
                    <Selecting AllowRowSelect="True" /> 
                    <Scrolling EnableVirtualScrollPaging="True" ScrollHeight="200px" /> 
                </ClientSettings> 
                <MasterTableView AutoGenerateColumns="False" DataSourceID="ObjectDataSourceAziendeUtente" 
                    EditMode="InPlace" CommandItemDisplay="Top" DataKeyNames="IdUtente,IdAzienda" 
                    > 
                    <CommandItemTemplate> 
                        <div style="float: left;">  
                            <asp:LinkButton Text="Nuova Azienda" ID="Insert" runat="server" CommandName="InitInsert" /> 
                        </div> 
                    </CommandItemTemplate> 
                    <Columns> 
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="~/Images/ImagesGrid/Cancel.gif" 
                            EditImageUrl="~/Images/ImagesGrid/Edit.gif" UpdateImageUrl="~/Images/ImagesGrid/Update.gif" 
                            InsertImageUrl="~/Images/ImagesGrid/Update.gif" UniqueName="EditCommandColumn" ItemStyle-Width="40px">  
                            <ItemStyle Width="40px" /> 
                        </telerik:GridEditCommandColumn> 
                        <telerik:GridBoundColumn DataField="IdUtente" DataType="System.Int64" HeaderText="IdUtente" 
                            ReadOnly="True" SortExpression="IdUtente" UniqueName="IdUtente" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="IdUtenteAsp" HeaderText="IdUtenteAsp" SortExpression="IdUtenteAsp" 
                            UniqueName="IdUtenteAsp" DataType="System.Guid" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" ReadOnly="True" 
                            SortExpression="UserName" UniqueName="UserName" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="IdCultura" DataType="System.Int64" HeaderText="IdCultura" 
                            ReadOnly="True" SortExpression="IdCultura" UniqueName="IdCultura" Visible="false">  
                        </telerik:GridBoundColumn> 
                        <telerik:GridTemplateColumn> 
                            <HeaderTemplate> 
                                <asp:Label ID="Label46" runat="server" Text="Azienda" Width="130px"></asp:Label> 
                            </HeaderTemplate> 
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="AziendaRadComboBox" runat="server" DataSourceID="ObjectDataSourceAzienda" 
                                    DataTextField="NomeAzienda" DataValueField="IdAzienda" SelectedValue='<%# Bind("IdAzienda") %>' 
                                    Width="120px" Enabled="false" /> 
                            </EditItemTemplate> 
                            <ItemTemplate> 
                                <asp:Label ID="Label47" runat="server" Width="120px" Text='<%# Bind("Azienda") %>'></asp:Label> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridTemplateColumn> 
                            <HeaderTemplate> 
                                <asp:Label ID="Label48" runat="server" Text="Cultura" Width="80px"></asp:Label> 
                            </HeaderTemplate> 
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="CulturaRadComboBox" runat="server" DataSourceID="ObjectDataSourceCultura" 
                                    DataTextField="Cultura" DataValueField="IdCultura" SelectedValue='<%# Bind("IdCultura") %>' 
                                    Width="70px" /> 
                            </EditItemTemplate> 
                            <ItemTemplate> 
                                <asp:Label ID="Label50" runat="server" Width="70px" Text='<%# Bind("Cultura") %>'></asp:Label> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridTemplateColumn> 
                            <HeaderTemplate> 
                                <asp:Label ID="Label49" runat="server" Text="Gruppo" Width="130px"></asp:Label> 
                            </HeaderTemplate> 
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="GruppoRadComboBox" runat="server" DataSourceID="ObjectDataSourceGruppoUtente" 
                                    DataTextField="Nome" DataValueField="IdGruppoUtente" SelectedValue='<%# Bind("IdGruppo") %>' 
                                    Width="120px" /> 
                            </EditItemTemplate> 
                            <ItemTemplate> 
                                <asp:Label ID="Label51" runat="server" Text='<%# Bind("Gruppo") %>' Width="120px"></asp:Label> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridTemplateColumn> 
                            <HeaderTemplate> 
                                <asp:Label ID="Label52" runat="server" Text="Stabilimento" Width="130px"></asp:Label> 
                            </HeaderTemplate> 
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="StabilimentoRadComboBox" runat="server" DataSourceID="ObjectDataSourceStabilimento" 
                                    DataTextField="Denominazione" DataValueField="IdStabilimento" SelectedValue='<%# Bind("IdStabilimento") %>' 
                                    Width="120px" /> 
                            </EditItemTemplate> 
                            <ItemTemplate> 
                                <asp:Label ID="Label53" runat="server" Text='<%# Bind("Stabilimento") %>' Width="120px"></asp:Label> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridTemplateColumn> 
                            <HeaderTemplate> 
                                <asp:Label ID="Label54" runat="server" Text="Reparto" Width="130px"></asp:Label> 
                            </HeaderTemplate> 
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="RepartoRadComboBox" runat="server" DataSourceID="ObjectDataSourceReparto" 
                                    DataTextField="Reparto" DataValueField="IdReparto" SelectedValue='<%# Bind("IdReparto") %>' 
                                    Width="120px" /> 
                            </EditItemTemplate> 
                            <ItemTemplate> 
                                <asp:Label ID="Label55" runat="server" Text='<%# Bind("Settore") %>' Width="120px"></asp:Label> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridButtonColumn CommandName="Delete" ImageUrl="~/Images/ImagesGrid/Delete.gif" 
                            UniqueName="DeleteColumn" ConfirmText="Do you really want to delete the selected row?" 
                            ButtonType="ImageButton" /> 
                    </Columns> 
                    <EditFormSettings> 
                        <EditColumn> 
                        </EditColumn> 
                    </EditFormSettings> 
                </MasterTableView> 
                <FilterMenu EnableEmbeddedSkins="False">  
                </FilterMenu> 
                <HeaderContextMenu EnableEmbeddedSkins="False">  
                </HeaderContextMenu> 
            </telerik:RadGrid> 
Princy
Top achievements
Rank 2
 answered on 06 Jul 2010
2 answers
106 views
Hi Telerik,

I cannot expand node when I set Enabled = false in ComboBox

Here is my Code

<script type="text/javascript" language="javascript"
            function nodeClicking(sender, args) { 
                var comboBox = $find("<%= RadComboBox1.ClientID %>"); 
 
                var node = args.get_node() 
 
                comboBox.set_text(node.get_text()); 
 
                comboBox.trackChanges(); 
                comboBox.get_items().getItem(0).set_value(node.get_value()); 
                comboBox.commitChanges(); 
 
                comboBox.hideDropDown(); 
            } 
 
            function OnClientDropDownOpenedHandler(sender, eventArgs) { 
                var tree = sender.get_items().getItem(0).findControl("RadTreeView1"); 
                var selectedNode = tree.get_selectedNode(); 
                if (selectedNode) { 
                    selectedNode.scrollIntoView(); 
                } 
            } 
        </script> 


    <form id="form1" runat="server"
    <div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
        <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="100%" OnClientDropDownOpened="OnClientDropDownOpenedHandler"
            <Items> 
                <telerik:RadComboBoxItem Text="None" Value="0" /> 
            </Items> 
            <ItemTemplate> 
                <telerik:RadTreeView ID="RadTreeView1" runat="server" OnClientNodeClicking="nodeClicking"
                    <Nodes> 
                        <telerik:RadTreeNode runat="server" Text="Africa" Expanded="true"
                            <Nodes> 
                                <telerik:RadTreeNode runat="server" Text="Egypt" Enabled="false"
                                    <Nodes> 
                                        <telerik:RadTreeNode runat="server" Text="Cairo"
                                        </telerik:RadTreeNode> 
                                    </Nodes> 
                                </telerik:RadTreeNode> 
                                <telerik:RadTreeNode runat="server" Text="South Africa"
                                    <Nodes> 
                                        <telerik:RadTreeNode runat="server" Text="Cape Town"
                                        </telerik:RadTreeNode> 
                                    </Nodes> 
                                </telerik:RadTreeNode> 
                                <telerik:RadTreeNode runat="server" Text="Kenya"
                                    <Nodes> 
                                        <telerik:RadTreeNode runat="server" Text="Nairobi" Value="1999"
                                        </telerik:RadTreeNode> 
                                    </Nodes> 
                                </telerik:RadTreeNode> 
                            </Nodes> 
                        </telerik:RadTreeNode> 
                    </Nodes> 
                </telerik:RadTreeView> 
            </ItemTemplate> 
        </telerik:RadComboBox> 
     
    </div> 
    </form> 

Please help me to expand node when disabled
VnDevil
Top achievements
Rank 2
 answered on 05 Jul 2010
4 answers
160 views
My application looks like this :

There is a radSplitter with two panes, and the bottom pane contains a radEditor and is collasped at startup. I have a radAjaxManager that update the radEditor, and this javascript function :
function scriptError() { 
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
            ajaxManager.ajaxRequest("x"); 
        } 

Now the ajax request looks like this :
If e.Argument.Equals("x"Then 
    RadEditor1.Content = "<br /><p>Some Text...</p>" 
End If 

It's working fine as a web application in internet explorer, but I'm rendering this page in a webbrowser control of a winForm application and I'm calling the script on a button click :
WebBrowser1.Document.InvokeScript("scriptError"New Object() {}) 

Up to this, no error. It is when I close the application that a strange javascript error appear ("_events is null or not an object ......"). The error only appear when the bottom pane is collasped???

I'm quite new to web programming so it is possible that there is a logic error in my programming, but have totally no idea why it is causing this.

Thanks
Sébastien
Top achievements
Rank 1
 answered on 05 Jul 2010
1 answer
74 views
I'm having a problem when exporting my grid.  All the styles are being lost.  I am using the out of the box WebBlue skin and in the page i can see that the styles are being set in the grid.  However, everytime I export to Excel, Word, etc all the styles are lost.  Is there a workaround or a property I need to set..?
Daniel
Telerik team
 answered on 05 Jul 2010
1 answer
123 views
Hi,

        I am using a radwindow with modal background. I have a requirement to make the window float when the page is scrolled. I referred the scripts from this link,
http://www.telerik.com/community/code-library/aspnet-ajax/window/floating-r-a-d-window-on-page-scroll-window-stays-visible-during-scrolling.aspx
Find below the style and scripts,

<head runat="server"
    <title>Untitled Page</title> 
    <style type="text/css"
    html, body, form 
    { 
      padding: 0px; 
      margin: 0px; 
      height: 100%; 
      width: 100%; 
    } 
     
    .RadWindow 
    { 
        position: fixed !important; 
 
    } 
    </style> 
</head> 
<script type="text/javascript"
            function GetSelectedWindow() 
            { 
                var oManager = GetRadWindowManager(); 
                return oManager.getActiveWindow();       
            } 
             
            function PositionWindow ()  
            { 
           
                var oWindow = GetSelectedWindow();   
                if (!oWindow) { 
                    return
                } 
                 
                var Y = document.body.clientHeight +  
                        document.body.scrollTop -  
                        oWindow.get_height(); 
                 
                var X = document.body.clientWidth +  
                        document.body.scrollLeft -  
                        oWindow.get_width(); 
 
                Y = (Y > 0) ? Y : 0; 
                X = (X > 0) ? X : 0;                     
                oWindow.moveTo(X, Y); 
            } 
 
            function InitWindow ()  
            { 
                setTimeout(function() 
                { 
                    var oWindow = GetRadWindowManager().getActiveWindow();   
                    if (!oWindow)  
                    { 
                        window.setTimeout('InitWindow()', 500); 
                    } 
 
               PositionWindow();}, 0); 
            } 

But the script is not working only in IE 6. This problem is because of the css property position : fixed. But when i tried removing, the scripts are not working. Please help with the code changes to make it work on all browsers including IE 6 mainly.

Regards,
Saravanan K
 

Svetlina Anati
Telerik team
 answered on 05 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?