Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
97 views
Hi,

my grid displays - for example - organization units: OrgUnit objects. The OrgUnit class has a property "Manager" which contains an instance of the class "Person". This class has, in turn, a property named "FullName".
I want to display names of managers in one of the grid's columns. I bind this column with: "Manager.FullName". And it works perfectly - event for units with no manager.
Then, I want to sort my grid by this column. I put SortExpression="Manager.FullName". It works - but fails (NullReferenceException) when any of displayed units has no manager.
I understand that "Manager.FullName" can raise this exception when "Manager" is null but when displaying data it doesn't.
Can I solve this problem any way?
The workaround: define a special property "ManagerFullName" (return Manager == null ? "" : Manager.FullName) is not acceptable.

Regrads
Tomasz
Tomasz M.Lipiński
Top achievements
Rank 1
 answered on 24 Nov 2010
1 answer
163 views
I had an application, with an outlook sytle menu. It was working fine until upgraded the latest version of RadControlers.

Now, the splitters dont resize to 100%, instead, they sit at about 400px.

<%

 

@ Master Language="C#" AutoEventWireup="true" CodeBehind="Expd8.Master.cs" Inherits="Expd8.Expd8" %>

 

<!

 

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

 

html xmlns="http://www.w3.org/1999/xhtml">

 

<

 

 

link rel="Stylesheet" type="text/css" href="style.css" />

 

<

 

 

head runat="server">

 

 

 

<title></title>

 

 

 

<asp:ContentPlaceHolder ID="head" runat="server">

 

 

 

</asp:ContentPlaceHolder>

 

</

 

 

head>

 

<

 

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

<telerik:RadScriptManager ID="RadScriptManager1" runat="server">

 

 

 

</telerik:RadScriptManager>

 

 

 

<telerik:RadFormDecorator ID="RadFormDecorator" runat="server" Skin="Windows7" DecoratedControls="Buttons" />

 

 

 

<div style="height:100%">

 

 

 

<telerik:RadSplitter ID="RadSplitter1" ResizeWithParentPane="false" Width="100%" Height="100%" Orientation="Horizontal" runat="server">

 

 

 

<telerik:RadPane ID="RadPane1" BorderWidth="5px" Width="100%" Height="80px" runat="server">

 

 

 

<asp:Image ID="imgLogo" runat="server" ImageUrl="~/Images/Logo.png" />

 

 

 

</telerik:RadPane>

 

 

 

<telerik:RadPane ID="RadPane2" BorderWidth="5px" Height="100%" runat="server">

 

 

 

 

 

<telerik:RadSplitter ID="RadSplitter2" Width="100%" Height="100%" ResizeWithParentPane="false" Orientation="Vertical" runat="server">

 

 

 

<telerik:RadPane ID="RadPane3" BorderWidth="5px" Scrolling="None" Width="250px" MinWidth="250" MaxWidth="250" runat="server">

 

 

 

<telerik:RadSplitter ID="RadSplitter" Orientation="Horizontal" ResizeWithParentPane="false" Height="100%" Runat="server">

 

 

 

<telerik:RadPane ID="RadPane5" Height="100%" runat="server">

 

 

 

<table style=" height:100%; width:100%; background-color:#dfe9f5"> <tr><td valign="top">

 

 

 

<asp:ContentPlaceHolder ID="ContentPlaceHolderLeft" runat="server">

 

 

 

</asp:ContentPlaceHolder>

 

 

 

</td></tr></table>

 

 

 

</telerik:RadPane>

 

 

 

<telerik:RadPane ID="RadPane6" BorderWidth="5px" Scrolling="None" Height="50px" runat="server">

 

 

 

 

<telerik:RadPanelBar ID="rLeftPanel" Height="100px"

 

 

 

ExpandMode="FullExpandedItem" BorderColor="Beige" ForeColor="AliceBlue"

 

 

 

BackColor="AliceBlue" runat="server" Skin="Windows7" SingleExpandedPanel="True"

 

 

 

FullExpandedPanels="True">

 

 

 

<Items>

 

 

 

 

<telerik:RadPanelItem runat="server" Text="Reports" CssClass="panelButton" NavigateUrl="SynopsisReport.aspx" ImagePosition="Right" ImageUrl="~/Images/synopreport.png" >

 

 

 

</telerik:RadPanelItem>

 

 

 

</Items>

 

 

 

