Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
73 views

A property named 'TextBox2' was not found on the entity during an insert, update, or delete operation. Check to ensure that properties specified as binding expressions are available to the data source.

I have a pop-up edit form that I use to edit data.  I am able to pull up the form and after I make changes to a text box item in the form, this is message I receive when I click the forms update button.

It seems that I must expose these textboxes to the Data Source that I created, but I am not sure how to do it, or even if this is the action that the data sources is asking me to do.

Any ideas, or information would be very helpful.  Been reading the forums and viewing demos, but did not find a post or demo that explained how to do this.

Thanks!

Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Mar 2011
3 answers
316 views
I am trying to close the edit form of this RadGrid:

 

<telerik:RadGrid ID="rgAccountRangeSet" runat="server" 
            AutoGenerateColumns="False" GridLines="None" AllowAutomaticDeletes="True" 
            AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
            PageSize="25" AllowPaging="True" AllowSorting="True" >
            <PagerStyle Mode="NumericPages" />
            <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" CommandItemSettings-ShowRefreshButton="False" 
                HorizontalAlign="NotSet" DataKeyNames="Id">
                <CommandItemSettings AddNewRecordText="Add New Account Range" AddNewRecordImageUrl="~/images/Keymaster/add.gif"/>
                <NoRecordsTemplate>
                    <center><b>No records available</b></center>
                </NoRecordsTemplate>
                <Columns>
                </Columns>  
                <EditFormSettings>
                    <EditColumn ButtonType="PushButton" />                    
                </EditFormSettings>
            </MasterTableView>
        </telerik:RadGrid>

 

 

 


With the following code:

 

Private Sub rgAccountRangeSet_InsertCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgAccountRangeSet.InsertCommand
       'code to handle insert items has been removed
        rgAccountRangeSet.Rebind()
        rgAccountRangeSet.MasterTableView.IsItemInserted = False
End Sub

However, I am getting an exception.  When I remove "IsItemInserted = False" assignment, the exception goes away.  I also want to mention that I am opening the page in certain scenarios with "IsItemInserted = True" with no problem.  The grid opens fine and displays the edit form.  Any ideas?

Thanks in advance!!

Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Mar 2011
1 answer
59 views
I've got an ASP.NET Master/Content page combination with a grid pointing to an EntityDataSource. (I'm using my simplest Entity, which just has a RoleId (PK) and Name.) The Entity set is currently empty, and when I use the "Add new record" button to add a record, I get the form showing up correctly. When I click "Insert" after assigning the RoleId and Name, the dialog goes away, but the item isn't added to my collection.

I've got all the "automatic" flags set for editing, inserting, and deleting in both the EntityDataSource and the Grid. What else do I need to set up to have the values saved to the entity collection?

Jayesh Goyani
Top achievements
Rank 2
 answered on 25 Mar 2011
2 answers
106 views
I have one RadGrid with PageSize="5" and i populate with a dataset:
Public Sub LlenaGrid()
      Strsql = "Select Empresa,Corr,NomPuesto,Salario from templeo where codusuario = " & Session("CodUsuario") & ""
      cn.Open()
      daData.SelectCommand = New OleDb.OleDbCommand(Strsql, cn)
      daData.Fill(dsGen, "DATA")
      GrdEmpleo.DataSource = dsGen
      GrdEmpleo.DataMember = "DATA"
      GrdEmpleo.DataBind()
      cn.Close()
 
      dsGen.Tables("DATA").Clear()
  End Sub

