Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
220 views
Hi,

since the documentation is a bit poor and I'm not willing to play around I simply ask it here.

How does RadBinaryImage resize images?
Does it use a "best fit" algorithm or does it simply "cut" the longer side?

What I mean with "best fit" is that an image is sized in a manner that it is as large as possible without loosing it's aspect ratio.
Example:
Max. Size 200, 200
Given Image: 300, 180 -- scaled to 200, 120
Given Image: 300, 400 - scaled to 150, 200
....

Regards
Manfred
Rosen
Telerik team
 answered on 05 Mar 2010
6 answers
431 views
I've looked everywhere I can think of and haven't found anything so if this has already been covered I apologize.

In the OnItemDataBound event of a listbox I've added a few attributes to each of the items.
protected void AgendaItems_ItemDataBound(object sender, RadListBoxItemEventArgs e) 
     DataRowView dataSourceRow = (DataRowView)e.Item.DataItem; 
     e.Item.Attributes.Add("Time", dataSourceRow["Expected_Time"].ToString()); 
}

what Im trying to do is access those attributes in the client side javascript events.  Is this possible?

my current attempt is
function AgendaItems_OnClientSelectedIndexChanged(sender,args){ 
    alert(sender.get_selectedItem().get_attributes().getAttribute("Time")); 
... obviously this isn't working?  Can somebody point me in the right direction?
Genady Sergeev
Telerik team
 answered on 05 Mar 2010
2 answers
238 views
Hi,

In an ASP.Net page, I am using a large amount of JS functions inside a RadScriptBlock element, to manipulate toolbar, tabstrip, panelbar ... on the client-side.
To easily maintain that, is there a way to load external javacript files containing these functions ?
I tried to used a <script type="text/javascript" src="script/myfunc.js"> inside the RadScriptBlock element, but that did not work : I got an error because JS methods are not found by server controls when executing ...

Cedric
Top achievements
Rank 1
 answered on 05 Mar 2010
3 answers
85 views
I want to use de column of type "DownloadAttachment" and I create the folow code in de aspx file. But when I associate this code in de "OnCommand" (client) of radgrid my code in RadGrid1_ItemDataBound breaks.

            function gridCommand(sender, args) {
                if (args.get_commandName() == "DownloadAttachment") {
                    var manager = $find('<%= RadAjaxManager.GetCurrent(Page).ClientID %>');
                    manager.set_enableAJAX(false);

                    setTimeout(function() {
                        manager.set_enableAJAX(true);
                    }, 0);
                }
            }              

        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if ((e.Item.ItemType == Telerik.Web.UI.GridItemType.Item) || (e.Item.ItemType == Telerik.Web.UI.GridItemType.AlternatingItem))
            {
                PackCRM.Entities.Documento _doc = (PackCRM.Entities.Documento)e.Item.DataItem;

                if (_doc.DocumentoLido)
                    e.Item.Font.Bold = false;
                else e.Item.Font.Bold = true;


                string docID = _doc.ID.ToString();
                string param = "docid=" + _doc.ID.ToString() + "&ext=" + _doc.Tipo.ToLower().Trim();
                string url = "preview/checkfile.aspx?" + param;

                ImageButton btnView = (ImageButton)e.Item.FindControl("btnView");
                btnView.OnClientClick = String.Format("OpenDialog('" + url + "')");
            }
        }

Why its ocurrs?
Help?
Tsvetoslav
Telerik team
 answered on 05 Mar 2010
1 answer
89 views
This has me stumped.  This is so easy to do with the defacto microsoft data grid control:


But I can't figure out how to do the same thing with Radgrid.  This has got to be so simple....


Shinu
Top achievements
Rank 2
 answered on 05 Mar 2010
4 answers
128 views
HI,
     I have a problem in hiding the column. The column width is not ajudged properly. I used the Fixed table width and also uses following resizing properties.
  <ClientSettings AllowColumnHide="True" AllowRowHide="True" AllowColumnsReorder="True"    
                    ReorderColumnsOnClient="True">     
                    <Resizing EnableRealTimeResize="True" ResizeGridOnColumnResize="True" AllowColumnResize="true"    
                        ClipCellContentOnResize="false"></Resizing>    
                </ClientSettings> 

Example: I have three columns, after hidng the first column from the grid the second column width and text is wrapped ir shrinked. The long line wrapped by two line with the dot marks at the end.Other columns is seemed ok. So i am not getting the exact width after hiding.

-Thanks

John John
Top achievements
Rank 1
 answered on 05 Mar 2010
1 answer
322 views

I am having trouble adding a GridEditCommandColumn or GridHyperLinkColumn to a grid control that is bound clientside via a web service. When I add either of these type columns the columns appear empty.

There are several search fields. When the user presses the Search button the form is submitted and on the server side, the grid is bound to a blank datasource. On the client side, the OnGridCreated event triggers a call to a web service that returns the data for the grid and then binds it. From there, all paging and sorting is done client side.

Here is what I think is the pertinent code. I am also including a screenshot showing part of the resulting grid.

The Grid:

 

