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

I have implemented the custom file browser as specified in the online resources. I am using shared paths like "\\172.0.0.0\images".

Everything else seem to work except for thumnails view.

I also tried cssclass - rfethumbnails but it doesn't help.

I have implemented all 4 methods that determine thumbnails for the images.

public override string GetFileName(string url)
        {
            string fileName = Path.GetFileName(RemoveProtocolNameAndServerName(url));
            return fileName;
        }
        public override string GetPath(string path)
        {

            // First add the '~/' signs in order to use the VirtualPathUtility.GetDirectory() method ;
            string PathWithTilde = "~/" + path;
            string virtualPath = VirtualPathUtility.GetDirectory(PathWithTilde);
            virtualPath = virtualPath.Remove(0, 2);// remove the '~' signs
            return virtualPath;            
        }
        /// <summary>
        /// Verify the file selected
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        
        public override Stream GetFile(string url)
        {
            string virtualPath = RemoveProtocolNameAndServerName(url);
            string physicalPath = this.GetPhysicalFromVirtualPath(virtualPath);
            if (physicalPath == null)
                return null;

            if (!File.Exists(physicalPath))
            {
                return null;
            }

            return File.OpenRead(physicalPath);
        }
        public override string StoreBitmap(System.Drawing.Bitmap bitmap, string url, System.Drawing.Imaging.ImageFormat format)
        {
            string virtualPath = RemoveProtocolNameAndServerName(url);
            string physicalPath = this.GetPhysicalFromVirtualPath(virtualPath);
            if (physicalPath == null)
                return string.Empty;

            StreamWriter bitmapWriter = StreamWriter.Null;

            try
            {
                bitmapWriter = new StreamWriter(physicalPath);
                bitmap.Save(bitmapWriter.BaseStream, format);
            }
            catch (IOException)
            {
                string errMessage = "The image cannot be stored!";
                return errMessage;
            }
            finally
            {
                bitmapWriter.Close();
            }
            return string.Empty;
        }

Vessy
Telerik team
 answered on 09 Apr 2014
1 answer
148 views
I have
<telerik:GridNumericColumn ID
                            DataField="PricePerUnit"  
                            HeaderText="Unit Price"
                            HeaderStyle-HorizontalAlign="Center"
                            UniqueName="PricePerUnit"
                            ItemStyle-HorizontalAlign="Right"
                            DataFormatString="<%$Resources: DataFormats, PRICE_WITH_DOLLAR %>"
                            ></telerik:GridNumericColumn>

I want to catch GridNumericColumn in code behind and set read-only = true;

My scenario is:
If( !theUser.CanEditPrice)
{
  //something like this   
  // myGrid.GetGridNumericColumn("PriceID").ReadOnly = true; // maybe i needed to set ColumnEditorID ?
}
Princy
Top achievements
Rank 2
 answered on 09 Apr 2014
3 answers
214 views
Hai,

Is it any other property for setting nocolor as Transperant color?

If i set Nocolor in the RadcolorPicker it always Display in Black Color
Please Guide me to do that.

Thanks,

Regards,
Sivakumar
Slav
Telerik team
 answered on 09 Apr 2014
3 answers
123 views
Hello ! 

I'm trying to ajaxify the filter textboxes of my grid, and only them, so I don't want to use the following option : 

<telerik:AjaxSetting AjaxControlID="Grid" >
 <UpdatedControls>
  <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel2"/>
 </UpdatedControls>
</telerik:AjaxSetting>

Ideally, I would like to use the solution below, but the filter textboxes don't have a defined Id, so this is not an option either : 

<telerik:AjaxSetting AjaxControlID="FilterTextBoxId" >
 <UpdatedControls>
  <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel2"/>
 </UpdatedControls>
</telerik:AjaxSetting>

The only option I found is this one : 

protected void GridOnItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
  if (e.Item is GridFilteringItem)
  {
    GridFilteringItem dataItem = e.Item as GridFilteringItem;
    TextBox filterBox = dataItem["MyfirstColumn"].Controls[0] as TextBox;
    AjaxManager.AjaxSettings.AddAjaxSetting(filterBox, Grid, LoadingPanel2);
  }
}

But for some reason it's not working, when I set a filter on my "MyfirstColumn" the entire page is reloaded, the ajaxsetting seems to be completely ignored by the process. 

Any idea of what could be the reason ?

Thanks for your help ! 

<telerik:AjaxSetting AjaxControlID="Grid" >
 <UpdatedControls>
  <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel2"/>
 </UpdatedControls>
</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="Grid" >
 <UpdatedControls>
  <telerik:AjaxUpdatedControl ControlID="Grid" LoadingPanelID="LoadingPanel2"/>
 </UpdatedControls>
