Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
62 views
Good afternoon,
I downloaded a latest release of Telerik Q1 14.Now I am experiencing a problelm on selectedindexchanged event.
I have RadGrid with a column.A few column I made visible = false:
<telerik:GridBoundColumn HeaderText="Title" DataField="POSITION" UniqueName="POSITION" ReadOnly="True"  >
                             
 </telerik:GridBoundColumn>

<telerik:GridBoundColumn DataField="TITLE" UniqueName="TITLE" Visible="false" >
 </telerik:GridBoundColumn>
  <telerik:GridBoundColumn HeaderText="Location" DataField="LOC" UniqueName="LOC" ReadOnly="True" >
                                       
  </telerik:GridBoundColumn>
  <telerik:GridBoundColumn DataField="MONTH" UniqueName="MONTH" Visible="false"  >
  </telerik:GridBoundColumn>

When I select row SelectedIndexChanged event file and I try to retrieve a value from the columns including invisible like this:
string pri = SummaryGrid.SelectedItems[0].Cells[2].Text;
string month = SummaryGrid.SelectedItems[0].Cells[5].Text;

but all visible columns works fine however invisible column like "MONTH" getting value "&nbsp;" instead of data.

I did not have this issue with the oldest release.

Please help me.

Thanks so much.
 
Eyup
Telerik team
 answered on 10 Apr 2014
3 answers
298 views
I've implemented Google-like filtering in my RadGrid FilterTemplate column similar to how its described here.  It works great except when you make a selection the value doesn't stay present in the RadComboBox.  Is there a way to accomplish this?  I tried using sender.set_text() but it doesn't seem to work.


<telerik:GridBoundColumn DataField="last_name" DataType="System.String" HeaderText="Last Name" SortExpression="last_name"
    UniqueName="last_name" ShowFilterIcon="True" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">
    <FilterTemplate>
        <telerik:RadComboBox runat="server" ID="rcblast" DataTextField="last_name" DataValueField="last_name" EnableEmbeddedSkins="False" Skin="2015"
            Width="100px" EnableLoadOnDemand="True" MarkFirstMatch="True" ShowToggleImage="False" OnClientDropDownOpening="lastName_ClientDropDownOpening"
            OnClientSelectedIndexChanged="lastName_ClientSelectedIndexChanged" OnClientItemsRequesting="lastName_ItemsRequested"
            OnItemsRequested="rcblast_ItemsRequested">
        </telerik:RadComboBox>
        <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
            <script type="text/javascript">
                function lastName_ClientSelectedIndexChanged(sender, args) {
                    $find("<%= rgTraining.ClientID %>").get_masterTableView().filter("last_name", args.get_item().get_text(), "StartsWith");
                     
                    // doesn't seem to work
                    sender.set_text(args.get_item().get_text());
                }
                function lastName_ItemsRequested(sender, args) {
                    if (args.get_text().length < 3)
                        args.set_cancel(true);
                    else
                        args.set_cancel(false);
                }
                function lastName_ClientDropDownOpening(sender, args) {
                    var comboText = sender.get_text();
                    if (comboText.length < 3) {                                   
                        args.set_cancel(true);
                    }
                }                                                                                    
            </script>
        </telerik:RadScriptBlock>
    </FilterTemplate>                       
 
    <ItemStyle VerticalAlign="Top" />
    <HeaderStyle HorizontalAlign="Left" VerticalAlign="Bottom" Font-Bold="True" Font-Underline="True" />                               
</telerik:GridBoundColumn>




Princy
Top achievements
Rank 2
 answered on 10 Apr 2014
1 answer
129 views
Good Afternoon,
in my aspx page I have RadDatePicker control.When I click on it calendar popup and then I click the title area  of the title bar to choose different month and year  popup for some reason instead of appearing next to calendar it is appear on the top of the screen where I can barely see it.

Please help me.

Thanks so much.
Princy
Top achievements
Rank 2
 answered on 10 Apr 2014
