Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
208 views
Hi,

Please help.
I am getting this error:
Sys.WebForms.PageRequestManagerServerErrorException: There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.

When I update the order item with OrderDetail_UpdateCommand and then gridCustomer.Rebind() and I get the error I mentioned above.   Please help. Thanks.

ASPX:

<telerik:RadGrid ID="gridCustomer" runat="server" OnNeedDataSource="gridCustomer_NeedDataSource" 
OnUpdateCommand="OrderDetail_UpdateCommand" OnDetailTableDataBind="gridOrder_DetailTableDataBind"
   <MasterTableView DataKeyNames="CustomerID" Width="100%" PageSize="20"   ClientDataKeyNames="CustomerID"
      <DetailTables> 
         <telerik:GridTableView DataKeyNames="OrderID" Name="OrderDetail"  EditMode="InPlace"
         <Columns> 
            <telerik:GridBoundColumn 
               DataField="OrderName" 
               HeaderText="Order Name" 
               ReadOnly="true"/> 
            <telerik:GridBoundColumn 
               DataField="DateReceived" 
               HeaderText="Date Received" 
               ReadOnly="true" /> 
            <telerik:GridTemplateColumn 
               HeaderText="Amount to Pay" 
               EditFormColumnIndex="1" 
               HeaderStyle-Width="140px"
               <ItemTemplate> 
                   <asp:Label runat="server" ID="lblAmountToPay" Text='<%# Eval ("AmountToPay", "{0:C}") %>'> </asp:Label>
               </ItemTemplate>
               <EditItemTemplate>
                   <telerik:RadNumericTextBox runat="server" ID="tbxUnitPrice" Width="40px" DbValue='<%# Bind("AmountToPay") %>'
                   </telerik:RadNumericTextBox> 
               </EditItemTemplate> 
            </telerik:GridTemplateColumn> 
           <telerik:GridEditCommandColumn UniqueName="EditOrderPrice" /> 
        </Columns>
    </telerik:GridTableView> 
</DetailTables> 
<Columns> 
    <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" /> 
    <telerik:GridBoundColumn DataField="CustomerName" HeaderText="Customer Name"
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="Address" HeaderText="Address"
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Phone" HeaderText="Phone"
    </telerik:GridBoundColumn> 
    <telerik:GridBoundColumn DataField="Email" HeaderText="Email"
    </telerik:GridBoundColumn>
    <telerik:GridBoundColumn DataField="Group" HeaderText="Group"
    </telerik:GridBoundColumn> 
  </Columns> 
</MasterTableView> 
<ClientSettings> 
<Selecting AllowRowSelect="True" /> 
<ClientEvents OnRowSelected="GridCustomerRowSelected" /> 
</ClientSettings> 
</telerik:RadGrid>

CODE BEHIND

protected void gridCustomer_NeedDataSource(object source, GridNeedDataSourceEventArgs e) { 
       gridCustomer.DataSource = ClaimProcess.GetCustomer();
}
  
protected void gridOrder_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e) { 
      switch (e.DetailTableView.Name) 
      {
         case "OrderDetail"
         {
             GridDataItem dataItem = e.DetailTableView.ParentItem; 
             e.DetailTableView.DataSource = ClaimProcess.GetOrder(dataItem.GetDataKeyValue("CustomerID")); 
             break
         }
      }
}
  
protected void OrderDetail_UpdateCommand(object source, GridCommandEventArgs e) 
{
    GridEditableItem item = (GridEditableItem)e.Item; 
    int OrderID = Convert.ToInt32(item.GetDataKeyValue("OrderID")); 
    RadNumericTextBox txtAmountPay = (RadNumericTextBox)e.Item.FindControl("tbxUnitPrice"); 
    UpdateOrder(OrderID, Convert.ToDouble(txtAmountPay.Text));
    gridCustomer.Rebind(); 
}
Pavlina
Telerik team
 answered on 29 Nov 2010
0 answers
59 views
Hi,

It takes time to open a simple AdvancedForm of RadSchedule. It even takes time to close when click on cancel button.
Could someone please point me out how i could make it faster?
Thanks.

Regards,
Nyi Nyi
nyi nyi
Top achievements
Rank 1
 asked on 29 Nov 2010
1 answer
153 views

Hi,

i have radgrid created dynamically and added on hyperlink column in it.
but when i am trying to add new records in grid the hyperlink column is blank and not showing any text link.
my requirement is the user can able to click on hyperlink to select some value from popup while adding new records in grid.
the link is visible in edd and view mode but not in insert mode.