</telerik:RadPanelBar>

 

 

 

</telerik:RadPane>

 

 

 

</telerik:RadSplitter>

 

 

 

</telerik:RadPane>

 

 

 

<telerik:RadPane ID="RadPane4" BorderWidth="5px" BorderStyle="Solid" Width="80%" runat="server">

 

 

 

<table>

 

 

 

<tr><td style="border:13px, solid, #abbdd5">

 

 

 

 

</td>

 

 

 

<td valign="top" align="left" style="border:3px, solid, #abbdd5; width:100%" width="100%" >

 

 

 

<asp:ContentPlaceHolder ID="ContentPlaceHolderMain" runat="server">

 

 

 

</asp:ContentPlaceHolder></td></tr>

 

 

 

</table>

 

 

 

</telerik:RadPane>

 

 

 

</telerik:RadSplitter>

 

 

 

 

</telerik:RadPane>

 

 

 

</telerik:RadSplitter>

 

 

 

 

 

</div>

 

 

 

</form>

 

</

 

 

body>

 

</

 

 

html>

 

Dobromir
Telerik team
 answered on 24 Nov 2010
1 answer
262 views
Hi ,

 i am new to telerik my telerik version is "2009.1.527.35".when a page loads taking more time for loading "Telerik.Web.UI.WebResource.axd" and size is about "285236".

how can i reduce the size and how can i apply compression technic to load the resource files fastly.


Thanks in advance,
Naveen.
Mira
Telerik team
 answered on 24 Nov 2010
1 answer
102 views
Ok, I am working with a web part that is used in multiple place in our code for reports.  The web part has a RadGrid on it.  The grid itself is set to take up to 100% of the container it is in.  The issue I am having is that for some reason on one of the reports when we print it out or do a print preview, the grid headers and about 10 to 15 rows of data are missing.  The first page of the print out has the content above the grid printing and the second page starts between row 11 and 15.  Now, when I go into the print preview funtion and change the Zoom percentage to 150% or a custom 200%, I can see more or even all the rows that are missing as well as part of the header rows.  The other reports that are using this web part all work fine.  The report is also missing about half of a column of data.  There is one of the other reports that is missing 1 and a half columns of data, but the the headers and all the data print.

Has anyone else seen an issue like this?

Veli
Telerik team
 answered on 24 Nov 2010
1 answer
79 views
I need to dynamically add GridHTMLEditorColumn to Radgrid and got error when click the edit button on the grid:

Cannot create column with the specified type name: GridHTMLEditorColumn 

If I change the bundColumn to GridBoundColumn, then no error . Please help!!

 

 

 


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

below is my code:

 

 

 

 

 

protected void Page_Load(object sender, EventArgs e)

 

 

 

 

 

 

GridHTMLEditorColumn boundColumn = new GridHTMLEditorColumn();

 

boundColumn.DataField =

"French";

 

boundColumn.HeaderText =

"French";

 

boundColumn.UniqueName =

"French";

 

 

this.RadGrid1.MasterTableView.Columns.Add(boundColumn);

 

}


 

 

protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

 

 

//bind grid to db
DataSet
ds;
ds =
SqlHelper.ExecuteDataset(ConfigurationManager.ConnectionStrings["ConnStr"].ConnectionString, "sp_Languages_Get"); 

 

RadGrid1.DataSource = ds;

}

 


 

<

 

html xmlns="http://www.w3.org/1999/xhtml">

 

<

 

head runat="server">

 

 

 

 

 

<title></title>

 

</

 

head>

 

<

 

body>

 

 

 

 

 

<form id="form1" runat="server">

 

 

 

 

 

<div>

 

 

 

 

 

 

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">

 

 

 

 

 

</telerik:RadScriptManager>

 

 

 

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"

 

 

GridLines="None" onneeddatasource="RadGrid1_NeedDataSource">

 

<

 

MasterTableView autogeneratecolumns="True">

 

<

 

RowIndicatorColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

RowIndicatorColumn>

 

<

 

ExpandCollapseColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

ExpandCollapseColumn>

 

 

 

 

 

<Columns>

 

 

 

 

 

<telerik:GridEditCommandColumn>

 

 

 

 

 

</telerik:GridEditCommandColumn>

 

 

 

 

 

<telerik:GridButtonColumn CommandName="Delete" Text="Delete"

 

 