2 answers
131 views
Hi Please Help me to Convert bellow Code Snippet to LINQ

foreach (RadComboBoxItem item in rdComboNames.Items)
                {
 
                    CheckBox chk = (CheckBox)item.FindControl("chk1");
                    if (i == 0)
                    {
                        checkedText += "Names:";
                    }
                    else if (chk.Checked)
                    {
                        checkedText += item.Text + ", ";
                    }
                    i++;
                }
Deekshith
Top achievements
Rank 1
 answered on 10 Apr 2014
5 answers
225 views
Hi all , 

First of all I have to apologise about my English . Hope you guys understand what I'm trying to explain .

I have a tree view with checkboxes .  We implemented node clicks to show the detail right next to the tree and the second click for editing node's name


The problem is we used to stick with the previous telerik version and we just upgraded to the latest version recently 

Right now it behaves totally like a checkbox and I know it's kindda make sense. 

But we are trying to find the way to disable the CLICK on node label . 

Is there any workaround for this?


Thank you so much in advance 




Marut
Top achievements
Rank 1
 answered on 10 Apr 2014
3 answers
115 views
I am having an issue getting the 'Select' to work in the RadUpload on the iPhone. Clicking 'Select' does nothing. I found this article from 2007 http://dotnetslackers.com/ASP_NET/re-58898_RadControls_on_iPhone_Part_3.aspx
which stated

    RadUpload: Unusable
You probably saw this one coming. As you may know, the iPhone does not allow you to access its filesystem unless you've joined the thriving iPhone hacking community. Based on that restriction, mobile Safari seems to automatically disable the browser's file selection objects- the core of the RadUpload control. So aside from the basic functionality of RadUpload being disabled by the browser, the control does still render properly. Visitors to a page with a RadUpload control on an iPhone will be presented with a good looking, functionless control.



Is this still valid or is there a fix for this issue?

Thanks,

Brad
Michael Schweighardt
Top achievements
Rank 1
 answered on 10 Apr 2014
3 answers
126 views
Good day!

Is there anyway to cancel the OnClientAppointmentDoubleClick event without setting the AllowEdit="false"? I want the user to be able to drag the appointment to change the start and end time of an appointment, but without allowing them to edit it via the simple/advanced form.

Thank you very much.
Muhammad
Top achievements
Rank 1
 answered on 10 Apr 2014
3 answers
82 views
I have tried to use the CustomContentProvider to alter the parent directory name with no success

In one case when have the parent and then files under the parent.
In other cases we have a parent, that I want to customize the text and then sub folder that I want to display as they are in the file structure

When I try to use the CustomContentProvider I see no folders, in either case.
This is the code
​public class CustomContentProvider : FileSystemContentProvider
{
public CustomContentProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
: base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
{

}

public override DirectoryItem ResolveRootDirectoryAsTree(string path)
{
DirectoryItem orgDir = base.ResolveRootDirectoryAsTree(path);


orgDir.Name = folderText;
return orgDir;
}
}


The parent folder is dynamic based on what was selected.
Frank
Top achievements
Rank 1
 answered on 09 Apr 2014
3 answers
153 views
Hi,
I have the following scenario:
  1. Upload a photo.
  2. If it is a landscape photo, then it should be cropped 16*9, other wise it is up to the user.
  3. Save the photo: I don't need the save dialog to shows up, before saving I need to validate the photo dimensions then save using server side code.
  4. After saving, reset crop setting to apply a new ratio.
  5. Crop the photo again, make sure it is more than 300px X 300px.
  6. Save: at this stage I need to resize the photo to become 300px X 300px then save it again using server side code

My questions are:
1. How to disable the controls on crop dialog like the dropdown menu and the textboxes.
2. How to fire save event on server side and access the modified photo.