</telerik:AjaxSetting>

Shinu
Top achievements
Rank 2
 answered on 09 Apr 2014
10 answers
267 views
Telerik Captcha is not displaying most of the time in IE. Also it is not generating any new image , it displays grey box when clicked on "Generate New Image". I have tested in IE 9.
Slav
Telerik team
 answered on 09 Apr 2014
1 answer
190 views
Good day,

We need help with the following problem:
We have a masterpage with 3 different contentplaceholders. One of these (the 'body' contentplaceholder) loads a simple page, which is basically straight from your radwindowmanager samples from here: http://demos.telerik.com/aspnet-ajax/window/examples/windowmanager/defaultcs.aspx

In this 'body' we have the a button:
 runat="server" OnCommand="openalert_Click"

In the cs

    protected void openalert_Click(Object sender, CommandEventArgs e)
    {
        ViewAlert(rwp, "test", rwp.Page);
    }

where the ViewAlert function is basically this:

public static RadWindowManager ViewAlert(RadWindowManager radWinmanager, String Warning = null, Page pTarget = null) {
  string radstrcommand = "radalert('" + Warning + "', 200, 200, 'Test', null);";
  System.Web.UI.ScriptManager.RegisterStartupScript(pTarget, pTarget.GetType(), "call_radalert", radstrcommand, true);
}

Our problem is that any and all attempts to successfully open a radalert after pressing of the button are met with failure.
Using firebug we know that
radWindow is undefined
and
GetRadWindowManager returns undefined
whenever the page reloads after the RegisterStartupScript

