Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
72 views

I have been getting reports of an odd problem for a few months now - where some of our grids seem to be acting up.  I am not sure if it was a change in this most recent release or the one before that - but something has changed.  Hoping you guys can help

 

Here is the scenario:

 - We have RadGrids inside RadWindow / ContentTemplate areas on a screen.

 - These grids use GridTemplateColumns with various Rad controls inside each column - e.g. RadCombobox and RadNumericTextbox

 - On page load we bind data to these grids (along with other things on the main screen)

 - On the OnItemDataBound event of the RadGrid - we find the controls in each column, set their values if needed - and for clientside processing we set attributes on some controls to reference other controls on the same line.  For example, if the first column is a RadCombobox with two options, and the next column is a RadNumericTextbox that will display a default value when the value of the RadCombobox changes - then we get the ClientID of the RadCombobox and save it as an attribute on the RadCombobox

 - Following this example - we wire up the OnClientSelectedIndexChanged of the RadCombobox - and handle the setting of the default value for the RadNumericTextbox from javascript - to make it quick and excel like... the user just tabs through the fields - and this event does something like this:

         var myRadNumeric = $find(sender.get_attributes().getAttribute('myRadNumeric ')); 

         myRadNumeric.set_value(defaultValue);

 - The idea is to have the grid act more like Excel - so the user can just tab through and change data in each control

 

And here is the problem:

In the past this has always worked - AND still does - UNLESS the RadGrid is in a RadWindow/ContentTemplate.  Oddly in this scenario the ClientIDs of the controls in the GridTemplateColumns that we read and saved from the RadGrids OnItemDataBound event CHANGES once the screen is rendered...  so javascript cannot $find it...  

We have found we can fix this by making a server call back after displaying the RadWindow (from javascript radopen())  - doing a Rebind() on the grid in question - at that point all ClientIDs are correct on both client and server...

 

I hope you followed that - it is a bit elaborate of a scenario.  I believe we picked up this method of handing Excel like interactions with the RadGrid from an older Forum thread or suggestion - but we are not clear if the behavior we are seeing is 

 

 

Marin Bratanov
Telerik team
 answered on 15 May 2017
0 answers
132 views

Temp files are not getting cleared from the App_Data folder while i'm using RADAsyncUpload control.  I'm using telerik dll verison is 2015.1.310.40 and .Net framework is 4.6.2 with Visual Studio 2015. 
Below is the .aspx file code
<telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" HideFileInput="true" MultipleFileSelection="Automatic"
                                            AllowedFileExtensions=".tif,.tiff,.pdf" TemporaryFileExpiration="05:00:00">
Below is the C# code for reading the image bytes from memory stream by using telerik UploadedFile.
Byte[] byt= null;
foreach (UploadedFile file in AsyncUpload1.UploadedFiles)
{
    using (MemoryStream ms = new MemoryStream())
    {
                file.InputStream.CopyTo(ms);
                 byt = ms.ToArray();
    }
}

vel
Top achievements
Rank 1
 asked on 15 May 2017
3 answers
762 views

In a Chrome browser once the page is load, when i directly clicking on Inster Image link of editor i am geting the below error.
Uncaught TypeError: Cannot read property 'nodeName' of null ScriptResource.axd:3337

the derail is as mentioned hereunder

  1. Uncaught TypeError: Cannot read property 'nodeName' of null ScriptResource.axd:3337
    1. InsertImage.SetImagePropertiesScriptResource.axd:3337
    2. a.RadEditor.fireScriptResource.axd:6179
    3. a.RadEditor._onToolClickScriptResource.axd:5654
    4. (anonymous function)ScriptResource.axd:628
    5. (anonymous function)ScriptResource.axd:4338
    6. Telerik.Web.UI.Editor.DefaultToolAdapter._raiseEditorEventScriptResource.axd:2759
    7. Telerik.Web.UI.Editor.DefaultToolAdapter._onToolBarClickScriptResource.axd:2754
    8. (anonymous function)ScriptResource.axd:628
    9. (anonymous function)ScriptResource.axd:628

The verion of telerik is 2010.2.929.35

please do let me know if you needed any thing from my side.

Regards,
Manish
Anthony
Top achievements
Rank 1
 answered on 15 May 2017
0 answers
186 views

Hello everyone,

I am using a radgrid with a GridDateTimeColumn, I want to set the FirstDayOfWeek for the calendar from code behind.

Here is my column :

<telerik:GridDateTimeColumn DataField="DateDebut" HeaderText="Du" SortExpression="Du" MaxLength="50"                                  UniqueName="DateDebut" ItemStyle-Width="80px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" DataFormatString="{0:yyyy-MM-dd}" />

Here is my code behind :

