Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
224 views
Hi,

I have a problem when trying to sorting on a column with a complex object without any value.

My code looks basically as follow:
public class Product{
 
  public int Id {get;set;}
  public string Name {get;set;}
 
  public Statistics Stats {get;set;}
}
 
public class Statistics {
  public int Downloads {get;set;}
}

The grid:

...
 <telerik:GridBoundColumn UniqueName="Id" DataType="System.Int32" DataField="Id" HeaderText="Id">
 </telerik:GridBoundColumn>
 <telerik:GridBoundColumn UniqueName="Name" DataType="System.String" DataField="Name" HeaderText="Name">
 </telerik:GridBoundColumn>
 <telerik:GridBoundColumn UniqueName="Downloads" DataType="System.Int32" DataField="Stats.Downloads" HeaderText="Downloads" DataFormatString="{0:n0}">
 </telerik:GridBoundColumn>
...

When I bind multiple records, some of them have the Stats property null, it's bind correctly. The records without stats are kept blanc for the Downloads column.

However, when I try to sort on the Downloads column, I get a NullReferenceException.

Any idea how to solve this?

Thanks
Danny
Danny
Top achievements
Rank 1
 answered on 21 Mar 2012
1 answer
91 views
Hi,

                                         I am selecting my rows in keypress but on pressing down arrow my scroll bar moves faster than rowselection.How to make it move along with rowselection.Is this possible on setting keyboardnavigation to true.

                                         I have to show a window while pressing enter key on the row, but on setting keyboardnaviagation an edit form automatically comes while pressing enter key.

Help me
Thnx in advance.
Antonio Stoilkov
Telerik team
 answered on 21 Mar 2012
1 answer
150 views
I am currently developing Silverlight apps but I am concerned that this is an eventual dead end.  If possible please provide answers to the following questions and any other information you feel is important. 

1.  If I want to develop windows 8 metro apps and Windows Phone apps  will kendo ui web support it.

2.  Does kendo ui web work with Windows 7 client? 

3.  If kendo ui web works with Windows 7 how limited are touch gesters compared to Windows 8 Metro:

4. Please explain difference between Kendo UI web and mobile apps.

5. Will a kendo web app developed for windows 7 work on a ipad?

Thanks
Rich
Georgi Tunev
Telerik team
 answered on 21 Mar 2012
1 answer
84 views
i'm trying to add a RadFilter to filter my RadGrid which has several coulmns.it works fine. now i need to add a dropdown only for a one column filter.i have a column named  Revision in my RadGrid.i'm trying the following but it doesn't work

   <telerik:RadFilter runat="server" ID="RadFilter1" 
                FilterContainerID="gridSearchL3" ShowApplyButton="true" Height="100px" >
                <FieldEditors>
                <custom:RadFilterDropDownEditor DataValueField="Revision" DataTextField="Revision" DataType="System.String" FieldName="Revision" />
       
                </FieldEditors>
                </telerik:RadFilter>

i'm getting the error " Object reference not set to an instance of an object"
for creating custom dropdown i've used following class

http://www.telerik.com/help/aspnet-ajax/filter-custom-editors.html  
Tsvetina
Telerik team
 answered on 21 Mar 2012
8 answers
704 views
Hello,
When I export radGrid  to excel file I got a table with different text-align styles in each row. !!!!!
I'm trying set style: 

radGrid1.MasterTableView.Style[

"text-align"] = "left";
but this don't solve my problem. This style for a table and not for a table cells.
how can I set cells styles?

Thanks a lot

 

Laura
Top achievements
Rank 1
 answered on 21 Mar 2012
4 answers
127 views
Hello,

I have a problem adding a TargetControl to my radToolTipManager on the client side. We are currently doing this in the code behind where it works like this.

tooltipManager.TargetControls.Add(ibAddToSelection.ClientID, value, true);

But now id like to do this on the clientside.

PS: This is not the same problem as the pinned "Changing TargetControl on the client". Since i also need to set the value.
Guido S
Top achievements
Rank 1
 answered on 21 Mar 2012
1 answer
438 views
How in the simplest way to resize whole component to make it bigger ?
Princy
Top achievements
Rank 2
 answered on 21 Mar 2012
4 answers
179 views
Hi,

We are using radGrid extensively in our project. We have enabled drag and drop and it also enable the user to add/remove columns. While we remove columns, columns are not alignned and it shows huge space where columns are removed. it got adjusted perfectly if you click " Ungroup " menu. It will be great if it gets adjusted at the moment column is removed. Please see the attached screen shot.

Thanks
Venkat
Princy
Top achievements
Rank 2
 answered on 21 Mar 2012
1 answer
284 views

How can I get value from GridDropDownColumn ? in c# on Code behind

Could you please help ?

