Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
136 views
I am trying to create a RowSelection Checkbox Column on my grid programatically, no Templates on the ASCX file. Reason for programatically creating it is because I am trying to create a "Wrapper" class using the RADGrid, so I can easily use it all over my application directly in my code.

I first tried using Telerik.Web.UI.GridClientSelectColumn. Problem is that because it's a "ClientSide" selection, it kept losing the SelectedRow values on PageChange. I looking into retaining the SelectedRows using JavaScript, but from what I can tell, it wouldn't be feasible for my particular situation (Passing the selected rows back and forth between client/server seemed way to complicated and possible unworkable for my situation). So I decided to switch to Server-Side code. From what I gathered, in order to do that I had to use a different ColumnType, so I found Telerik.Web.UI.GridCheckBoxColumn. I have a few problems that I cant seem to figure out for the life of me...

1) The column when rendered, is disabled..have no clue how to enable it
2) The column is missing the checkbox in the header as a "Select All" feature
3) After creating the column, in the related event methods, I can't seem to obtain a reference to said column.
     - ie: In the ItemCreated() event, e.Item.FindControl("chkSelect") returns Nothing

Below are snippets of my code...

Column Creation Code:
'***************************************
' Initialize Variables
'***************************************
Dim objColumn_Select As New Telerik.Web.UI.GridCheckBoxColumn
 
'***************************************
' Add Button Column To Grid
'***************************************
Me.gridMain.Columns.Add(objColumn_Select)
 
'***************************************
' Define Column Properties
'***************************************
With objColumn_Select
     .ItemStyle.HorizontalAlign = HorizontalAlign.Center
     .HeaderText = ""
     .UniqueName = "chkSelect"
End With


Grid's ItemCreated() event:
'***************************************
' Add Handler To Custom ItemPreRender Event
'***************************************
AddHandler e.Item.PreRender, AddressOf Me.gridMain_ItemPreRender
 
'***************************************
' Add "OnCheckedChanged" Event
'***************************************
CType(e.Item.FindControl("chkSelect"), CheckBox).Attributes("onCheckedChanged") = "gridMain_ToggleRowSelection"

The above code doesn't work, crashing on the FindControl() method because it doesn't find the control "chkSelect".

Any help would be greatly appreciated!
Ben
Top achievements
Rank 1
 answered on 18 Apr 2012
5 answers
315 views
Hello,

I'm currently facing a problem with the RadCombobox by using the jQuery dialog. When I make use of the modalpopupextender of the AjaxControlToolkit I don't have any problems. Let me explain what I've done.

I have a usercontrol with two RadComboBoxes on it. This usercontrol is loaded via the codebehind via the code: var ctl = LoadControl("MyCustomUserControl"); When I have loaded this control I add it to a asp.net Panel via the Controls.Add function. Quite easy and nothing special on it, but now the magic begins.

There are two situations:

1) I do not call the jQuery popup and I navigate to a new page
2) I do call the jQuery popup but press cancel (to destroy the popup) or ok (to destroy the popup and start the process clientside)

What happens in both situations?

In the first situation no exceptions are thrown and nothing happens really which is the desired effect. In the second situation I get an exception thrown in javascript which I will show in a second. When I make use of a modalpopupextender no exceptions are thrown. So my question is how can I resolve this issue? Is this even possible to resolve? Anyway let me post my findings and hopefully you can see what is happening here.

General:

- Visual Studio 2010 Ultimate
- .NET Framework 4.0
- Telerik controls version: 2011.1.315.40
- Exception thrown in: Internet Explorer 8, Internet Explorer 9
- Works in: Firefox, Chrome, Safari, Opera

The radcombobox settings:

<telerik:RadComboBox ID="cbTest" runat="server" Width="100%"
                            AllowCustomText="True" EmptyMessage="CustomText"
                            EnableEmbeddedScripts="False" Filter="Contains" MarkFirstMatch="True"
                            RegisterWithScriptManager="False" RadComboBoxImagePosition="Right" ZIndex="100101"></telerik:RadComboBox>

