Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
193 views
Hi,

Is there a way to get the CommandName and CommandArgument of a RadRibbonButton in client side script?

I found a reference in http://www.telerik.com/community/forums/aspnet-ajax/ribbonbar/disabling-button-in-client-side-script.aspx#0
but I'm not sure if this is server side or client side.

Regards,
  Peter
Shinu
Top achievements
Rank 2
 answered on 12 Dec 2013
2 answers
130 views
HI
I have an image cropping issue in telerik image editor.
An script error occurs when Crop button click in Dialog Box.
And cropping does not work.
It only resize the image.

I doesn't use session at image editing and loading.

dll file version : 2013.2.611.35

<< aspx page >>
-------------------------------------------------------------------------------------------------

<telerik:RadImageEditor runat="server" ID="RadImageEditor1" Visible="false" OnImageEditing="RadImageEditor1_ImageEditing" CanvasMode="No" OnImageLoading="RadImageEditor1_ImageLoading" ShowAjaxLoadingPanel="true" ImageCacheStorageLocation="Session">
  <Tools>
   <telerik:ImageEditorToolGroup>
                <telerik:ImageEditorTool CommandName="Save" Text="Image Apply"/>
       <telerik:ImageEditorToolSeparator />
       <telerik:ImageEditorToolStrip CommandName="Reset" Text="Reset" />
       <telerik:ImageEditorToolStrip CommandName="Undo" Text="Undo" />
       <telerik:ImageEditorToolStrip CommandName="Redo" Text="Redo" />
       <telerik:ImageEditorToolSeparator />
       <telerik:ImageEditorTool CommandName="Crop" />
       <telerik:ImageEditorTool CommandName="Resize" />
       <telerik:ImageEditorTool CommandName="Zoom" />
       <telerik:ImageEditorTool CommandName="ZoomIn" />
       <telerik:ImageEditorTool CommandName="ZoomOut" />
       <telerik:ImageEditorTool CommandName="Opacity" />
       <telerik:ImageEditorTool CommandName="Rotate" />
       <telerik:ImageEditorTool CommandName="RotateRight" />
       <telerik:ImageEditorTool CommandName="RotateLeft" />
       <telerik:ImageEditorTool CommandName="Flip" />
       <telerik:ImageEditorTool CommandName="FlipVertical" />
       <telerik:ImageEditorTool CommandName="FlipHorizontal" />
       <telerik:ImageEditorTool CommandName="AddText" />
   </telerik:ImageEditorToolGroup>
  </Tools>    
     </telerik:RadImageEditor>

-------------------------------------------------------------------------------------------------


<< aspx.cs page >>
path  ex )   D:\dpimage\temp\editor\2013\10\31\14\428606850_20131031144126.jpg
-------------------------------------------------------------------------------------------------

protected void RadImageEditor1_ImageLoading(object sender, ImageEditorLoadingEventArgs args)
        {
            args.Image = new EditableImage(path);
            args.Cancel = true;
        }

protected void RadImageEditor1_ImageEditing(object sender, ImageEditorEditingEventArgs args)
        {
            args.Cancel = true;

            try
            {
                string d = DateTime.Now.ToString("yyyy-MM-dd-HH").Replace("-", "\\");
                path = imagePath(source);

                var thumbImage = args.Image.Clone();

                var ms = new MemoryStream();
                thumbImage.Image.Save(ms, thumbImage.RawFormat);

                File.WriteAllBytes(path, (byte[])ms.ToArray());

                result_url = path.Replace(RootPath, dpimage_url).Replace("\\", "/");

                args.Argument = "OK," + result_url;
            }
            catch (Exception ex)
            {
                args.Argument = ex.Message + ", ";
                throw ex;
            }
        }
-------------------------------------------------------------------------------------------------

Arron
Top achievements
Rank 1
 answered on 12 Dec 2013
5 answers
165 views
Hi,
i am having grid in which i am doing delete ,
for first record delete its working fine but for second time it is not getting the id of hide column,
so where do i hide column
my code is
protected void RadGrid1_PreRender(object sender, EventArgs e)
   {
       RadGrid1.MasterTableView.GetColumn("UserId").Visible = false;
       RadGrid1.MasterTableView.GetColumn("EntityId").Visible = false;
   }
 
 
protected void RadGrid1_DeleteCommand(object sender, GridCommandEventArgs e)
   {
       GridEditableItem DeleteEmployee = e.Item as GridEditableItem;
       Hashtable NewValues = new Hashtable();
       e.Item.OwnerTableView.ExtractValuesFromItem(NewValues, DeleteEmployee);
       int EntityId = Convert.ToInt32(DeleteEmployee.GetDataKeyValue("EntityId"));
       int UserId = Convert.ToInt32(NewValues["UserId"].ToString());
       ObjGlobas.DeleteEmployeePermission(UserId,EntityId);
       RadGrid1.Rebind();
       RadWindowManager1.RadAlert("Employee Permission Deleted Successfully!", 325, 200, "Manifest-BI : DELETE", null);
 
   }
Thanks
Shinu
Top achievements
Rank 2
 answered on 12 Dec 2013
3 answers
141 views
Hello....
my name is sondang, i am a newbie in Telerik.
Can the master told me to make CRUD(Creat, Update, Delete) by Telerik.
I might along with examples of its programs.

Thank you


Princy
Top achievements
Rank 2
 answered on 12 Dec 2013
1 answer
106 views

Below is my sample code where the first menu on click is not redirecting,