<telerik:RadScriptManager ID="RadScriptManager" runat="server"></telerik:RadScriptManager>
        <!-- content start -->
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadGrid1">
                        <UpdatedControls>
                            <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                        </UpdatedControls>
                    </telerik:AjaxSetting>
                </AjaxSettings>
            </telerik:RadAjaxManager>
            <telerik:RadGrid ID="RadGrid1" Width="97%"
             AllowPaging="True"
             PageSize="15"
             runat="server"
             AllowSorting="True"
             OnCreateColumnEditor="RadGrid1_CreateColumnEditor"
             OnNeedDataSource="RadGrid1_NeedDataSource"
             OnDeleteCommand="RadGrid1_DeleteCommand"
             OnInsertCommand="RadGrid1_InsertCommand"
             OnItemDataBound="RadGrid1_ItemDataBound"
             AllowAutomaticDeletes="True"
             GridLines="None" Skin="WebBlue"
             AllowAutomaticInserts="True">
              <MasterTableView Width="100%" DataKeyNames="DestinationId" AutoGenerateColumns="False">
               <Columns>
 
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="MyImageButton" />
                </telerik:GridEditCommandColumn>
 
                <telerik:GridBoundColumn DataField="DestinationId" HeaderText="DestinationId" SortExpression="DestinationId"
                    UniqueName="DestinationId" ColumnEditorID="GridTextBoxColumnEditor1" ReadOnly="false" Visible="true">
                </telerik:GridBoundColumn>
                 
                <telerik:GridDropDownColumn DataField="OriginCountryCode"
                    HeaderText="Traveling From Country" ListTextField="CountryName" ListValueField="CountryCode"
                    UniqueName="OriginCountryCode" ColumnEditorID="GridDropDownColumnEditor1">
                </telerik:GridDropDownColumn>
 
                <telerik:GridDropDownColumn DataField="DestinationCountryCode"
                    HeaderText="Destination Country" ListTextField="CountryName" ListValueField="CountryCode"
                    UniqueName="DestinationCountryCode" ColumnEditorID="GridDropDownColumnEditor1">
                </telerik:GridDropDownColumn>
 
                <telerik:GridDropDownColumn DataField="PurposeId"
                    HeaderText="Purpose of Trip" ListTextField="Description" ListValueField="PurposeId"
                    UniqueName="PurposeId" ColumnEditorID="GridDropDownColumnEditor1">
                </telerik:GridDropDownColumn>
 
                <telerik:GridDateTimeColumn UniqueName="DateOfArrival" PickerType="DatePicker" HeaderText="Date of Arrival"
                            DataField="DateOfArrival"
                            <ItemStyle Width="120px" />
                        </telerik:GridDateTimeColumn>
 
                <telerik:GridDateTimeColumn UniqueName="DateOfDeparture" PickerType="DatePicker" HeaderText="Date of Departure"
                            DataField="DateOfDeparture"
                            <ItemStyle Width="120px" />
                        </telerik:GridDateTimeColumn>
 
                <telerik:GridCheckBoxColumn DataField="MultiEntry" HeaderText="Multi Entry Visa ?" SortExpression="MultiEntry"
                    UniqueName="MultiEntry">
                    <ItemStyle Width="120px" />
                </telerik:GridCheckBoxColumn>
 
                <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                </telerik:GridButtonColumn>
                </Columns>
 
<EditFormSettings ColumnNumber="1" CaptionDataField="DestinationId" CaptionFormatString="Destination Info {0}" >
<EditColumn UniqueName="EditCommandColumn1"></EditColumn>
</EditFormSettings>
                </MasterTableView>
            </telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 21 Mar 2012
1 answer
147 views
I am unable to locate how to access data from a GridEditMode.PopUp in your object model. In my RadGrid1_ItemCommand I have code to show the popup and this works(see below) but when I click on the insert button at the bottom of the popup the RadGrid1_ItemCommand fires again but I am unable to find the data I just entered into the popup.  I have looked on source, on RadGrid1, on e.item. etc...   Can you tell me where in your object model the popup data is stored?  The only example like this I could find was using AllowAutomaticInserts="True" which is not an option for me.  I need to validate the popup data in the codebehind before loading it into a collection and adding it to the grid.
Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
 Select Case e.CommandName
    Case "Add"
  
        ' Add button pressed. Reset any rows in Edit mode
  
        Dim grid As RadGrid = CType(source, RadGrid)
  
        If (grid.EditItems.Count > 0) Then
  
            grid.MasterTableView.ClearEditItems()
  
        End If
  
  
  
        ' Manual "Add" Button pressed, put grid in Insert mode
  
        If e.CommandName = "Add" Then
  
            grid.MasterTableView.EditMode = GridEditMode.PopUp
  
            e.Item.OwnerTableView.IsItemInserted = True
  
            e.Item.OwnerTableView.Rebind()
  
        End If
  
      Case "PerformInsert"
             'here is where I cannot find the popup data.
  
  End Select

Shinu
Top achievements
Rank 2
 answered on 21 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?