<script type="text/javascript">
           function OnClientFilesUploaded(sender, args) {
               $find('<%=RadAjaxManager1.ClientID %>').ajaxRequest();
           }
 
           var width;
           var height;
           var heightAfterCrop;
           var imageVer1Saved=0; //Sould set to true after saving the 16X9 version
           function OnClientImageLoad(imageEditor) {
               imageEditor.zoomBestFit();
               waitForCommand(imageEditor, 'Crop', function (widget) {
                   width = imageEditor.getEditableImage().get_width();
                   height = imageEditor.getEditableImage().get_height();
                   if (width >= height) {
                       var ratio = 16 / 9;
                       heightAfterCrop = width / 16 * 9;
 
                       //Panoramic photos
                       if (height < heightAfterCrop) {
                           heightAfterCrop = height;
                           width = heightAfterCrop / 9 * 16;
                       }
                       //stop the aspect ratio constraint
                       //widget._constraintBtn.set_checked(false);
                       //widget._setCropBoxRatio(null);
                       //widget._sizeRatio = null;
 
                       widget._setCropBoxRatio(ratio);
                       widget._sizeRatio = ratio;
                       widget.set_width(width);
                       widget.set_height(heightAfterCrop);
                       widget._constraintBtn.set_enabled(false);
                       widget._swapBtn.set_enabled(false);
                       widget._updateCropBoxFromControls();
                        
                   }
               });
               imageEditor.executeCommand("Crop");
           }
 
           function waitForCommand(imageEditor, commandName, callback) {
               var timer = setInterval(function () {
                   var widget = imageEditor.get_currentToolWidget();
                   if (widget && widget.get_name() == commandName) {
                       clearInterval(timer);
                       callback(widget);
                   }
               }, 100);
           }
 
           function modifyCommand(imageEditor, args) {
               if (imageVer1Saved == 1)
               {
                   if (args.get_commandName() == "Crop") {
                       waitForCommand(imageEditor, args.get_commandName(), function (widget) {
                           width = 300;
                           height = 300;
                           var ratio = width / height;
 
                           //stop the aspect ratio constraint
                           //widget._constraintBtn.set_checked(false);
                           //widget._setCropBoxRatio(null);
                           //widget._sizeRatio = null;
 
                           widget._setCropBoxRatio(ratio);
                           widget._sizeRatio = ratio;
                           widget.set_width(width);
                           widget.set_height(height);
                           widget._constraintBtn.set_enabled(false);
                           widget._updateCropBoxFromControls();
                       });
                   }
               }
           }
           function OnClientSaving(sender, eventArgs) {
               //Some validation
               //if (true) {
               //    Save using server side code
               //}
           }
           function OnClientSaved(sender, eventArgs) {
               imageVer1Saved += 1;
           }
       </script>
   </telerik:RadScriptBlock>
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" EnablePageHeadUpdate="false">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadImageEditor1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>
   <div class="borderFullWidthBoxSection">
       <div class="formSection">
           <h1>Upload new photo</h1>
           <div class="formContent">
               <telerik:RadAsyncUpload ID="AsyncUpload1" runat="server"
                   OnClientFilesUploaded="OnClientFilesUploaded" OnFileUploaded="AsyncUpload1_FileUploaded"
                   MaxFileSize="4194304" AllowedFileExtensions="jpg,png,gif,bmp"
                   AutoAddFileInputs="false" Localization-Select="Browse" Skin="Silk" HideFileInput="true" />
 
               <asp:Label ID="Label1" Text="*Size limit: 4MB" runat="server" Style="font-size: 10px;"></asp:Label>
               <telerik:RadImageEditor ID="RadImageEditor1" runat="server" Width="850" Height="550"
                   OnImageLoading="RadImageEditor1_ImageLoading" OnClientImageLoad="OnClientImageLoad" OnClientCommandExecuted="modifyCommand" Skin="Silk" OnClientSaved="OnClientSaved" OnClientSaving="OnClientSaving" >
                   <Tools>
                       <telerik:ImageEditorToolGroup>
                           <telerik:ImageEditorTool CommandName="Save" IsToggleButton="true"></telerik:ImageEditorTool>
                           <telerik:ImageEditorToolStrip CommandName="Undo">
                           </telerik:ImageEditorToolStrip>
                           <telerik:ImageEditorToolStrip CommandName="Redo">
                           </telerik:ImageEditorToolStrip>
                           <telerik:ImageEditorTool Text="Reset" CommandName="Reset" />
                            </telerik:ImageEditorToolGroup>
       <telerik:ImageEditorToolGroup>
                           <telerik:ImageEditorTool CommandName="Crop"></telerik:ImageEditorTool>
                           <telerik:ImageEditorTool CommandName="Resize"></telerik:ImageEditorTool>
                           <telerik:ImageEditorTool CommandName="FlipVertical" ToolTip="Flip Image Vertically"></telerik:ImageEditorTool>
                           <telerik:ImageEditorTool CommandName="FlipHorizontal" ToolTip="Flip Image Horizontally"></telerik:ImageEditorTool>
                           <telerik:ImageEditorTool CommandName="RotateRight" ToolTip="Rotate Right by 90 degrees"></telerik:ImageEditorTool>
                           <telerik:ImageEditorTool CommandName="RotateLeft" ToolTip="Rotate Left by 90 degrees"></telerik:ImageEditorTool>
            <telerik:ImageEditorTool Text="Add Text" CommandName="AddText" IsToggleButton="true" />
           <telerik:ImageEditorToolSeparator />
                           <telerik:ImageEditorTool CommandName="ZoomIn" ToolTip="Zoom In"></telerik:ImageEditorTool>
                           <telerik:ImageEditorTool CommandName="ZoomOut" ToolTip="Zoom Out"></telerik:ImageEditorTool>
                       </telerik:ImageEditorToolGroup>
                       <telerik:ImageEditorToolGroup>
           <telerik:ImageEditorTool Text="Brightness Contrast" CommandName="BrightnessContrast" IsToggleButton="true" />
           <telerik:ImageEditorTool Text="Invert Color" CommandName="InvertColor" />
           <telerik:ImageEditorTool Text="Sepia" CommandName="Sepia" />
           <telerik:ImageEditorTool Text="Greyscale" CommandName="Greyscale" />
           <telerik:ImageEditorTool Text="Hue Saturation" CommandName="HueSaturation" IsToggleButton="true" />
       </telerik:ImageEditorToolGroup>
       <telerik:ImageEditorToolGroup>
           <telerik:ImageEditorTool Text="Pencil" CommandName="Pencil" IsToggleButton="true" />
           <telerik:ImageEditorTool Text="Draw Circle" CommandName="DrawCircle" IsToggleButton="true" />
           <telerik:ImageEditorTool Text="Draw Rectangle" CommandName="DrawRectangle" IsToggleButton="true" />
           <telerik:ImageEditorTool Text="Line" CommandName="Line" IsToggleButton="true" />
       </telerik:ImageEditorToolGroup>
                   </Tools>
               </telerik:RadImageEditor>
           </div>
       </div>
   </div>

Vessy
Telerik team
 answered on 09 Apr 2014
2 answers
152 views
I'm working on a web control that updates contact information, and I call that web control via the RadGrid  .... the way I have it set up is, the RadGrid shows a list of the contacts, and then I click Edit in the RadGrid, to link to the contact update web control as part of the EditFormSettings.

The problem I'm having, is when I add the code to  that uses Google Places Autocomplete to do the address validation.

The code I'm embedding for the address validation is as per the example at this page: https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform

The problem is, that the Autocomplete WILL NOT WORK, when the control is called from inside the RadGrid for the Edit event.

Yet, when I move the control to anywhere else, it works just fine.

Seems like the extra event handlers that are bound to my Address Search box by Telerik, are somehow interfering with the AJAX for the Google Autocomplete?  That is only a guess.

Any advice much appreciated, thanks in advance!!!
rdmptn
Top achievements
Rank 1
 answered on 09 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?