<telerik:RadMenu ID="RadMenu1" runat="server" EnableRoundedCorners="true" EnableShadows="true"
        ClickToOpen="true">
        <Items>
            <telerik:RadMenuItem>
                <ItemTemplate>
                    <a class="rmLink" href="http://www.google.com"><span class="rmText">This is the root item</span></a>
                </ItemTemplate>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Text="Edit" AccessKey="E">
                <Items>
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/21undo.gif" Text="Undo" AccessKey="U" />
                    <telerik:RadMenuItem IsSeparator="True" />
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/cut.png" Text="Cut" AccessKey="T" />
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/copy.png" Text="Copy" AccessKey="C" />
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/paste.png" Text="Paste" AccessKey="P" />
                    <telerik:RadMenuItem ImageUrl="~/Menu/Images/23clipboard.gif" Text="Clipboard..."
                        AccessKey="b" />
                    <telerik:RadMenuItem IsSeparator="True" />
                </Items>
            </telerik:RadMenuItem>
        </Items>
    </telerik:RadMenu>
Tried my best but didn't find any solution. 

Anyone have solution ? Looking for help !

Thanks,
Stalin

Princy
Top achievements
Rank 2
 answered on 12 Dec 2013
1 answer
130 views

I don't understand why this works:



$find("<%=MyDate.ClientID%>").set_selectedDate('Tue Dec 3 00:00:00 PST 2013');


But, this doesn't:

$find("<%=MyDate.ClientID%>").set_selectedDate('12/3/2013');




Shinu
Top achievements
Rank 2
 answered on 12 Dec 2013
5 answers
183 views
I'm struggling to get a working version of the checkbox filter process.  I write in VB.net.
I have created a web service asmx file but the code in it is never executed.  The code stops in the Javascript with a null object.  Specifically "d" and "f" in the following code blocks are null.
Additonally, the asmx file cannot be referenced by a project as the RadListBoxItemData is a dictionary object which is not supported. This would prevent the service file being part of a services project (my prefered design).

Do you have a working example project written in VB that I could view?

this._filterCancelButton=$telerik.getElementByClassName(this._filterMenu.get_element(),"rgFilterCancel");
this._checkListFilterCancelButtonDelegate=$telerik.addMobileHandler(this,this._filterCancelButton,"click",this._checkListFilterCancelButtonHandler);
}}if(this._checkListFilterKeys&&this._checkListFilterKeys.length>0){this.updateClientState();
}if(this._filterCheckListClientID){var d=$find(this._filterCheckListClientID);
this._checkListItemsRequestedDelegate=Function.createDelegate(this,this._checkListItemsRequestedHandler);
 
d.add_itemsRequested(this._checkListItemsRequestedDelegate);
 
d.add_itemChecked(Function.createDelegate(this,function(m,l){if(m.selectAllFlag){return;
}m.selectAllFlag=true;
if(l.get_item().get_text()=="(Select All)"){if(l.get_item().get_checked()){m.get_items().forEach(function(n){n.check();
});
if(this._filterCheckListClientID){var f=$find(this._filterCheckListClientID);
this._checkListFilterActiveColumn=a;
 
f.get_items().clear();
 
if(a._owner._data.CheckListWebServicePath&&a._data.FilterCheckListWebServiceMethod){f.set_visible(true);
f.get_webServiceSettings().set_path(a._owner._data.CheckListWebServicePath);
f.get_webServiceSettings().set_method(a._data.FilterCheckListWebServiceMethod);
Joan
Top achievements
Rank 1
 answered on 11 Dec 2013
4 answers
185 views
Hello,

I have problem in border width in RadScheduler. I set the color as well as width below in AppointmentDataBound event:

e.Appointment.BorderColor = System.Drawing.Color.FromName(e.Appointment.Attributes["VisitTypeColorName"].ToString());
                e.Appointment.BorderStyle = BorderStyle.Solid;
                e.Appointment.BorderWidth = Unit.Pixel(10);

But appointment border width is still small. And this e.Appointment.Attributes["VisitTypeColorName"].ToString() is come from the database. It get the color from the database.
I am attach the file and mark the appointment in image which border color show.

Please help me as soon as possible.
Thanks.

Jiten Mutum
Sean
Top achievements
Rank 2
 answered on 11 Dec 2013
1 answer
858 views
I need to run some javascript code every time on page load, after Telerik Ajax controls are rendered on client. I tried to use this code:
Sys.Application.add_load(SetFocusToField);

function SetFocusToField() {
 
    if (indexToFocus == 0 && controlToFocus) {
        controlToFocus.focus();
        indexToFocus++;
    }
}
It works fine for the first time (regular page load) but on a partial postback this code doesn't run. I understand why it doesn't work but how can I call this javascript function on partial postbacks?

I tried to use RegisterStartupScript but it doesn't work for me too :(

string scriptFocus = @"
     
    ResetIndexOnFocus = 0;
    SetFocusToField();
 
";
ScriptManager.RegisterStartupScript(this, this.GetType(), "scriptFocus", scriptFocus, true);


Thank you in advance!
msigman
Top achievements
Rank 2
 answered on 11 Dec 2013
1 answer
112 views
Can't add text inside Radeditor (Design) in IE 9, 10 after re-appending radedtior to a new div 

Scenario to reproduce:

 <div id="prev"><telerik:RadEditor ID="RadEditor1" runat="server" ></telerik:RadEditor></div>
        
 <div style="height:200px;">some text...</div>

 <div id="next"></div>

 <div id="btn">click</div>

  <script type="text/javascript">
        $(function () {
            $("#btn").click(function(){
                $("#next").append($("#prev"));
            });
        });
    </script>



1. After clicking on "click" (button), the div (id="prev") which contains the editor is being append to div (id="next") (according to jquery script).
2. It's impossible to add text inside the editor (Design) in IE 9,10 (it works fine in chrome).
Ianko
Telerik team
 answered on 11 Dec 2013
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?