and the Grid work but when i move to the page No 2 or i click next page the Grid don´t show me any result, this is the html of the grid: 
<telerik:RadGrid runat="server" ID="GrdEmpleo" PageSize="5" AutoGenerateColumns="False"
                    Width="100%" AllowSorting ="True" AllowPaging ="True" GridLines="None" TabIndex="17">
                <PagerStyle Mode="NextPrevAndNumeric" NextPageText="Siguiente" PrevPageText="Anterior"
                 PagerTextFormat="Change page: {4} &nbsp;Pagina <strong>{0}</strong> de <strong>{1}</strong>, registros <strong>{2}</strong> a <strong>{3}</strong> de <strong>{5}</strong>."
                 PageSizeLabelText="Regitros"/>
                <MasterTableView DataKeyNames="Empresa,Corr,NomPuesto,Salario">
                    <Columns>
                        <telerik:GridButtonColumn DataTextField="Empresa" UniqueName="Empresa" HeaderText="Empresa"></telerik:GridButtonColumn>
                        <telerik:GridBoundColumn DataField="Corr" UniqueName="Corr" Visible="false" HeaderStyle-Width="75px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Nompuesto" UniqueName="NomPuesto" HeaderText="Puesto"  HeaderStyle-Width="75px"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Salario" HeaderText="Salario" HeaderStyle-Width="75px">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <clientsettings>
                    <selecting allowrowselect="True" />
                </clientsettings>
                <FilterMenu EnableTheming="true">
                    <CollapseAnimation Duration="200" Type="InOutQuint" />
                </FilterMenu>
             </telerik:RadGrid>

and here is the event PageIndexChanged:
Private Sub GrdEmpleo_PageIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridPageChangedEventArgs) Handles GrdEmpleo.PageIndexChanged
        Try
            LlenaGrid()
        Catch ex As Exception
            LblMensaje.Text = ex.Message
        End Try
 
    End Sub

I don´t know whats happend whit this grid, i need some helps
thank you in advance

Hector Hernandez
Top achievements
Rank 2
 answered on 25 Mar 2011
1 answer
92 views
I have a combo-box which provides a list of objects. When the user selects the item in the combo-box, it is bound to an ObjectDataSource. That ObjectDataSource is bound to a RadGrid which auto-populates the grid. This works great.

In this scenario, how do we get the first row of that grid to be selected whenever the user picks a new value in the combo-box? We have tried the grid's pre-render event and the ObjectDataSource's selected event. None of these work as the data has not yet been populated into the grid. 

We also tried the grid's ItemBound event; however, it fires with every event on the grid it seems. We only need it to set the first row when new data has been bound.

Any suggestions on which event to use?

Princy
Top achievements
Rank 2
 answered on 25 Mar 2011
1 answer
277 views
All,

I am having an issue displaying data in my grid using Telerik AJAX controls v. 2010.3.1317.35. I have no idea why, as numerous other grids in other user controls on the same page are displaying fine. I can see in my NeedDataSource event that the oARAC collection object has data, and that the column name in the query is correct in the grid column. I can also see the grid shows 2 empty rows, so for some reason the grid is interpreting the data "4999220" as &nbsp;

I have confirmed that the NeedDataSource event is not firing twice when loaded, and I am not getting any exceptions.

Below is the code, and attached are the images of what is going on as I debug.

Any and all help is greatly appreciated!

Thanks,
Bruce
       
protected void rgApplications_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    LaundryLogicDAL.ARApplicationsCollection oARAC = new LaundryLogicDAL.ARApplicationsCollection();
 
    LaundryLogicDAL.ARApplicationsQuery oARAQ = new LaundryLogicDAL.ARApplicationsQuery("ara");
    LaundryLogicDAL.ARCreditsQuery oARCQ = new LaundryLogicDAL.ARCreditsQuery("arc");
    LaundryLogicDAL.ARDebitsQuery oARDQ = new LaundryLogicDAL.ARDebitsQuery("ard");
 
    try
    {
        oARAC.es.Connection.Name = "NAS";
        oARAC.es.Connection.SqlAccessType = esSqlAccessType.DynamicSQL;
        oARAQ.es2.Connection.Name = "NAS";
        oARAQ.es2.Connection.SqlAccessType = esSqlAccessType.DynamicSQL;
        oARCQ.es2.Connection.Name = "NAS";
        oARCQ.es2.Connection.SqlAccessType = esSqlAccessType.DynamicSQL;
        oARDQ.es2.Connection.Name = "NAS";
        oARDQ.es2.Connection.SqlAccessType = esSqlAccessType.DynamicSQL;
 
        oARAQ.Select(
            oARCQ.CreditIdentifier,
            oARCQ.CreditDate,
            oARCQ.OriginalAmount.As("CreditAmount"),
            oARAQ.ApplicationDate,
            oARAQ.Amount.As("ApplicationAmount"),
            oARAQ.Notes.As("ApplicationNotes"),
            oARDQ.DebitIdentifier,
            oARDQ.DebitDate,
            oARDQ.OriginalAmount.As("DebitAmount")
            );
        oARAQ.InnerJoin(oARCQ).On(
            oARAQ.CreditID == oARCQ.Id);
        oARAQ.InnerJoin(oARDQ).On(
            oARAQ.DebitID == oARDQ.Id);
 
        //if (Session["DebitID"] != null)
        if (ViewState["DebitID"] != null && (int)ViewState["DebitID"] >= 0)
        {
            oARAQ.Where(
                //oARAC.Query.DebitID == (int)Session["DebitID"]
                oARAQ.DebitID == (int)ViewState["DebitID"]
                );
        }
        else if (ViewState["CreditID"] != null && (int)ViewState["CreditID"] >= 0)
        {
            oARAQ.Where(
                //oARAC.Query.DebitID == (int)Session["DebitID"]
                oARAQ.DebitID == (int)ViewState["CreditID"]
                );
        }
 
        if (oARAC.Load(oARAQ))      
        {
            rgApplications.DataSource = oARAC;
        }
        else
        {
            rgApplications.DataSource = new object[0];
        }
    }
    catch(Exception ex)
    {
        rgApplications.DataSource = new object[0];
        DotNetNuke.Services.Exceptions.Exceptions.ProcessModuleLoadException(this, ex);
    }
    finally
    {
        oARAC.Dispose();
        oARAC = null;
        oARAQ = null;
        oARCQ = null;
        oARDQ = null;
    }
}