please help.

   private void PopulateGrid()
    {
        Inssp obj = GetInssp();
        Session["currentObject"] = obj;

        for (int i = 0; i < this.TemplateTabStrip.Tabs.Count; i++)
        {
            //  The actual creation of the grid
            RadGrid grid = new RadGrid();
            grid.ItemCommand += new GridCommandEventHandler(grid_ItemCommand);
            grid.ItemCreated += new GridItemEventHandler(grid_ItemCreated);
            grid.ItemDataBound += new GridItemEventHandler(grid_ItemDataBound);

            GridBoundColumn gridColumn;
            GridEditCommandColumn editColumn;
            GridButtonColumn deleteColumn;

            grid.ID = "structureGrid" + i.ToString();
            grid.MasterTableView.DataKeyNames = new string[] { "ActionId" };
            grid.GridLines = GridLines.Horizontal;
            grid.HorizontalAlign = HorizontalAlign.NotSet;
            //grid.DataSource = areaList;

            grid.DataSourceID = "InsspActionDataSource";
            grid.AllowAutomaticDeletes = true;
            grid.AllowAutomaticUpdates = true;
            grid.AllowAutomaticInserts = true;
            grid.HeaderStyle.Font.Bold = true;
            grid.ClientSettings.EnableRowHoverStyle = true;
            grid.ClientSettings.Selecting.AllowRowSelect = true;
            grid.Skin = "Office2007";
            grid.Width = new Unit(1215);

            grid.MasterTableView.HierarchyDefaultExpanded = true;
            //            grid.PreRender += new EventHandler(grid_PreRender);

            grid.MasterTableView.AllowAutomaticDeletes = true;
            grid.MasterTableView.AllowAutomaticUpdates = true;
            grid.MasterTableView.AllowAutomaticInserts = true;
            grid.MasterTableView.AutoGenerateColumns = false;

            grid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;

            grid.MasterTableView.EditMode = GridEditMode.InPlace;
            grid.MasterTableView.EditFormSettings.PopUpSettings.Modal = false;
            grid.MasterTableView.EditFormSettings.InsertCaption = "Add new action";
            grid.MasterTableView.EditFormSettings.PopUpSettings.Width = new Unit(600);
            //            grid.MasterTableView.EditFormSettings.CaptionDataField = "Description";
            grid.MasterTableView.EditFormSettings.CaptionFormatString = "Action";
            grid.MasterTableView.EditFormSettings.FormCaptionStyle.Font.Bold = true;
            grid.MasterTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.PushButton;
            grid.MasterTableView.EditFormSettings.FormTableButtonRowStyle.HorizontalAlign = HorizontalAlign.Right;

            grid.MasterTableView.EnableColumnsViewState = true;
            grid.MasterTableView.CommandItemSettings.AddNewRecordText = "Add new action";

            gridColumn = new GridBoundColumn();
            gridColumn.HeaderText = obj.AreaCollection[i].AreaName;
            gridColumn.DataField = "Description";
            gridColumn.UniqueName = "Description";
            grid.MasterTableView.Columns.Add(gridColumn);

            editColumn = new GridEditCommandColumn();
            editColumn.UniqueName = "EditSubAction";
            editColumn.ButtonType = GridButtonColumnType.ImageButton;
            grid.MasterTableView.Columns.Add(editColumn);           

            deleteColumn = new GridButtonColumn();
            deleteColumn.UniqueName = "DeleteAction";
            deleteColumn.Text = "Delete";
            deleteColumn.CommandName = "Delete";
            deleteColumn.ButtonType = GridButtonColumnType.ImageButton;
            deleteColumn.ImageUrl = "~/Images/delete.gif";
            deleteColumn.ConfirmDialogType = GridConfirmDialogType.RadWindow;
            deleteColumn.ConfirmTitle = "Delete Action";
            deleteColumn.ConfirmText = "WARNING: All attached sub-actions will be also inadvertently deleted!<BR>Are you sure you want to delete the record?";
            grid.MasterTableView.Columns.Add(deleteColumn);

            if (isEdit == false)
            {
                deleteColumn.Visible = false;
                editColumn.Visible = false;
                grid.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = false;
                
            }

            // detail Table containing the subactions
            GridTableView subActionTableView = new GridTableView();
            subActionTableView.DataSourceID = "InsspSubActionDataSource";
            subActionTableView.DataKeyNames = new string[] { "SubActionId" };
            subActionTableView.CommandItemDisplay = GridCommandItemDisplay.Top;
            subActionTableView.CommandItemSettings.AddNewRecordText = "Add new subaction";
            subActionTableView.NoDetailRecordsText = " There are no subactions attached";

            subActionTableView.EditMode = GridEditMode.InPlace;
            subActionTableView.EditFormSettings.PopUpSettings.Modal = false;

            subActionTableView.EditFormSettings.InsertCaption = "Add new subaction";
            subActionTableView.EditFormSettings.PopUpSettings.Width = new Unit(600);
            //            subActionTableView.EditFormSettings.CaptionDataField = "Description";
            grid.MasterTableView.EditFormSettings.CaptionFormatString = "Sub-Action";
            grid.MasterTableView.EditFormSettings.FormCaptionStyle.Font.Bold = true;
            subActionTableView.EditFormSettings.EditColumn.ButtonType = GridButtonColumnType.PushButton;

            subActionTableView.TableLayout = GridTableLayout.Fixed;

            subActionTableView.HeaderStyle.Font.Bold = true;
            subActionTableView.HeaderStyle.BackColor = Color.Beige;
            subActionTableView.GridLines = GridLines.Both;

            grid.MasterTableView.ItemStyle.BackColor = Color.FromName("#EAF4FE");
            grid.MasterTableView.ItemStyle.Font.Name = "Tahoma";
            grid.MasterTableView.ItemStyle.Font.Size = new FontUnit("10");
            grid.MasterTableView.ItemStyle.Font.Bold = true;

            grid.MasterTableView.AlternatingItemStyle.BackColor = Color.FromName("#EAF4FE");
            grid.MasterTableView.AlternatingItemStyle.Font.Name = "Tahoma";
            grid.MasterTableView.AlternatingItemStyle.Font.Size = new FontUnit("10");
            grid.MasterTableView.AlternatingItemStyle.Font.Bold = true;

            subActionTableView.AllowAutomaticDeletes = true;
            subActionTableView.AllowAutomaticUpdates = true;
            subActionTableView.AllowAutomaticInserts = true;
            subActionTableView.AutoGenerateColumns = false;

            GridRelationFields dataFields = new GridRelationFields();
            //dataFields.MasterKeyField = "ActionId";
            dataFields.DetailKeyField = "SubActionId";
            subActionTableView.ParentTableRelation.Add(dataFields);

            grid.MasterTableView.DetailTables.Add(subActionTableView);

            // the columns for the detail table view
            gridColumn = new GridBoundColumn();
            gridColumn.DataField = "Description";
            gridColumn.Visible = true;
            gridColumn.UniqueName = "Description";
            gridColumn.HeaderText = "Sub-action";
            gridColumn.HeaderStyle.Width = new Unit("450");
            gridColumn.HeaderStyle.Font.Size = new FontUnit("10");
            gridColumn.HeaderStyle.ForeColor = Color.FromName("#295b62");
            //            gridColumn.ReadOnly = true;
            subActionTableView.Columns.Add(gridColumn);

            GridDropDownColumn dropDownGridColumn = new GridDropDownColumn();
            dropDownGridColumn.DropDownControlType = GridDropDownColumnControlType.RadComboBox;
            dropDownGridColumn.Visible = true;
            dropDownGridColumn.UniqueName = "Status";
            dropDownGridColumn.HeaderText = "Status";
            dropDownGridColumn.ItemStyle.Width = new Unit("50");
            dropDownGridColumn.HeaderStyle.Font.Size = new FontUnit("10");
            dropDownGridColumn.HeaderStyle.ForeColor = Color.FromName("#295b62");
            dropDownGridColumn.DataSourceID = "DummyStatysListDataSource";
            dropDownGridColumn.DataField = "Status";
            dropDownGridColumn.ListTextField = "Text";
            dropDownGridColumn.ListValueField = "Value";
            dropDownGridColumn.EmptyListItemText = "";
            dropDownGridColumn.EmptyListItemValue = "";
            subActionTableView.Columns.Add(dropDownGridColumn);

            gridColumn = new GridBoundColumn();
            gridColumn.DataField = "ResponsibleEntity";
            gridColumn.Visible = true;
            gridColumn.UniqueName = "ResponsibleEntity";
            gridColumn.HeaderText = "Responsible Entity";
            gridColumn.ItemStyle.Width = new Unit("50");
            gridColumn.HeaderStyle.Font.Size = new FontUnit("10");
            gridColumn.HeaderStyle.ForeColor = Color.FromName("#295b62");
            subActionTableView.Columns.Add(gridColumn);

            GridDateTimeColumn dateTimeGridColumn = new GridDateTimeColumn();
            dateTimeGridColumn.DataField = "StartDate";
            dateTimeGridColumn.Visible = true;
            dateTimeGridColumn.UniqueName = "StartDate";
            dateTimeGridColumn.HeaderText = "Start Date";
            dateTimeGridColumn.ItemStyle.Width = new Unit("70");
            dateTimeGridColumn.HeaderStyle.Font.Size = new FontUnit("10");
            dateTimeGridColumn.HeaderStyle.ForeColor = Color.FromName("#295b62");
            dateTimeGridColumn.PickerType = GridDateTimeColumnPickerType.DatePicker;

            subActionTableView.Columns.Add(dateTimeGridColumn);

            dateTimeGridColumn = new GridDateTimeColumn();
            dateTimeGridColumn.DataField = "EndDate";
            dateTimeGridColumn.Visible = true;
            dateTimeGridColumn.UniqueName = "EndDate";
            dateTimeGridColumn.ItemStyle.Width = new Unit("70");
            dateTimeGridColumn.HeaderText = "End Date";
            dateTimeGridColumn.HeaderStyle.Font.Size = new FontUnit("10");
            dateTimeGridColumn.HeaderStyle.ForeColor = Color.FromName("#295b62");
            subActionTableView.Columns.Add(dateTimeGridColumn);

            gridColumn = new GridBoundColumn();
            gridColumn.DataField = "EpssTask";
            gridColumn.Visible = true;
            gridColumn.UniqueName = "EpssTaskLink";
            gridColumn.HeaderText = "EPSS Task";
            gridColumn.HeaderStyle.Width = new Unit("75");
            gridColumn.HeaderStyle.Font.Name = "Tahoma";
            gridColumn.HeaderStyle.Font.Size = new FontUnit("10");
            gridColumn.HeaderStyle.ForeColor = Color.FromName("#295b62");
            subActionTableView.Columns.Add(gridColumn);

            GridHyperLinkColumn hyperlinkColumn = new GridHyperLinkColumn();
            hyperlinkColumn.Text = "View/Edit";
            hyperlinkColumn.HeaderText = "AIPS Task";
            hyperlinkColumn.Visible = true;
            hyperlinkColumn.DataNavigateUrlFields = new string[] { "SubActionId" };
            hyperlinkColumn.DataTextFormatString = "{0} SubActionId";
            hyperlinkColumn.DataTextField = "AIPSTask";
            hyperlinkColumn.Target = "_blank";
            hyperlinkColumn.UniqueName = "AIPSTask";
            hyperlinkColumn.DataNavigateUrlFormatString = "../AIPSTaskSelector.aspx?SubActionId={0}&disableMaster=1&aa=";
            hyperlinkColumn.HeaderStyle.Width = new Unit("71");
            subActionTableView.Columns.Add(hyperlinkColumn);

            gridColumn = new GridBoundColumn();
            gridColumn.DataField = "Comment";
            gridColumn.Visible = true;
            gridColumn.UniqueName = "Comment";
            gridColumn.HeaderText = "Comment";
            gridColumn.ItemStyle.Width = new Unit("100");
            gridColumn.HeaderStyle.Font.Name = "Tahoma";
            gridColumn.HeaderStyle.Font.Size = new FontUnit("10");
            gridColumn.HeaderStyle.ForeColor = Color.FromName("#295b62");
            subActionTableView.Columns.Add(gridColumn);

            editColumn = new GridEditCommandColumn();
            editColumn.UniqueName = "EditSubAction";
            editColumn.HeaderStyle.Width = new Unit("30");
            editColumn.ButtonType = GridButtonColumnType.ImageButton;
            subActionTableView.Columns.Add(editColumn);

            deleteColumn = new GridButtonColumn();
            deleteColumn.UniqueName = "DeleteSubAction";
            deleteColumn.CommandName = "Delete";
            deleteColumn.ButtonType = GridButtonColumnType.ImageButton;
            deleteColumn.ImageUrl = "~/Images/delete.gif";
            deleteColumn.Text = "Delete";
            deleteColumn.HeaderStyle.Width = new Unit("30");
            deleteColumn.ConfirmDialogType = GridConfirmDialogType.RadWindow;
            deleteColumn.ConfirmTitle = "Delete Action";
            deleteColumn.ConfirmText = "Are you sure you want to delete the record? NOTE: There is no way of recovery!";
            subActionTableView.Columns.Add(deleteColumn);

            if (isEdit == false)
            {
                deleteColumn.Visible = false;
                editColumn.Visible = false;
                subActionTableView.CommandItemSettings.ShowAddNewRecordButton = false;
            }

            RadPageView pageView = new RadPageView();
            pageView.Controls.Add(grid);

            this.TemplateTabStrip.Tabs[i].Text = obj.AreaCollection[i].AreaName;
            this.TemplateTabStrip.MultiPage.Controls.Add(pageView);
        }
    }