I have included all javascripts in my masterpage and works good because all other comboboxes (so without the jQuery dialog) works perfectly.

The panel where the combobox resides in:

    <asp:Panel ID="pTest" runat="server" style="display: none;">
        <asp:Panel ID="pTestData" runat="server">
             // Usercontrol is inserted here
        </asp:Panel>
    </asp:Panel>

The jQuery dialog call:

        // Get the dialog box
        var popup = $("[id $= 'pTest']");

        //Add the localized buttons
        var buttonsArray = {};
        buttonsArray[rmLoader().GetResource(1)] = function () { $(this).dialog('destroy'); DoWork(); };
        buttonsArray[rmLoader().GetResource(2)] = function () {
            $(this).dialog('destroy');
        };

        // Show it
        popup.dialog({
            width: 'auto',
            title: rmLoader().GetResource(3),
            buttons: buttonsArray,
            resizable: false,
            modal: true,
            close: function () {
                $(this).dialog('destroy');
            }
        });

And now the exception that is thrown:

In my findings I see when the page gets unloaded the controls are also trying to remove any handlers on them. This is where the problem occurs. In the RadComboBoxScripts.js the method $telerik.removeHandler(c,"focus",this._onFocusDelegate) is called to remove the handler of the RadComboBox. It seems to be that it passes the control (HTML element), the event that needs to be removed and the function to apply the changes.

The next step it calls the following function in the ScriptResource (which means it is now in the ScriptManager of Microsoft itself) $telerik._removeHandler(c,b,a). If I validate the c, b and a they are all filled in so I continue the process. At the line var c=a._events[f]; it is trying to obtain the event? When I validate the a._events it tells me that _events is null or not defined. I have attached the screenshots how I currently see it in my visual studio environment.

I think that my clientside object is gone by calling the jQuery.dialog("destroy"). I've also tried "Close" and other options that are available. All result in this exception in Javascript.

I hope someone can provide with an answer.

Best regards,
Michiel Peeters

NOTE: I've also tried to create an example project but somehow it works then but that didn't gave me the answer about this situation.
Cat Cheshire
Top achievements
Rank 1
 answered on 18 Apr 2012
4 answers
137 views
We're using the version "RadControls for ASP.NET AJAX Q2 2010". We have a functional page with a RAD Editor.

On another page within the same application, I have added a RAD Editor within a Repeater control. The RAD Editor control (on both the pages) is using the same ToolsFile.xml. All the properties for the Editor are set the same way as the one on the functional page. For some reason, all the toolbox features are disabled on this page. In IE 9.0, the content area is editable. However, in FF and Chrome, the content area is not editable. I do not see any errors...




Rumen
Telerik team
 answered on 18 Apr 2012
2 answers
125 views
Does RadUpload work with the integrated pipeline mode of IIS7 (I see posts from several years back that it did not). It appears to work fine with the ASP.NET Development Server but once deployed to a test server running 2k8R2 IIS7 I get a 404 - File or directory not found when attempting a larger file upload. This file size would be large enough to trigger the upload progress bar. As far as I can see my web.config is fine, the only difference being that I'm running in 4.0 Integrated mode. I cannot (well it would be a major pain) go to using the Classic Asp.Net app pool and trying to use the 4.0 classic mode results in a failure as well. I'm running Q3 2011 of the Telerik Controls.

Any help would be appreciated
ColinBlakey
Top achievements
Rank 2
 answered on 18 Apr 2012
0 answers
94 views
Hi Telerik Team,

I'm new to radgrid and i have an issue with grid loading time is more than a minute event less number or none..
So, I have gone throught at db level every thing is fine and it is taking 1 second while data retrival at query level.

may it possiable with radGrid to slow down the process?
If so, let me know with optimization tips at grid level..