We conclude this to be a timing / load order issue of some sort, related to the load time of the radWindow in respect to the trigger of the RegisterStartupScript, but how are we supposed to solve it?
Is there perhaps a better approach to manage the RegisterStartupScript (we don't use ajax for this particular case since we need a postback)

Thanks in advance
Marin Bratanov
Telerik team
 answered on 09 Apr 2014
8 answers
787 views
Hi ...

Please give me a quick answer, I have an urgent requirement:
Is Radgrid always in ediatble mode?
I am using <telerik:GridEditCommandColumn> a one of my columns, will it make the grid to editable mode?

In which event can I restrict the mode to non-editable?

Please tell me where am I going wrong?

My markup code:


<

 

telerik:RadGrid ID="RadGrid1" runat="server"

 

 

AutoGenerateColumns ="false" OnNeedDataSource ="RadGrid1_NeedDataSource" OnInsertCommand ="RadGrid1_InsertCommand" EnableAJAX="True"

 

 

OnUpdateCommand ="RadGrid1_UpdateCommand" OnDeleteCommand ="RadGrid1_DeleteCommand" OnEditCommand ="RadGrid1_EditCommand" AllowPaging="True" >

 

 

 

<MasterTableView DataKeyNames="id" GridLines="None" Width="100%" EditMode="inplace" CommandItemDisplay ="Top" >

 

 

 

<Columns>

 

 

<telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="Delete">

 

 

</telerik:GridButtonColumn>

 

 

 

<telerik:GridTemplateColumn HeaderText="ProductID" UniqueName ="MultiColumnCombo" ItemStyle-Width="240px">

 

 

<ItemTemplate>

 

<%

#DataBinder.Eval(Container.DataItem, "prod_id")%>

 

 

</ItemTemplate>

 

 

 

<EditItemTemplate>

 

 

<telerik:RadComboBox runat="server"

 

 

ID="RadComboBox1"

 

 

DataTextField="id"

 

 

DataValueField="id"

 

 

HighlightTemplatedItems="true"

 

 

Height="190px"

 

 

Width="220px"

 

 

DropDownWidth="420px">

 

 

<HeaderTemplate >

 

 

<ul>

 

 

<li class="col1">ID </li>

 

 

<li class="col2">NAME</li>

 

 

<li class="col3">DESCRIPTION</li>

 

 

</ul>

 

 

</HeaderTemplate>

 

 

<ItemTemplate >

 

 

<ul>

 

 

<li class="col1"><%#DataBinder.Eval(Container.DataItem, "id")%></li>

 

 

<li class="col2"><%#DataBinder.Eval(Container.DataItem, "name")%></li>

 

 

<li class="col3"><%#DataBinder.Eval(Container.DataItem, "description")%></li>

 

 

</ul>

 

 

</ItemTemplate>

 

 

</telerik:RadComboBox>

 

 

</EditItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

 

<telerik:GridBoundColumn FilterControlWidth="50px" DataField="id" HeaderText="ID" SortExpression="id"

 

 

UniqueName="id" >

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn FilterControlWidth="50px" DataField="line_id" HeaderText="Line ID" SortExpression="line_id"

 

 

UniqueName="line_id" >

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn FilterControlWidth="50px" DataField="ship_date" HeaderText="SHIP DATE" SortExpression="ship_date"

 

 

UniqueName="ship_date" >

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn FilterControlWidth="50px" DataField="quantity" HeaderText="Quantity" SortExpression="quantity"

 

 

UniqueName="quantity" >

 

 

</telerik:GridBoundColumn>

 

 

 

<telerik:GridButtonColumn CommandName="MyCommand" ButtonType="ImageButton" UniqueName="ButtonColumn"></telerik:GridButtonColumn>

 

 

<telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn"

 

 

CancelText="Cancel" EditText="Edit">

 

 

<HeaderStyle Width="85px"></HeaderStyle>

 

 

</telerik:GridEditCommandColumn>

 

 

</Columns>

 

 

 

<ExpandCollapseColumn Visible="False">

 

 

<HeaderStyle Width="19px"></HeaderStyle>

 

 

</ExpandCollapseColumn>

 

 

<RowIndicatorColumn Visible="False">

 

 

<HeaderStyle Width="20px" />

 

 

</RowIndicatorColumn>

 

 

</MasterTableView>

 

 

<ClientSettings>

 

 

<ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick"

 

 

OnGridCreated="GridCreated" />

 

 

</ClientSettings>

 

 

</telerik:RadGrid>

help me plz.............

 

Pavlina
Telerik team
 answered on 09 Apr 2014
1 answer
125 views

It seems that the Font Face command does not actually fire, or at least does not insert its span with a font-family style, into the Content area of the RAD Editor until you actually start typing.  Therefore, if you select a font, then immediately use another command, such as Bold, the selected font is "forgotten".  When you  start typing, you will see that a <strong></strong> tag has been inserted, but the "font span" that should have been inserted when you selected a font is missing.

To reproduce the problem:

Select a font
Use any other control, such as Font Size or Bold
Notice the Font You chose has been reset
Begin Typing
Notice you are not typing in the font you selected.
Switch to HTML view, and notice that there is no <span style="font-family"> tag

I have tried injecting that "font span" immediately into the content area during the "OnClientCommandExecuting" event, when the command is "FontName".  Unfortunately, while this does insert the font span, it also puts the cursor AFTER the injected span, so when the user executes another command, such as Bold, the font selection still appears not to be effective.  To remedy THAT problem, I attempted to get a Range object from the current selection, manipulate its start/end, and then select it.  However, I could not make that strategy work reliably.

Help?

 

Ianko
Telerik team
 answered on 09 Apr 2014
3 answers
145 views
Hi,
I have a one RadModel Dialog window.. From that model window how can i open a regular(big) Radwindow?

Problem Is: New Radwindow opens only inside that Model window
Marin Bratanov
Telerik team
 answered on 09 Apr 2014
3 answers
1.1K+ views
I am using Telerik controls V2014.1.225.45 and am a newbie.

I am trying to update a TextBox that I have added as "hidden".  I am unsuccessful.  I've looked at most of the forums for help have not found how to correct this problem.

The text in the hidden text box is set to "a".  I am able to retrieve this value.  However, all variations of the set_text or set_value fail to change the value. 

Here is my Javascript code:

        <script type="text/javascript" id="Script1">
            //<![CDATA[

            function RadToolBar1_ButtonClicked(sender, args) {

                alert(args.get_item().get_level());
                if (args.get_item().get_level() == 1) {
                    alert(args.get_item().get_text());
                    var w = $find("<%= RadTextBox1.ClientID %>");
                    var wb = $get("<%= RadTextBox1.ClientID %>").value;
                    var wa = document.getElementById("<%= RadTextBox1.ClientID %>").style;
                    var x = $find("<%= RadPanelBar1.ClientID %>");
                    var x = document.getElementById("<%= RadPanelBar1.ClientID %>");
                    var y = document.getElementById("<%= RadPanelBar1.ClientID %>").style;
                    var y = document.getElementById("<%= RadPanelBar1.ClientID %>").style;
                    y.visibility = "hidden";
                    y.display = "none";
                    wa.display = "none";
                    wb.value = "hidden";
                    wb.set_value = "hidden";
                    w.set_textBoxValue = "hidden";
                    document.getElementById("<%= RadTextBox1.ClientID %>").set_textBoxValue = "hidden";
                    var v = document.getElementById("<%= RadTextBox1.ClientID %>").value;
                    alert(args.get_item().get_text());

            }

Marin Bratanov
Telerik team
 answered on 09 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?