Telerik Forums
UI for ASP.NET AJAX Forum
18 answers
1.6K+ views
I have a problem when selecting the button to insert a new record in a grid containing a drop-down control.  I'm not doing anything custom - all declaritive except for the code in the object data source controls.  When I click the button on the details table to insert a new record, I get the following error:

DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'CountryCode'.

Note that if there is already data in the source database table for the details table, everything works fine.  This only happens when there is no data in the database.  I have been spending a long time on this and can't see what the issue is.

 

<%@ Page Title="TMS Carrier" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="gridHolderLarge">
        <h3 class="tableDesc">
            Carriers</h3>
        <telerik:RadGrid ID="grdCarrier" runat="server" AutoGenerateColumns="False" GridLines="None"
            DataSourceID="objDataCarrier">
            <MasterTableView AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                CommandItemDisplay="Top" DataKeyNames="CarrierId" DataSourceID="objDataCarrier"
                EditMode="InPlace" NoMasterRecordsText="No carriers to display.">
                <DetailTables>
                    <telerik:GridTableView runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                        AllowAutomaticUpdates="True" DataSourceID="objDataContact" NoDetailRecordsText="No contacts to display."
                        CommandItemDisplay="Top" DataKeyNames="ContactId,CountryCode">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="CarrierId" MasterKeyField="CarrierId" />
                        </ParentTableRelation>
                        <RowIndicatorColumn>
                            <HeaderStyle Width="20px" />
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn>
                            <HeaderStyle Width="20px" />
                        </ExpandCollapseColumn>
                        <CommandItemSettings AddNewRecordText="Add new contact" ShowRefreshButton="False" />
                        <Columns>
                            <telerik:GridBoundColumn DataField="Name" HeaderText="Contact Name" MaxLength="50"
                                UniqueName="column4">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Position" HeaderText="Position" MaxLength="50"
                                UniqueName="column5">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone" MaxLength="50" UniqueName="column6">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Address" HeaderText="Address" MaxLength="50"
                                UniqueName="column7" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="City" HeaderText="City" MaxLength="50" UniqueName="column8"
                                Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="State" HeaderText="State/Province" MaxLength="50"
                                UniqueName="column1" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PostalCode" HeaderText="Postal Code" MaxLength="30"
                                UniqueName="column2" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn DataField="CountryCode" DataSourceID="objDataCountry"
                                HeaderText="Country" ListTextField="Country" ListValueField="CountryCode" 
                                UniqueName="column" DefaultInsertValue="USA" Visible="False">
                            </telerik:GridDropDownColumn>
                            <telerik:GridBoundColumn DataField="Email" HeaderText="Email" MaxLength="200" UniqueName="column3">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Comment" HeaderText="Comment" MaxLength="4000"
                                UniqueName="column10" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="~/images/Cancel.gif"
                                EditImageUrl="~/images/Edit.gif" InsertImageUrl="~/images/Update.gif" Reorderable="False"
                                Resizable="False" UpdateImageUrl="~/images/Update.gif">
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow"
                                ConfirmText="Are you sure you wish to permanently delete this contact?" ConfirmTitle="Delete Contact"
                                ImageUrl="~/images/Delete.gif" Reorderable="False" Resizable="False" Text="Delete"
                                UniqueName="column9">
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings>
                            <EditColumn UniqueName="EditCommandColumn1">
                            </EditColumn>
                        </EditFormSettings>
                    </telerik:GridTableView>
                </DetailTables>
                <CommandItemSettings AddNewRecordText="Add new carrier" />
                <ExpandCollapseColumn Visible="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="Name" HeaderText="Carrier" MaxLength="50" UniqueName="column1">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="AccountNumber" HeaderText="Account Number" MaxLength="50"
                        UniqueName="column2">
                    </telerik:GridBoundColumn>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" CancelImageUrl="~/images/Cancel.gif"
                        EditImageUrl="~/images/Edit.gif" InsertImageUrl="~/images/Update.gif" Reorderable="False"
                        Resizable="False" UpdateImageUrl="~/images/Update.gif">
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" ConfirmDialogType="RadWindow"
                        ConfirmText="Do you wish to permanently delete this carrier?" ConfirmTitle="Delete Carrier"
                        ImageUrl="~/images/Delete.gif" Reorderable="False" Resizable="False" Text="Delete"
                        UniqueName="column">
                        <ItemStyle HorizontalAlign="Center" />
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings>
                    <EditColumn UniqueName="EditCommandColumn1">
                    </EditColumn>
                </EditFormSettings>
                <AlternatingItemStyle BackColor="#EAF2FA" Font-Bold="False" Font-Italic="False" Font-Overline="False"
                    Font-Strikeout="False" Font-Underline="False" Wrap="True" />
            </MasterTableView>
        </telerik:RadGrid>
        <asp:ObjectDataSource ID="objDataCarrier" runat="server" DeleteMethod="DeleteCarrier"
            InsertMethod="InsertCarrier" OldValuesParameterFormatString="original_{0}" SelectMethod="GetCarriers"
            TypeName="Carrier" UpdateMethod="UpdateCarrier">
            <DeleteParameters>
                <asp:Parameter Name="original_CarrierId" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="AccountNumber" Type="String" />
                <asp:Parameter Name="original_CarrierId" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="AccountNumber" Type="String" />
            </InsertParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="objDataContact" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetContacts" TypeName="CarrierContact">
            <SelectParameters>
                <asp:Parameter Name="CarrierId" Type="Int32" DefaultValue="" />
            </SelectParameters>
        </asp:ObjectDataSource>
        <asp:ObjectDataSource ID="objDataCountry" runat="server" OldValuesParameterFormatString="original_{0}"
            SelectMethod="GetCountries" TypeName="Country"></asp:ObjectDataSource>
    </div>