Code:
<telerik:RadGrid ShowGroupPanel="true" AutoGenerateColumns="false" ID="GrdJobList"
                Skin="Vista" AllowFilteringByColumn="false" AllowSorting="True" ShowFooter="True"
                runat="server" GridLines="None" AllowPaging="true" PageSize="10" OnSelectedIndexChanged="GrdJobList_SelectedIndexChanged">
                <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" />
                <ExportSettings HideStructureColumns="True" FileName="ServiceSummaryJobs" ExportOnlyData="true"
                    IgnorePaging="true" OpenInNewWindow="true" />
                <MasterTableView ShowGroupFooter="true" AllowMultiColumnSorting="true" GroupLoadMode="Server"
                    GroupsDefaultExpanded="true" Name="MainTable"
                    TableLayout="Fixed">
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="RadioButtonTemplateColumn" HeaderStyle-Width="30px">
                            <ItemTemplate>
                                <asp:RadioButton id="RadioButton1" OnCheckedChanged="RadioButton1_CheckedChanged"
                                    AutoPostBack="True" runat="server">
                                </asp:RadioButton>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../../Files/Images/icons/icoView.gif"
                            UniqueName="ViewButton" CommandName="ViewCommand" HeaderStyle-Width="30px">
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../../Files/Images/icons/icoAuthorise.gif"
                            UniqueName="AuthoriseButton" CommandName="AuthoriseCommand" HeaderStyle-Width="25px">
                        </telerik:GridButtonColumn>
                        <telerik:GridBoundColumn DataField="Id" HeaderText="Id" HeaderStyle-Width="60px"
                            FilterControlWidth="20px">
                        </telerik:GridBoundColumn>
                        <%-- <telerik:GridHyperLinkColumn DataTextField="Id" HeaderText="Job Id" HeaderStyle-Width="60px" FilterControlWidth="20px" DataNavigateUrlFields="Id" DataNavigateUrlFormatString="javascript:openViewJobPopUp('{0}');" >
                        </telerik:GridHyperLinkColumn>
                        <telerik:GridTemplateColumn HeaderText="Job Id" HeaderStyle-Width="60px" FilterControlWidth="20px">
                            <ItemTemplate>                              
                                    <dns:DotNetSmithPopBtn CommandName="popupViewJobCommand" ID="btnPopViewJob" BackColor="WhiteSmoke" ForeColor="blue" runat="server" Text='<%#Eval("Id")%>' PopupURL="~/Pages/Jobs/PopupQuickJobInfo.aspx" PopupURLParams='<%# "JobId="+Eval("Id").ToString()%>'  Height="22px" Width="40px" />                              
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>  --%>
                        <telerik:GridDateTimeColumn DataField="ReceivedDate" HeaderText="Worked On" DataFormatString="{0:dd-MMM-yyyy}"
                            HeaderStyle-Width="70px">
                        </telerik:GridDateTimeColumn>
                        <%-- <telerik:GridBoundColumn DataField="ReceivedDate" HeaderText="Worked On" DataFormatString="{0:dd-MMM-yyyy}"
                            HeaderStyle-Width="130px">
                        </telerik:GridBoundColumn>--%>
                        <telerik:GridBoundColumn DataField="ContactName" HeaderText="Customer" SortExpression="ContactName"
                            HeaderStyle-Width="100px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="PersonName" HeaderText="Requested By" HeaderStyle-Width="200px"
                            Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="SiteName" HeaderText="Site" SortExpression="SiteName"
                            UniqueName="SiteName" HeaderStyle-Width="100px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="LocationDesc" HeaderText="Location" SortExpression="LocationDesc"
                            UniqueName="LocationDesc" HeaderStyle-Width="200px" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="SerialNo" HeaderText="Serial No" SortExpression="SerialNo"
                            HeaderStyle-Width="90px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="CustomerAssetNo" HeaderText="Asset No" SortExpression="CustomerAssetNo"
                            HeaderStyle-Width="90px" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="EquipmentNo" HeaderText="Eqp No" SortExpression="EquipmentNo"
                            HeaderStyle-Width="70px" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="ModelNo" HeaderText="Model No" SortExpression="ModelNo"
                            FilterControlWidth="60px" HeaderStyle-Width="70px">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="PurchaseOrderNo" HeaderText="Purchase Order"
                            FilterControlWidth="60px" SortExpression="PurchaseOrderNo" HeaderStyle-Width="70px">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="Job Total (Ex-GST)" HeaderStyle-Width="70px">
                            <ItemTemplate>
                                <asp:Label Id="lblJobTotal" runat="server" Text='<%# getJobTotalExcl(Eval("Id")) %>'>
                                </asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="JobStatus" HeaderText="Status" SortExpression="JobStatus"
                            FilterControlWidth="120px" HeaderStyle-Width="100px">
                        </telerik:GridBoundColumn>
                        <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../../Files/Images/icons/icoWarranty.gif"
                            UniqueName="CalculateWarrantyButton" CommandName="CalculateWarrantyCommand" HeaderStyle-Width="30px">
                        </telerik:GridButtonColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowDragToGroup="true">
                    <Selecting AllowRowSelect="True" UseClientSelectColumnOnly="True" />
                    <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
                    <Resizing AllowColumnResize="true" />
                </ClientSettings>
                <GroupingSettings ShowUnGroupButton="true" />
            </telerik:RadGrid>