<telerik:RadGrid ID="rgApplications" runat="server" AllowFilteringByColumn="True"
    AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" GridLines="None"
    OnNeedDataSource="rgApplications_NeedDataSource">
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
    <MasterTableView AllowMultiColumnSorting="True">
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridBoundColumn DataField="CreditIdentifier" FilterControlAltText="Filter CreditIdentifier column"
                HeaderText="Credit ID" UniqueName="CreditIdentifier">
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>
Bruce
Top achievements
Rank 1
 answered on 25 Mar 2011
3 answers
162 views

Hi,

It seems that Korean Culture of RadDateTimePicker of Q2 version has something wrong which although I select time with PM but it is always selected only AM.
(but, it works with en-US culture)

please, refer to below details and let me know.

Many thanks,
Joey

<telerik:RadDateTimePicker ID="rdpReservationDate" runat="server" MinDate="2006/1/1" ToolTip="Please Select datetime.." Culture="Korean (Korea)" Width="170px">  
                        <DateInput runat="server" ID="DateInput">  
                        </DateInput>  
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>  
 
<TimeView CellSpacing="-1" Culture="Korean (Korea)"></TimeView>  
 
<TimePopupButton ImageUrl="" HoverImageUrl=""></TimePopupButton>  
 
<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>  
                    </telerik:RadDateTimePicker> 

 

Daniel
Telerik team
 answered on 24 Mar 2011
2 answers
73 views
hey ,
'M new in radcontrols .. and i have a problem with radgrid ..
the prob's when i select a row from grid ,, i cant access the selected row in my cs code ..
wat i was writing when i was using GridView is :
GridView1.SelectedRow.cells[1].text;
can anyone tell me how i can do that with radGrid ?!!
myceno
Top achievements
Rank 1
 answered on 24 Mar 2011
12 answers
369 views
Hi,
I am using RadGrid with RadFilter. Everything works fine, after I select some data to filter and apply the filter if I close the browser after that I get the "Microsoft JScript runtime error: '_events' is null or not an object" error somewhere in Telerix.web.ui

aspx file:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default14.aspx.cs" Inherits="Default14" %>
  
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
  
    <script type="text/javascript">
        //
        function openFilterBuilderDialog() {
            $find('<%=RadWindow1.ClientID %>').show();
        }
  
        function hideFilterBuilderDialog() {
            $find('<%=RadWindow1.ClientID %>').close();
        }
  
        function OnHeaderMenuItemClicked(sender, args)
        {
            if (args.get_item().get_value() == "FilterBuilder")
            {
                openFilterBuilderDialog();
            }
        }
  
        function onPanelBarItemClicked(sender, args)
        {
            if (args.get_item().get_commandName() == "OpenRadFilter")
            {
                openFilterBuilderDialog();
            }
        }
    </script>
  