</asp:Content>

 

 

Jonathan
Top achievements
Rank 1
 answered on 27 Jan 2015
1 answer
449 views
Hello,

I am trying to create a simple RadTabStrip with 2 RadTab's.  I would like the RadTabStrip width to be 100% and each RadTab to be 50%.  But when I put a percentage in the RadTab like below it seems to ignore it.

I am using Telerik UI  for ASP.net Ajax v.2014.3.1209.40.  Thanks in advance.  I appreciate the help.

<div style="width: 100%; max-width: 1000px;">
    <telerik:RadTabStrip runat="server" ID="RadTabStrip2" MultiPageID="RadMultiPage1" SelectedIndex="0" Skin="BlackMetroTouch" Width="100%">
        <Tabs>
            <telerik:RadTab Text="Sign In" Width="50%"></telerik:RadTab>
            <telerik:RadTab Text="Sign Out" Width="50%"></telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
</div>
Ivan Danchev
Telerik team
 answered on 27 Jan 2015
1 answer
182 views
I have a radgrid and i have added radtreeview control in the item template. We have enabled the checkbox option for radgrid. I have a normal checkbox (like select all) at the radgrid header template. if I check this normal checkbox, then all the checkboxes (of the tree nodes) of all treeviews in the item template of the radgrid should be checked and if we uncheck then it should uncheck. I need to achieve this by using jquery. Because, we don't have option to handle this on server side. I have written the below script but id does not work for me.


function SelectAllNodes(check, parentID) {
    var parent = $("#" + parentID)[0];
    if (parent) {
        $('#' + parent.id).find('tr').each(function () {
            var row = $(this);
            row.find("#RadTreeView1").find("INPUT[type='checkbox']").each(function () { $(this).attr("checked", check) });
        });}}
Here 'parentID' is the radgrid control id and 'RadTreeView1' is the radtreeview control id placed in the item template. I want to loop through each tr of radgrid row's instead of using radgrid client side methods to get each row of radgrid. 

Please help me on this.

Thanks







Jithendra
Top achievements
Rank 1
 answered on 27 Jan 2015
2 answers
333 views
Is there a way to force a page-break into an Excel (HTML) export file - at a row of my choosing?  I can't find anything in the documentation about page breaks - and the forum search also turned up nothing for me.
Kostadin
Telerik team
 answered on 27 Jan 2015
1 answer
577 views
Hello, I'm a current customer. We just purchased DevCraft not long ago...and I've been implementing a bunch of controls.

I have a spec from a customer to build an image map of a movie theater, and then you click a seat and I add it to a cart. Also, seats will be colored...red if unavailable, green if available.

With that being said, can the ASP.NET Map control be used for this? Or only for 'live' maps, such as Bing? 

If this control is not suitable, is there another in your Suite?

I realize .Net has an ImageMap control, but it doesn't support Styling or IDs on hotspots.

Thanks!

Jay
Ianko
Telerik team
 answered on 27 Jan 2015
3 answers
211 views
Hi
I want to use RAdHtmlchart for our new project. We use asp.net.vb Is there any 3D bar/column  chart  available in RadHtml Chart. How do I pass the dataset in creating Column chart /bar chart in code behind

Thanks
Rajeswari Raman
Danail Vasilev
Telerik team
 answered on 27 Jan 2015
2 answers
215 views
Hi All,

I'm using RadFileExplorer for network shared folder. I can view folder correctly but when i cliec the file to open
i get this error "CS0433: The type 'PathHelper' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET ...

I added the error page photo.

Can you suggest any solution

best regards





YUNUS EMRE
Top achievements
Rank 1
 answered on 27 Jan 2015
5 answers
220 views
Hi,

I have a weird problem with the WebResourse.axd. I am getting the attached error when i deploy the code to test region and is working fine in my local.

If i remove the Rad Ajax Panel, it is working fine.

Did i miss any configurations?

Thanks,
Prabhakar Bolla
Konstantin Dikov
Telerik team
 answered on 27 Jan 2015
1 answer
150 views
Hi Guys,

May I ask for your opinion if this graph is possible with telerik Bar Chart?
The one with erasures has texts on it that holds the Categories.

Thank you for your responses.
Danail Vasilev
Telerik team
 answered on 27 Jan 2015
1 answer
734 views
I am new and just started using telerik tools.  I have an application where I am using a radtextbox to input a phone number. I have used "maxLength" to control max number of characters.  Now, to just make sure the user enters the minimum number of characters, I am not sure what to do.  Was wondering if there was a minLength property within telerik or not. Thanks 
Eyup
Telerik team
 answered on 27 Jan 2015
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?