Chakrapani
Top achievements
Rank 1
 asked on 18 Apr 2012
1 answer
83 views
How to show different user controls in edit and insert mode?
Princy
Top achievements
Rank 2
 answered on 18 Apr 2012
3 answers
202 views
I need to clear the DateInput field and CalendarPopUp when I click a radio button.  I have my RadDatePicker set up like this:
 

<

 

telerik:RadDatePicker

 

 

SharedCalendarId="sharedCalendar"

 

 

id="dpAuditorReportBeginDate"

 

 

MinDate="1/1/1900"

 

 

Runat="server"

 

 

Width="100px"

 

 

style="vertical-align:middle;"

 

 

cssClass="inputdata">

 

 

<DateInput cssClass="inputdata" runat="server"/>

 

 

</telerik:RadDatePicker> 

ThisDate needs to happen from Javascript. 
I am using "RadControls for ASPNET AJAX Q1 2008" version. 
So far I have tried the .Clear() and .clear() without success like this:
Have tried other forum responses and either can't find object or get a null error. 
I have this wrapped in a div and can disable everything in the div but the calendar items.

function toggle enabled(){

 

    var picker1 = $find("<%= dpAuditorReportBeginDate.ClientID %>");
    picker1.clear()
}

Hope you can help!!
Thanks,
Chris

karthik
Top achievements
Rank 1
 answered on 18 Apr 2012
1 answer
103 views
Hi,

This is more a question than it is a request for help.

I've recently discovered that filenames being uploaded might have non-printable characters in their names.
As such I've written a FixInvalidFileNameProvider to handle that.
And so I've got this in my code:

  • radeditor.DocumentManager.ContentProviderTypeName = typeof(FixInvalidFileNameProvider).AssemblyQualifiedName;
  • radeditor.ImageManager.ContentProviderTypeName = typeof(FixInvalidFileNameProvider).AssemblyQualifiedName;

That's all good and fine.

However, we were also going to have another provider to handle some other function as this:
  • radeditor.DocumentManager.ContentProviderTypeName = typeof(FileSystemContentProvider).AssemblyQualifiedName;
  • radeditor.ImageManager.ContentProviderTypeName = typeof(FileSystemContentProvider).AssemblyQualifiedName;

So, is this valid?
Would the FileSystemContentProvider replace the FixInvalidFileNameProvider?
Can there be more than one ContentProviderTypeName for the DocumentManager and ImageManager of the RadEditor?

Thanks,
Cameron



Rumen
Telerik team
 answered on 18 Apr 2012
2 answers
86 views
When adding nodes to a RadTreeView using a web service call, the appearance sometimes is different than when adding the nodes in code behind.

See the attached image "screen-view.png" for an example.

Specifically, for nodes added using a web service call, the node text is placed inside a <span> of class rtIn. Nodes added nodes in code behind have node text placed inside a <div> of class rtIn.