please help.
its really urgent and important.
thanks in advance.
Veli
Telerik team
 answered on 29 Nov 2010
0 answers
58 views
hi,

After creating some appointments and trying to delete them got the following error.
Cannot locate the parent of appointment with ID = '122'. Ensure that the parent appointment with ID = '121' exists and is loaded.
What does it mean? How could i solve that problem?

Thanks in advance.

Regards,
NNT
nyi nyi
Top achievements
Rank 1
 asked on 29 Nov 2010
5 answers
231 views
Hello All,
which event can I used to fire when I click the radgrid nested view to get parent datakeyname.
 
thanks in advance
shabbir
Dhamodharan
Top achievements
Rank 1
 answered on 29 Nov 2010
1 answer
52 views
Hi all,

I don't see "Calendar" icon and "Time Picker" icon on "LastModifiedAt" column of RadFilter. My coding is below:

    <telerik:RadFilter ID="RadFilter1" runat="server"  >
        <FieldEditors>
            <telerik:RadFilterTextFieldEditor FieldName="LastModifiedAt" DisplayName="LastModifiedAt" DataType="System.DateTime" />
        </FieldEditors>
    </telerik:RadFilter>
               
    <telerik:RadGrid ID="radGridControl" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
         AllowSorting="True"
        GridLines="None">
        <MasterTableView AutoGenerateColumns="False"  >
            <Columns>

                <telerik:GridBoundColumn DataType="System.DateTime" DataField="LastModifiedAt" HeaderText="LastModifiedAt" >
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