protected void rgDateSaisie_ItemDataBound(object sender, GridItemEventArgs e)         {    

         if (e.Item is GridEditableItem && e.Item.IsInEditMode)             

{

                GridEditableItem editedItem = e.Item as GridEditableItem;

                GridEditManager editMan = editedItem.EditManager;

                GridDateTimeColumnEditor editor = (GridDateTimeColumnEditor)(editMan.GetColumnEditor("DateDebut"));                 RadDatePicker picker = editor.PickerControl;

                picker.DatePopupButton.ToolTip = "Ouvrir le calendrier";  

               picker.Calendar.FirstDayOfWeek = FirstDayOfWeek.Friday;

}

The toolTip message works but firstDayOfTheWeek is still sunday in the popup calendar.

What I am missing.

Thanks a lot

Louis
Top achievements
Rank 2
 asked on 12 May 2017
1 answer
168 views

Hi,

We're using Telerik RadGrid to display data in our pages.
Existing system: Since this page/grid is in use on multiple places, and due to other reasons during development, this grid is created during runtime (in c#). Also a few checkbox columns on this grid is editable.
Recent requirement: On checking the checkbox in an editable checkbox column of the grid, make another text column of same row in the the grid to be editable. Basically show a textbox for user to enter some notes on why he thinks that checkbox should be checked. Similarly, when unchecked, that row's textbox to be disabled.

Issue: We're unable to get the checkbox check changed event of checkbox column, in the aspx page, to fire. This is the event in which we intend to put code to enable the textbox of that row. Tried to achieve this server side as well as client side, but nothing seems to work.
We have created a checkbox event handler in Item_Created event of grid control. But on checking the checkbox, the Item_Created event does not fire, page does post back. Also, note that we have created the CustomCheckbox class by inheriting "ITemplate" interface. The CustomCheckbox's check changed event does fire but here we do not have any info related to selected row so that we can fetch and enable/disable the cell with textbox.
The examples over the internet have the telerik grid created in design time and it works well for them. So we're guessing that this might be an issue for us since we're creating the grid at runtime. Redeveloping the entire page to create grid design time is out of question since the page is in use on multiple places. Apart from the time required to redevelop/regression test the entire page, many functionalities are in place with runtime grid. We need to fix this issue for grid created at runtime.

We have created a POC application in which we've replicated our exact issue. Unable to attach the zipped source code in this thread since only image files are allowed to be attached. Here is the link to file in dropbox: https://www.dropbox.com/sh/gv5csygr3uxpe2f/AAAaCezrFO2hUXdH6H7CPBaJa?dl=0

Please look into this and let us know a possible solution.
Let me know if any additional details are required.

Thanks,
Blessy.

Vessy
Telerik team
 answered on 12 May 2017
0 answers
135 views
HI,
I am using the RadComboBox with checkbox everything is working fine, but I have a issue in displaying  Rad combo box option text .
RadComboBox with checkbox how to use CSS to adjust left side margin so that for large text option and with nowrap=false.
Please see attached image.
I want to know how to align the warped text after checkbox and how to reduce the space between checkbox and the text.

Thanks .
Shirish.
Shirish
Top achievements
Rank 1
 asked on 12 May 2017
0 answers
116 views

HI,

I am using the RadComboBox with checkbox everything is working fine, but I have a issue in displaying  Rad combo box option text .

RadComboBox with checkbox how to use CSS to adjust left side margin so that for large text option and with nowrap=false.

Please see attached image.

I want to know how to align the warped text after checkbox and how to reduce the space between checkbox and the text.

 

Thanks .
Shirish.

 

 

Shirish
Top achievements
Rank 1
 asked on 12 May 2017
4 answers
57 views

You guys ought to create .hide(), .show(), etc, or similar methods on your client-side GridColumn object. In that way, users will be able to get a reference to a particular column by UniqueName using the tableView method getColumnByUniqueName and perform actions, like hiding. As it stands, in order to hide a column, one must use the hideColumn method of the TableView object and this expects an index argument. Referencing grid column indexes leads to really fragile code since grid columns can be inserted/removed all the time and one might not think to look at some obscure javascript that depends on the order of columns.

You could also add a get_index() method to the GridColumn which would facilitate obtaining the index without hard-coding it.

Albert Shenker
Top achievements
Rank 1
Veteran
Iron
 answered on 12 May 2017
1 answer
283 views

I've got a drop down list and when a particular item is selected I'd like to check a checkbox inside a radgrid. below is what I've figured out thus far but can't quite figure out how to check the checkbox.

 

<script type="text/javascript">
        function OnClientItemSelected(sender, eventArgs) {
            var item = eventArgs.get_item(); //target 3

            var grid = $find("<%= rgClientSites.ClientID %>");
            var masterTable = grid.get_masterTableView();
            var cell = masterTable.getCellByColumnUniqueName(masterTable.get_dataItems()[0], "2"); //2 is the item that contains the checkbox

            if (item.get_value() === "3") {
                //check it
                alert(cell.innerHTML); 
            }
            else {
                //uncheck it

            }

        }
</script>

 

Any help would be most appreciated.

 

Loïc
Top achievements
Rank 1
 answered on 12 May 2017
7 answers
603 views
I have a RadGrid which I'm supplying with a dataSource from Entity Framework.  Let's say there are 6 columns.  The first column is a 'FromDate', the second column I just want to have the static text "To" inside it, both in row display and in row add/edit, and the third column I have 'ToDate'.

I have everything working just fine, except that 'static text' of "To"... I don't know what format to put in the markup page.  I have tried several combinations.

<telerik:GridTemplateColumn HeaderText="To" HeaderStyle-Width="40px" HeaderStyle-HorizontalAlign="Center">
   <ItemTemplate>
           <asp:Label ID="lblTo" runat="server" Text="To" Width="100%" />
    </ItemTemplate>
    <EditItemTemplate>
            <asp:Label ID="lblTo" runat="server" Text="To" Width="100%" />
     </EditItemTemplate>
</telerik:GridTemplateColumn>


Above I tried putting a label in each GridTemplateColumn, but this doesn't work out.  Do I need to use a different type of column?
Austin
Top achievements
Rank 1
 answered on 11 May 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?