In the web service call, this forces the node text to start on the second line if the the node text includes a <TABLE>.

In the example image, the tree on the left is populated by the same web service function. The rendered HTML for the node circled in green is:

<span class="rtIn">
  <img src="images/buttons/F.gif"> Front Hazard Camera -  2 items
</span>

The rendered HTML for the node circled in red (still on the left treeview of the image) is:
<span class="rtIn">
  <table>
    <tbody><tr><td><div onclick="LoadProd('2B156252391EDR9946N1940N0M1','prod')">
    <table>
      <tbody><tr><td><img src="images/other/noprod.gif"></td>
      <td><img src="images/buttons/B.gif"></td>
      <td>2 B 156252391 EDR 99 46 N1940 N0 M1<br>1 product : N0</td></tr></tbody></table></div></td></tr></tbody>
  </table>
</span>

The rendered HTML for the node circled in red on the right treeview is:

<div class="rtIn">
  <div class="rtTemplate">
    <table>
      <tbody><tr><td></td><td><div onclick="LoadProd('2P144116118ESF7600P2600L8C1','g')">
      <table>
        <tbody><tr><td><img src="sqlImageHandler.ashx?id=2P144116118ESF7600P2600L8C1" width="64" height="64"></td>
        <td><img src="images/buttons/P.gif"></td>
        <td>144116118 76 00 P2600...<br>2 products : L8 R8</td></tr></tbody></table></div></td></tr></tbody>
    </table>
  </div>
</div>

Argue with me on how bad the table construction is another time. The only differences between the two red circled nodes appears to be that the table is bumped to a new line when inside a <span class="rtIn"> but not a <div class="rtIn">. I do notice that there is also a <div class="rtTemplate"> included on the code behind node, as I am using a template on the code behind tree. Adding this to the web service call does not help.

To see this in action, go to this test page. The page is obviously a test page, so please forgive the crude design and method for getting the same results shown in the attached file. Here are the steps:
  1. Enter "77" in the box labeled "Site" and click on the "Search" button.
  2. In the middle pane, click on the tree node "Sol 201".
  3. Click on the tree node "Navigation Camera".
  4. On the right side, change the pulldown from "Standard" to "Minimal".
  5. Now change the pulldown from "Minimal" back to "Standard".
  6. Expand the "Navigation Camera" node.

How can I remove the extra line in the nodes added by the web service?


Tom
Top achievements
Rank 1
 answered on 18 Apr 2012
6 answers
370 views

Currently we are using the Telerik RadGrid control to shows the data which is stored in the MOSS custom list. The volume of the data is around 2000+ . [The data may increase as the list is the task list]. The RadContorl is placed on the ASP.Net user control(.ascx page) and the same user control is used in the MOSS site as the custom web part.

When we try to open the page which contains this web part, it is taking long time(about 1 Minute) to load the page. And it is taking about 30 to 40 seconds to group and sort the data.

 

Data Fetch Login –

 

1.       Get all the records from the Custom List using SharePoint APIs and store it in the DataTable object  

2.       Store the DataTable in the Session object for further data operations on Grid

 

The Properties set for the RadGrid are as follows

 

1.       Auto Generate Columns = True

2.       Allow Pagination = False

3.       Allow Filtering = False

4.       Allow Sorting = True

5.       Allow Grouping = True

6.       Allow Client Site Column Reordering = True

 

As per Annadatha’s suggestions  we disabled the Grouping and Sorting  option to check the performance, but find no success. We even tried using the GridBoundColumn (For testing purpose) and disabled “AutoGenrateColumn=False”. But no improvement in page load time.

 

The browser used by customer – IE6 / IE7. We also used IE8 for testing, the performance is bit good in IE8 as compared with IE6 or IE7.

 

And the execution time  taken is

Data Fetch – About 1 Sec

Data Bind – About 0.3 Sec

Page Rendering Time – 30 Sec

 

Could you please let us know what could be the issue.

Tsvetoslav
Telerik team
 answered on 18 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?