Can you help me this problem?

Thanks,
Mr PhuongLD
Nikolay Rusev
Telerik team
 answered on 29 Nov 2010
1 answer
71 views
I'm implementing client-side databinding on a grid.
On the page's initial load the grid is automatically binded on client-side although the user should specify some data first.
So, with javascript, is there a way to rebind the grid only when rebind() is manually called? For example rebind is automatically triggered when filter() is called. 

Thanks
Nikolay Rusev
Telerik team
 answered on 29 Nov 2010
1 answer
117 views
OnFilterMenuShowing event of RadGird sets "Left" css style as "this.Control.style.left=e.clientX+document.documentElement.scrollLeft+document.body.scrollLeft+5+"px";"
This will make the filter menu appear next to the current mouse pointer. We are in need of showing the filter menu before the current mouse pointer. Please suggest us how can we override "this.Control.style.left " property.

Attached a rad grid page with filter options enabled in grid header. If the user clicks on the right most filter menu the page is going out of scope. We where tring to show this filter menu before the mouse pointer. Is there a way to do that? Kindly help.

filtermenu_outofscope.jpg 
Veli
Telerik team
 answered on 29 Nov 2010
1 answer
97 views
Hi Folks,

In Editor we use a Custom File Dialogs Content Provider for the ImageManager.
Now, we try to show a certain directory when opening the ImageManager.