<telerik:RadGrid ID="gridResults" runat="server" Visible="false" AutoGenerateColumns="false" EnableViewState="true" 
                 SkinID="CR"  GridLines="None" HeaderStyle-HorizontalAlign="left" PageSize="20"   
                 AllowAutomaticUpdates="false" OnUpdateCommand="gridResults_UpdateCommand"                                                                                                       
                 AllowPaging="True" PagerStyle-Position="Bottom" PagerStyle-Mode="NextPrev" AllowSorting="true">  
    <ClientSettings> 
        <ClientEvents OnGridCreated="gridResults_GridCreated" OnCommand="gridResults_Command" OnRowDataBound="RowDataBound" />                              
    </ClientSettings> 
 
    <MasterTableView DataKeyNames="ID" EnableNoRecordsTemplate="false" PagerStyle-AlwaysVisible="true" Visible="true" 
                     ShowFooter="false" AutoGenerateColumns="false"  AllowPaging="true" FooterStyle-Font-Bold="true" EditMode="PopUp"  > 
          
        <Columns>                                                                                                              
            <telerik:GridEditCommandColumn ButtonType="PushButton" UniqueName="EditTicket"></telerik:GridEditCommandColumn> 
            <telerik:GridHyperLinkColumn HeaderText="link" DataTextField="ID" DataNavigateUrlFields="ID" UniqueName="EditTicket" DataNavigateUrlFormatString="EditAsset.aspx?AssetID={2}"></telerik:GridHyperLinkColumn>                                      
                  
            <telerik:GridBoundColumn DataField="ID" HeaderText="Ticket #" SortExpression="ID" UniqueName="ID" HeaderButtonType="TextButton"><ItemStyle Wrap="false" /></telerik:GridBoundColumn>              
            <telerik:GridBoundColumn DataField="StatusName" HeaderText="Status" SortExpression="tsitil.StatusName" HeaderButtonType="TextButton"></telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Category" HeaderText="Category" SortExpression="tc.Code" HeaderButtonType="TextButton"></telerik:GridBoundColumn>                             
        </Columns> 
          
        <EditFormSettings EditFormType="Template" CaptionDataField="ID" CaptionFormatString="Change Status For Ticket: {0}" PopUpSettings-Modal="true">  
            <FormTemplate>                
                ...       
            </FormTemplate>           
        </EditFormSettings>       
    </MasterTableView>                        
</telerik:RadGrid> 

The Server Side Search Button:

 

protected void btnSearch_Click(object sender, EventArgs e)  
    {  
        //Here is where the search criteria are built and then written to javascript so they can be sent to the web service      
         
        gridResults.DataSource = new int[] { };  
        gridResults.DataBind();  
        gridResults.Visible = true;  
 
        return;  
    } 

The javascript that binds the results of the web service to the grid:

 

function UpdateGrid(result) {  
 
    var tableView = $find("<%= gridResults.ClientID %>").get_masterTableView();                               
    var objData = result["d"];  
    var count = objData["Count"];  
    tableView.set_virtualItemCount(count);  
                      
    tableView.set_dataSource(objData["Data"]);  
    tableView.dataBind();  
 


Is it possible to have an GridEditCommandColumn on a grid that is using client side binding? I am willing to have the popup edit do a postback but I would like to continue binding the grid client side. The Grid / Client Side demo shows that you can use a hyperlink column in a client side grid but I am not sure of the exact format I would need to return from my webservice. Does anyone know if this is documented somewhere? The important part though is to have a GridEditCommandColumn. Is this possible?

Thanks for any help,
Blake

Tsvetoslav
Telerik team
 answered on 05 Mar 2010
3 answers
171 views
Is it possible to assign a list of invalid characters to a RadInput so the user can't even enter them into the textbox?
Shinu
Top achievements
Rank 2
 answered on 05 Mar 2010
3 answers
121 views

Hello...

In radListView how can I set the filter expression with "StartsWith" Criteria.

I can't find any such xriteria in ur Live demos.

Similar to the "StartsWith" in radGrid I need a "StartsWith" criteria implementation in  radListView. Is it possible?

My requirement is to fetch those records from the database whose Names start with a particular alphabet, for instance:names which start with B

Please reply me soon.

-Liji Jose
Rosen
Telerik team
 answered on 05 Mar 2010
4 answers
222 views
Hi,

I have one radcomobobox, on its selectedindexchanged event, I am binding it with new values.
It is ok when I bind it first time, it do show the first item selected. But when the selectedindexchanged event fires, it still shows the previously selected item (only text, when I click on comobo, it shows the new item selected), even though I assign selected index every time on binding.

Below is a code of binding.

  for (i = 0; i <= dtable.Rows.Count - 1; i++) 
     { 
       DDEvent.Items.Add(new RadComboBoxItem("text", "value"); 
     } 
   DDEvent.SelectedIndex = 0 
 
 

I tried this too after the above code, but still not done.

      DDEvent.SelectedItem.Text = DDEvent.Items(0).Text
Mansi
Top achievements
Rank 1
 answered on 05 Mar 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?