UniqueName="column">

 

 

 

 

 

</telerik:GridButtonColumn>

 

 

 

 

 

</Columns>

 

</

 

MasterTableView>

 

 

 

 

 

</telerik:RadGrid>

 

 

 

 

 

 

</div>

 

 

 

 

 

</form>

 

</

 

body>

 

</

 

html>

 

 

 


Thanks

Radoslav
Telerik team
 answered on 24 Nov 2010
1 answer
87 views
The RadGrid control causes the app pool to recycle. any ideas?
Mira
Telerik team
 answered on 24 Nov 2010
2 answers
424 views
When i'm going to redirect to home page after assigning empty values to filters and sortings in click event of "Clear filters & Sortings"
i'm getting following javascript runtime error.Pls send me a solution ASAP.

Microsoft JScript runtime error:
Sys.InvalidOperationException:
Handler was not added through the Sys.UI.DomEvent.addHandler method.

In my home page I should load the grid with no filters and sortings.
Radoslav
Telerik team
 answered on 24 Nov 2010
1 answer
122 views
Hello Everyone,

Could someone please provide me with a RadScheduler  with AdvancedForm sample project  than can create/edit/delete appointment  without using Provider?
create/edit/delete for In-memory data is fine.
Thanks in advance.

Regards,
NNT
Veronica
Telerik team
 answered on 24 Nov 2010
1 answer
82 views
I have a Radtreeview that is filled on demand. The treeview contains 3 level and each has a category and has a different context menu added to it.

Everything works as how it is supposed except when try to click a context menu on any node while a node on the third tier is selected. The context menu shows fine but when clicking the menu the Contextmenuclicked event does not even fire!
How can I solve this?
Martin
Top achievements
Rank 1
 answered on 24 Nov 2010
6 answers
943 views
Trying to get the selected value from the radcombobox that is in the edit item template of the radgrid.  Also trying to set the selected value when the edit command is selected.  here is the code below. In the update command i can find the control but for some reason the selected value is blank.  What about using the onSelectedIndexChanged?  is there a certain way you have to do it when the radcombobox is within the edit item template?

Thanks.

<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" PageSize="10"
            AllowPaging="true" AllowSorting="true" AllowMultiRowEdit="True" 
                              AllowMultiRowSelection="true" HorizontalAlign="NotSet" OnItemCommand="RadGrid1_ItemCommand" OnUpdateCommand="RadGrid1_UpdateCommand">
                              <MasterTableView CommandItemDisplay="top" DataKeyNames="JobId" ClientDataKeyNames="JobId"
                                  EditMode="InPlace" HorizontalAlign="NotSet">
                                  <Columns>
                                      <telerik:GridEditCommandColumn ItemStyle-Width="100px" FooterText="EditCommand footer" UniqueName="EditCommandColumn"
                                          HeaderText="Edit" HeaderStyle-Width="100px" UpdateText="Update">
                                      </telerik:GridEditCommandColumn>
                                      <telerik:GridBoundColumn ItemStyle-Width="50px" HeaderStyle-Width="50px" ReadOnly="true" DataField="JobId" HeaderText="Job Id" DataType="System.String">
                                      </telerik:GridBoundColumn>
                                      <telerik:GridTemplateColumn DataField="JobCode" HeaderText="Job Code" DataType="System.String">
                                          <ItemTemplate>
                                              <%#DataBinder.Eval(Container.DataItem, "JobId")%>
                                          </ItemTemplate>
                                          <EditItemTemplate>
                                              <telerik:RadComboBox runat="server" ID="RadComboBox1" EnableLoadOnDemand="True" DataTextField="Job Code"
                                                  OnItemsRequested="RadComboBox1_ItemsRequested" DataValueField="JobCode" AutoPostBack="false"
                                                  HighlightTemplatedItems="true" Height="140px" Width="100px" DropDownWidth="100px"
                                                  OnSelectedIndexChanged="RadComboBox1_OnSelectedIndexChanged" SelectedValue='<%#Bind("JobId")%>' >
                                              </telerik:RadComboBox>
                                          </EditItemTemplate>
                                      </telerik:GridTemplateColumn>
                                      <telerik:GridBoundColumn ReadOnly="true" DataField="Description" HeaderText="Description" DataType="System.String">
                                      </telerik:GridBoundColumn>
                                      <telerik:GridTemplateColumn DataField="JobCodeMatch" HeaderText="Job Code Match"
                                          DataType="System.String">
                                          <ItemTemplate>
                                              <%#DataBinder.Eval(Container.DataItem, "JobCodeMatch")%>
                                          </ItemTemplate>
                                          <EditItemTemplate>
                                              <telerik:RadComboBox runat="server" ID="RadComboBox2" EnableLoadOnDemand="True" DataTextField="Job Code Match"
                                                  OnItemsRequested="RadComboBox2_ItemsRequested" DataValueField="JobCodeMatch"
                                                  AutoPostBack="false" HighlightTemplatedItems="True" Height="140px" Width="100px"
                                                  DropDownWidth="100px" OnSelectedIndexChanged="RadComboBox2_OnSelectedIndexChanged" SelectedValue='<%#Bind("JobCodeMatch")%>' >
                                              </telerik:RadComboBox>
                                          </EditItemTemplate>
                                      </telerik:GridTemplateColumn>
                                      <telerik:GridBoundColumn ReadOnly="true" DataField="LaborText" HeaderText="Labor Flag" DataType="System.String">
                                      </telerik:GridBoundColumn>
                                      <telerik:GridBoundColumn ReadOnly="true" DataField="EditDate" HeaderText="Edit Date" DataType="System.String">
                                      </telerik:GridBoundColumn>
                                      <telerik:GridBoundColumn ReadOnly="true" DataField="Editor" HeaderText="Editor" DataType="System.String">
                                      </telerik:GridBoundColumn>
                                      <telerik:GridBoundColumn ReadOnly="true" DataField="Contact" HeaderText="Contact" DataType="System.String">
                                      </telerik:GridBoundColumn>
                                  </Columns>
                                  <EditFormSettings>
                                  </EditFormSettings>
                              </MasterTableView>
                              <ClientSettings>
                                  <Selecting AllowRowSelect="True" EnableDragToSelectRows="True" />
                              </ClientSettings>
                       </telerik:RadGrid>