We set the SelectedUrl to some path but it has no influence.
We managed somehow to show the correct files in the right hand panel but on the left hand side always the first folder is selected.

We tried already this:
http://www.telerik.com/support/kb/aspnet-ajax/editor/select-an-image-or-folder-when-imagemanager-is-first-shown.aspx

It doesnt work either, i think because of the Custom Content Provider.

What else can we try?


Thanks a lot
Regards
Felix
Dobromir
Telerik team
 answered on 29 Nov 2010
2 answers
34 views
I have remove the below Script:

<%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
<%@ Register TagPrefix="telerik" TagName="Header" Src="~/Common/Header.ascx" %>
<%@ Register TagPrefix="telerik" TagName="HeadTag" Src="~/Common/HeadTag.ascx" %>
<%@ Register TagPrefix="telerik" TagName="Footer" Src="~/Common/Footer.ascx" %>
<%@ Register TagPrefix="sds" Namespace="Telerik.Web.SessionDS" %>

then, when I added these functions (as title), it has an error at the run time. the error occur when I do the action both Drag To Group, Filtering, go to Second page of Grid. it said:
Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

But, it is work if I select row, resize the column width and my other function in my web, so I can confirm that is only error occur when Drag To Group, Filtering, go to Second page of Grid.

Tsvetina
Telerik team
 answered on 29 Nov 2010
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?