Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
81 views
Hi,

When binding the grid to a List<CutomObject>, it throws an exception (Object Reference Not Set) in System.Linq.EnumerableSorter`2.ComputeKeys.

I already read other threads about that, it seems that setting EnableLinqExpression to false should do the trick.
It doesn't work for me.

I use a LinqDataSource to bind the grid.

Please help, it seems so obvious to me that this should work!

Patrick
Mira
Telerik team
 answered on 01 Feb 2012
1 answer
79 views
SORRY. This is fixed I had the CSS located incorrectly.



It works under Firefox and IE. I tried the CSS as recommended in another post but it did not help.

.dataPagerClass .rdpWrap .RadInput,
.dataPagerClass .rdpWrap .rdpPagerButton,
.dataPagerClass .rdpWrap .rdpPagerLabel
{
    float: left;
    text-decoration: none;
}
Here is the definition of the Listview
<telerik:RadListView ID="RadListView1" runat="server" AllowPaging="True" ItemPlaceholderID="PlaceHolder1"
     Skin="listview_2" EnableEmbeddedSkins="false" OnItemCreated="RadListView1_ItemCreated"
     DataKeyNames="id,filenameextension,typeAbbr,title" OnNeedDataSource="RadListView1_NeedDataSource">
     <LayoutTemplate>
         <div class="RadListView RadListViewFloated RadListView_Windows7">
             <telerik:RadDataPager ID="RadDataPager1" runat="server" PageSize="25" PagedControlID="RadListView1"
                 BorderWidth="0" OnFieldCreated="RadDataPager1_FieldCreated" CssClass="dataPagerClass">
                 <Fields>
                     <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                     <telerik:RadDataPagerButtonField FieldType="Numeric" PageButtonCount="5" />
                     <telerik:RadDataPagerButtonField FieldType="NextLast" />
                     <telerik:RadDataPagerPageSizeField PageSizeText="Page size: "/>
                     <telerik:RadDataPagerGoToPageField CurrentPageText="Page: " TotalPageText="of" SubmitButtonText="Go"
                         TextBoxWidth="15" />
                     <telerik:RadDataPagerTemplatePageField>
                         <PagerTemplate>
                             <b>Total Number of Assets Found:
                                 <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" />
                             </b>
                         </PagerTemplate>
                     </telerik:RadDataPagerTemplatePageField>
                 </Fields>
             </telerik:RadDataPager>
             <asp:PlaceHolder ID="PlaceHolder1" runat="server" />
         </div>
     </LayoutTemplate>
     <ItemTemplate>
         <div style="float: left; width: 162px; height: 200px; background-color: White;">
             <asp:Panel ID="myThumb" runat="server" CssClass="myClass" Style="border: 0; white-space: normal;
                 padding: 5px 2px 25px 2px; text-align: center; width: 156px; background-color: White;">
                 <asp:HyperLink ID="HyperLink1" runat="server">
                     <telerik:RadBinaryImage ID="RadBinaryImage1" runat="server" AutoAdjustImageControlSize="False"
                         CssClass="myClass" ImageUrl='<%# Eval("thumbUrl") %>' AlternateText="Click to view preview"
                         ToolTip="Click to view preview" Width="150px" Height="150px" />
                 </asp:HyperLink><br />
                 <asp:CheckBox ID="ChkImage" runat="server" Style="float: left; padding-top: 5px" /><small><asp:HyperLink
                     ID="lnkAsset1" runat="server" Visible="false" Style="float: left; padding-top: 5px;
                     text-decoration: none; font-weight: normal; font-size: 7pt;">
                 </asp:HyperLink><asp:HyperLink ID="lnkAsset2" runat="server" Style="float: left;
                     text-decoration: none; font-weight: normal; font-size: 7pt;">
                 </asp:HyperLink><asp:HyperLink ID="lnkAsset3" runat="server" Style="float: left;
                     padding-left: 20px; text-decoration: none; font-weight: normal; font-size: 7pt;"></asp:HyperLink></small><br />
                 <asp:HiddenField ID="hiddenAssetId" Value='<%# Eval("id") %>' runat="server" />
             </asp:Panel>
         </div>
     </ItemTemplate>
     <EmptyDataTemplate>
         No Assets Found
     </EmptyDataTemplate>
 </telerik:RadListView>
Tonyz289
Top achievements
Rank 1
 answered on 01 Feb 2012
3 answers
238 views
I have a basic recurring table with the following columns:

Id
Name
ManagerId (this is an FK contraint to Id on the same table)

The markup for my RadOrgChart is this:

<telerik:RadOrgChart ID="RadOrgChart1" runat="server" DataFieldID="Id" DataTextField="Name" DataFieldParentID="ManagerId" Skin="Windows7" GroupColumnCount="4">
        </telerik:RadOrgChart>

I am doing programmatic data-binding with the following:

this.RadOrgChart1.DataSource = from emp in new TestDataContext().Employees select emp;
this.RadOrgChart1.DataBind();

Is it possible to do groups with this setup? Specifically, while this is only a sample, my OrgChart is far too large to display on a screen with some sample data. What I'm hoping to do is show a visualization where the top entry points to a single group of entries (unknown number of items in this group) below it, that group points to a single group below it (unknown number of items in this group) and so on for up to a specified number of levels. This way the width is fairly static, but it conveys the information I'm trying to display. I'll be binding with specific entities via a WCF service so a declarative datasource isn't an option.

Any suggestions?
digitall
Top achievements
Rank 1
 answered on 01 Feb 2012
7 answers
282 views
I just upgraded the binaries to Q2 2008 and noticed that my RadUpload's Choose File dialog is not showing up when I click Select if the RadUpload controls is inside a asp:Panel that extends on the ModalPopUp Ajax.NET control.

Any idea?

Thanks,

Victor
Plamen
Telerik team
 answered on 01 Feb 2012
1 answer
103 views
hi dear
(I'm sorry for bad language)
I use  ribbon in my project.i want when user click on RibbonBarButton  after postback page same tab view before postback.
very tnx
Kate
Telerik team
 answered on 01 Feb 2012
1 answer
108 views
Hello all,

Is there an unique documentation file, except of "Appearance and Style" chapter of each control in the Telerik Help On line,  that presents how to use for each Telerik control their corresponding CSS?
Ie, for what each style is used in each control?

Example: RadTabStrip with the Skin Default
For what is used RadTabStripTop_Default and rtsOut, and so on?

Best regards,
Alain
Bozhidar
Telerik team
 answered on 01 Feb 2012
11 answers
498 views
Is it possible to add a link to the header of the scheduler (where it has the "today" link, date, and "Day", "Week", & "Month" buttons)?

If so, how?

Thanks.
Peter
Telerik team
 answered on 01 Feb 2012
1 answer
172 views

I have a RadWindowManager with RadWindow that opens a new window when a link within a RadGrid cell is clicked.  It opens the new window as a Modal="true".  In the new window's aspx page, it has a RadUpload, RadProgressArea and RadProgressManager, that uses TargetFolder="~/UploadFiles" and OverwriteExistingFiles="false".  What I would like is for it to check to see if the file exists already when the user submits the file.  If so, I want to present a javascript confirm() box to the user to ask if they want to overwrite the file.  If yes, then let it overwrite (and store the extra data in the database), if no, return back to the RadUpload popup window without saving the file (thus allowing them to cancel the process, rename the file on their hard drive and then re-upload).  I have tried using the submit button's click event handler to check for the file's existance, and if so, it calls a ClientScript.RegisterClientScriptBlock to register a confirm() box.  However, it doesn't seem to either fire or attach properly (or some other reason I can't figure out).  I've tried a number of different ways, but none are working.  The current version uses a hidden field to track if the file exists or not, but it's not working.  Any thoughts?
ASPX:

<script type="text/javascript">
        function CloseAndRebind() {
            GetRadWindow().BrowserWindow.refreshGrid();
            GetRadWindow().close();
        }
  
        function GetRadWindow() {
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz as well)
  
            return oWindow;
        }
  
        function CancelEdit() {
            GetRadWindow().close();
        }
  
        function ExecuteConfirm() {
            var returnValue = confirm('Warning: File exists.  Wanna overwrite?');
            if (returnValue) {
                document.getElementById('FileExistsHidden').value = "1";
                document.getElementById('SubmitButton').click();
            }
        }
  
        </script>
  
<telerik:RadUpload ID="FileRadUpload" runat="server"
        ControlObjectsVisibility="ClearButtons" InitialFileInputsCount="1" 
        MaxFileInputsCount="1" TargetFolder="~/UploadFiles"
        OverwriteExistingFiles="false" InputSize="45" Width="500px">
    </telerik:RadUpload>
    <telerik:RadProgressArea ID="RadProgressArea1" runat="server"
        DisplayCancelButton="true"
        ProgressIndicators="TotalProgressBar, TotalProgress, RequestSize, FilesCountBar, FilesCount, SelectedFilesCount, CurrentFileName, TimeElapsed, TimeEstimated, TransferSpeed">
    </telerik:RadProgressArea>
    <telerik:RadProgressManager ID="RadProgressManager1" runat="server" />
        <hr />
        <asp:Button ID="SubmitButton" runat="server" Text="Submit" onclick="SubmitButton_Click" />
        <asp:HiddenField ID="FileExistsHidden" runat="server" />
aspx.cs:
protected void SubmitButton_Click(object sender, EventArgs e)
        {
            int customerDataId = MathHelper.ParseIntZeroIfNull(Request.QueryString.Get("cdid"));
            Type cstype = GetType();
            string warningScriptName = "PopupScript";
            string rebindScriptName = "RebindScript";
            ClientScriptManager cs = Page.ClientScript;
              
            if (FileRadUpload.UploadedFiles.Count > 0)
            {
                if (customerDataId > 0)
                {
                    Customers customers = new Customers();
                    foreach (UploadedFile file in FileRadUpload.UploadedFiles)
                    {
                        if (customers.CustomerFileExists(file.GetName()))
                        {
                            if (FileExistsHidden.Value != "1")
                            {
                                if (!cs.IsClientScriptBlockRegistered(SubmitButton.GetType(), warningScriptName))
                                {
                                    cs.RegisterClientScriptBlock(GetType(), SubmitButton.ID, "ExecuteConfirm();", true);
                                }
                            }
                            else
                            {
                                FileExistsHidden.Value = "";
                            }
  
                        }
                        else
                        {
                            customers.InsertCustomerFile(customerDataId, file.GetName(), Portal.GetIdsid);
                        }
                    }
                }
            }
  
            if (!cs.IsClientScriptBlockRegistered(GetType(), rebindScriptName))
            {
                cs.RegisterClientScriptBlock(cstype, rebindScriptName, "CloseAndRebind();", true);
            }
        }

Bozhidar
Telerik team
 answered on 01 Feb 2012
1 answer
156 views
This might help someone in future: 

I had a problem with a RadComboBox where I was binding to a datasource for the DataTextField and DataValueField, but checking the state of the RadComboBoxItems I noticed that the Value was consistently set to an empty string "". 

I couldn't come up with any answers until I discovered that in the control declaration in HTML I had mistyped DataValueField as DataValue. 

The string thing is that the Control doesn't check for invalid properties and raise and exception??

Regards,
Jacques
Ivana
Telerik team
 answered on 01 Feb 2012
0 answers
78 views
Hi there,
I've used demo code to get a list of the submitted check boxes from the tree view:

 private static void ShowCheckedNodes(RadTreeView treeView, Label label)
        {
            string message = string.Empty;
           
            IList<RadTreeNode> nodeCollection = treeView.CheckedNodes;
            foreach (RadTreeNode node in nodeCollection)
            {
                message += node.FullPath + "<br/>";
            }
            label.Text = message;
        }

This is all good, however it only shows the Text (Subject_Place ). Each node has an ID number field (SubjectID). Its this ID number I need, rather than the Text.
How can I get this instead of the Text?
Thanks,
Alan 


** UPDATE **
Seems like I've stumbled on the answer myself,  just needed to add:
message += node.Value + "<br/>";

Thanks.
Alan
Top achievements
Rank 1
 asked on 01 Feb 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?