Protected Sub OnItemDataBoundHandler(ByVal sender As Object, ByVal e As GridItemEventArgs)
    If e.Item.IsInEditMode Then
        Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem)
        Session("rcbValue") = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("JobId").ToString()
        If Not (TypeOf e.Item Is IGridInsertItem) Then
            Dim combo As RadComboBox = DirectCast(item.FindControl("RadComboBox1"), RadComboBox)
        End If
    End If
End Sub
 
Protected Sub RadComboBox1_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)  
    oData = oPassThru.GetJobCodeIds(Profile.Business) '(Profile.Business)
    Dim comboBox As RadComboBox = DirectCast(sender, RadComboBox)
    comboBox.Items.Clear()
    For Each o As clsAdminJobCodes In oData
        Dim item As New RadComboBoxItem()
        item.Text = o.JobId.ToString()
        item.Value = o.JobId.ToString()
        comboBox.Items.Add(item)
        item.DataBind()
    Next
End Sub
  
Protected Sub RadComboBox2_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
    oData = oPassThru.GetJobCodeMatchId(Profile.Business) '(Profile.Business)
    Dim comboBox As RadComboBox = DirectCast(sender, RadComboBox)
    comboBox.Items.Clear()
    For Each o As clsAdminJobCodes In oData
        Dim item As New RadComboBoxItem()
        item.Text = o.JobCodeMatch.ToString()
        item.Value = o.JobCodeMatch.ToString()
        comboBox.Items.Add(item)
        item.DataBind()
    Next
 End Sub
 
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
    If (e.CommandName = RadGrid.EditCommandName) Then
        Session("rcbValue") = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("JobId").ToString()
    End If
 End Sub
 
Protected Sub RadGrid1_UpdateCommand(ByVal source As Object, ByVal e As GridCommandEventArgs)
    Dim var3 As String = CType(RadGrid1.Items(0).FindControl("RadComboBox1"), RadComboBox).SelectedValue
    Dim editedItem1 As GridEditableItem = TryCast(e.Item, GridEditableItem)
    Dim var As String = CType(editedItem1.Cells(4).Controls(1), RadComboBox).SelectedValue
    Dim Var2 As String = CType(editedItem1.Controls(4).FindControl("RadComboBox2"), RadComboBox).SelectedValue
 End Sub
Simon
Telerik team
 answered on 24 Nov 2010
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?