Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
266 views
Hello,

We have some trees with lots of nodes. Drag and drop is enabled so users can re-order the nodes. When a user wants to drag a node from the top of the list to the bottom, the page doesn't automatically scroll. They have to drop the node halfway and manually scroll to continue dragging. Is there anyway to have the page automatically scroll when a user is dragging a node up or down a long tree?

Thanks!
- J
Yana
Telerik team
 answered on 29 Nov 2010
2 answers
115 views
If I input error value into "LastModifiedAt" column of RadFilter then the page happen error. How to validate this value before "OnApplyExpressions" event.

My coding is below:
    <telerik:RadFilter ID="RadFilter1" runat="server"  OnApplyExpressions="radFilterGridControl_SearchGridData">
        <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
Le Danh
Top achievements
Rank 1
 answered on 29 Nov 2010
1 answer
91 views

Hi Team

When i'm giving more than 20 numbers it getting some default values how to i resolve this..


Regards,
Ashok Anbarasu
Daniel
Telerik team
 answered on 29 Nov 2010
1 answer
212 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
63 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
156 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
60 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
240 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
55 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
75 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?