</telerik:RadScriptBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
      
    <asp:Button ID="Button1" runat="server" Text="Refresh" OnClick="Button1_Click" />
      
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadFilter1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadFilter1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="ApplyButton">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
        <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Move,Close,Resize" Title="Filter Builder"
            Modal="true" Width="500" Height="350">
            <ContentTemplate>
                <telerik:RadFilter runat="server" ID="RadFilter1" FilterContainerID="RadGrid1" ShowApplyButton="false" style="margin:10px 0 0 10px"/>
                <asp:Panel ID="FilterButtonPanel" runat="server" style="margin:10px 0 0 10px;font-size:medium">
                    <asp:LinkButton runat="server" ID="ApplyButton" OnClick="ApplyButton_Click" Font-Names="Verdana" Font-Size="Small"
                    Text="Apply Expressions" OnClientClick="hideFilterBuilderDialog()"/>
                </asp:Panel>
            </ContentTemplate>
        </telerik:RadWindow>
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" PageSize="5" 
        AllowSorting="true" OnItemCommand="RadGrid1_ItemCommand" 
        AllowFilteringByColumn="True">
        <MasterTableView AutoGenerateColumns="false" DataKeyNames="ID" IsFilterItemExpanded ="false" CommandItemDisplay="Top">
            <CommandItemTemplate>
                    <telerik:RadToolBar runat="server" ID="RadToolBar1" OnClientButtonClicked="onPanelBarItemClicked">
                        <Items>
                            <telerik:RadToolBarButton Text="Show filter" CommandName="OpenRadFilter" ImageUrl="<%#GetFilterIcon() %>"
                                ImagePosition="Right"/>
                        </Items>
                    </telerik:RadToolBar>
                </CommandItemTemplate>
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
            <PagerStyle Mode="NumericPages" />
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
            <Columns>
                <telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="true" HeaderButtonType="None">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Description" HeaderText="Description" UniqueName="Description">
                </telerik:GridBoundColumn>                
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>    
      
    </form>
</body>
</html>

cs code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using System.Data;
using System.Collections;
  
public partial class Default14 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
  
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        RadGrid1.DataSource = Data ;
        RadGrid1.DataBind();
    }
    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
    {
        if (e.CommandName == RadGrid.PageCommandName)
        {
            e.Item.OwnerTableView.CurrentPageIndex = (e as GridPageChangedEventArgs).NewPageIndex;
            RadGrid1.DataSource = Data;
            RadGrid1.DataBind();
        }
        if (e.CommandName == RadGrid.SortCommandName)
        {
            RadGrid1.DataSource = Data ;
            RadGrid1.DataBind();
        }
    }
    public DataTable Data
    {
        get
        {
            if (Session["Data"] == null)
            {
                DataTable table = new DataTable();
                table.Columns.Add("ID");
                table.Columns.Add("Description");
                for (int i = 0; i < 10; i++)
                {
                    table.Rows.Add(i, "Description" + i.ToString());
                }
                Session["Data"] = table;
            }
            return (DataTable)Session["Data"];
        }
        set
        {
            Session["Data"] = value;
        }
    }
    protected string GetFilterIcon()
    {
        //RadGrid1.Skin = RadSkinManager1.Skin ;
        //RadGrid1.Rebind();
  
        return RadAjaxLoadingPanel.GetWebResourceUrl(Page, string.Format("Telerik.Web.UI.Skins.{0}.Grid.Filter.gif", "Vista"));
    }
    protected void ApplyButton_Click(object sender, EventArgs e)
    {
        RadFilter1.FireApplyCommand();
        RadGrid1.DataSource = Data ;
        RadGrid1.Rebind();
    }
}

Please advise what is wrong here.

Thanks,
Reena
Rick Borage
Top achievements
Rank 1
 answered on 24 Mar 2011
3 answers
93 views
Hello
after following the manual upgrade procedure (replacing telerik.web.ui and telerik.web.design from bin40 folder) build fails.
Error message is:
Could not load file or assembly 'file:/// (..path..)\telerik.web.ui or one fo its dependencies, Operation is not supported (Exception from HRESULT:0x80131515)
Using VS201. I reviewed the manual installation KB article but it did not help.
Thanks


Rodrigo Castro
Top achievements
Rank 1
 answered on 24 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?