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

Is-it possible to have two TextBox for each node?
Do you have an example in C#?

Thanks

      Michel


Princy
Top achievements
Rank 2
 answered on 15 Dec 2011
1 answer
91 views
Hi there,

I have used the second option for scrolling in grid of following link:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/virtualscrollpagingclientbinding/defaultcs.aspx


I want to implement the custom paging along with it. When i am trying to implement both of them, ajax panel goes on loading infinitely..

 Below is the code Snippet for Grid:

<telerik:RadAjaxManager ID="RadAjaxManager1" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
        runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="prospectGrid">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="prospectGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="prospectGrid" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </telerik:RadAjaxManager>
<telerik:RadGrid ID="prospectGrid" AllowFilteringByColumn="true" AllowPaging="True"
                PageSize="50" runat="server" AllowSorting="true" OnNeedDataSource="prospectGrid_NeedDataSource"
                GridLines="None" AllowMultiRowSelection="false" Height="450px" OnItemDataBound="OnDataBound">
                <PagerStyle Visible="false" />
                <MasterTableView DataKeyNames="ID" TableLayout="Fixed" AutoGenerateColumns="false">
                    <Columns>
                        <telerik:GridBoundColumn DataField="ID" HeaderText="ProspectId" Display="false" UniqueName="ProspectId" />
                        <telerik:GridTemplateColumn DataField="Live" HeaderText="Live" AllowFiltering="false"
                            HeaderStyle-Width="30px">
                            <ItemTemplate>
                                <center>
                                    <asp:Image ID="Image1" runat="server" ImageUrl="~/images/live.png" Visible='<%#Eval("Live") %>' /></center>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="PartnerCompany" HeaderText="Partner Company"
                            UniqueName="PartnerCompany" />
                        <telerik:GridBoundColumn DataField="PersonName" HeaderText="Person Name" UniqueName="CustomerName" />
                        <telerik:GridBoundColumn DataField="ServiceType" HeaderText="Service Type" UniqueName="ServiceType" />
                        <telerik:GridBoundColumn DataField="PersonContact" HeaderText="Person Contact" UniqueName="Contact" />
                        <telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title" />
                        <telerik:GridBoundColumn DataField="PersonDirectNumber" HeaderText="Person Direct No"
                            UniqueName="Phone No" />
                        <telerik:GridBoundColumn DataField="PersonEmail" HeaderText="Person Email" UniqueName="Email" />
                        <telerik:GridBoundColumn DataField="FollowUpDate" HeaderText="FollowUp Date" UniqueName="FollowUpDate" />
                        <telerik:GridBoundColumn DataField="FollowUpDesc" HeaderText="Follow Up Desc" UniqueName="Description" />
                        <telerik:GridBoundColumn DataField="ContractETA" HeaderText="Contract ETA" UniqueName="CotnactETA" />
                        <telerik:GridBoundColumn DataField="ServiceETA" HeaderText="Service ETA" UniqueName="ServiceETA" />
                        <telerik:GridTemplateColumn DataField="NotesDesc" HeaderText="Notes" AllowFiltering="false"
                            HeaderStyle-Width="55px">
                            <ItemTemplate>
                                <center>
                                    <a href="#" onclick="notesClick('<%#DataBinder.Eval(Container.DataItem,"ID")%>'); return false;">
                                        <input type="image" src="images/note.png" /></a></center>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="" HeaderText="Follow Up" AllowFiltering="false"
                            HeaderStyle-Width="70px">
                            <ItemTemplate>
                                <center>
                                    <asp:HyperLink ImageUrl="~/images/schedule.png" ID="schedule" runat="server" />
                                </center>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true" Resizing-AllowColumnResize="true" EnablePostBackOnRowClick="false">
                    <ClientEvents OnRowDblClick="OnRowDblClick" />
                    <Selecting AllowRowSelect="false" />
                    <Scrolling AllowScroll="true" FrozenColumnsCount="3" UseStaticHeaders="true" SaveScrollPosition="true" />
                    <ClientEvents OnScroll="handleScrolling" />
                </ClientSettings>
                <HeaderStyle Width="200px" />
            </telerik:RadGrid>

Below is the Code Snippet for Javascript Function:

<telerik:RadCodeBlock runat="server">     
      function handleScrolling(e) {
                var grid = $find("<%=prospectGrid.ClientID %>");
 
                var scrollArea = document.getElementById("<%= prospectGrid.ClientID %>" + "_GridData");
 
                if (IsScrolledToBottom(scrollArea)) {
                    var currentlyDisplayedRecords = grid.get_masterTableView().get_pageSize() * (grid.get_masterTableView().get_currentPageIndex() + 1);
 
                    //if the presently visible items are less than the entire source records count
                    //trigger an ajax request to increase them
 
 
                   if (currentlyDisplayedRecords < 30) {
                        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("LoadMoreRecords");
                    }
                }
           }
            //this method calculates whether you have reached the bottom when dragging the vertical grid scroll
            function IsScrolledToBottom(scrollArea) {
                var currentPosition = scrollArea.scrollTop + scrollArea.clientHeight;
                return currentPosition == scrollArea.scrollHeight;
           }
</telerik:RadCodeBlock>

Below is the Code Snippet for .cs file:

protected void prospectGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
       {
           prospectGrid.VirtualItemCount = DbContext.getProspectProfile(startRowIndex ,endRowIndex).ToList().Count();
           int totalCount = prospectGrid.VirtualItemCount;
           int startRowIndex = (prospectGrid.CurrentPageIndex * prospectGrid.PageSize) + 1;
           int endRowIndex = ((startRowIndex + 15) > totalCount ? totalCount : startRowIndex + 15) - 1;
           prospectGrid.DataSource = DbContext.getProspectProfile(startRowIndex ,endRowIndex);
      }

Please help me on this issue.

Regards,
Dhaval
Antonio Stoilkov
Telerik team
 answered on 15 Dec 2011
2 answers
89 views
Hi Experts,

I have been facing strange issue:

While calling radconfirm second time not working as expected.

1) Radconfirm from code behind with callback function.
2) callback function will make ajaxRequest explicitly if user clicks 'Yes'.

Everything is fine for the first time. If user performs same action subsequently receiving error.

Kindly do the needful.
Mohammed
Top achievements
Rank 1
 answered on 15 Dec 2011
1 answer
59 views
Hi, I can't figure out how to update notification content via WS.
I have a performance issue, Im setting content (simple text content) via server side, and sometimes happens to that notification with autoclosedelay of 5500 goes away before showing it content.
Im showing notifications with server side API, its possible to use WS with server side API? I think isn't possible, so the server side alternative is the oncallback_update event.
Am I right? 

Marin Bratanov
Telerik team
 answered on 15 Dec 2011
0 answers
79 views
after moving the first column when some columns are hidden by column.Visible = false;

If you hide some columns by using column.Display = false; the column moving is working correctly, but the grid is badly rendered (left border of hidden columns is still visible and it makes grid to appear "thicker" at some places...). Is there a way out of it? Thank you very much.
Johny
Top achievements
Rank 1
 asked on 15 Dec 2011
2 answers
190 views
I am using the grid's edit template feature to show the edit form of a grid and defining controls of the edit form in code behind.but if i am adding an update panel to the form then the form is not displaying correctly. Can i use update panel in the edit form?If yes,then how can i do that properly?

Thanks,
Rahul R
Rahul
Top achievements
Rank 2
 answered on 15 Dec 2011
4 answers
166 views
We're already including jQuery in all of our pages and there is no need to include it twice.
Dave
Top achievements
Rank 1
 answered on 15 Dec 2011
2 answers
124 views
I'm using the RadGrid control in a CompositeControl; the control is built and data source assigned (essentially just a collection) in the CreateChildControls method.  The issue I'm having is that I need to change what the grid is bound to depending on some input from the user.  The problem I've found is that CreateChildControls is called before the page event methods are fired, therefore meaning that the properties which I'm using to determine what exactly data to use to bind haven't been set.  I've tried overriding the OnPreRender method, and then setting the DataSource property again, and calling DataBind on the grid, and this seems to work until I try and expand one of the detail grid areas, at which point no data is displayed at all.

The code I'm using is (similar) to the following:

public class TestGrid : CompositeControl
{
    private readonly SearchCriteria searchCriteria = new SearchCriteria();
 
    private RadGrid grid;
 
    /// <summary>
    /// Contains search criteria set from controls on the parent page.
    /// This is what drives exactly what is displayed in the grid, and
    /// only seems to be set just before PreRender.
    /// </summary>
    [Browsable(false)]
    public SearchCriteria SearchCriteria
    {
        get
        {
            return this.searchCriteria;
        }
    }
 
    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        grid.DataSource = this.GetJobs();
        grid.DataBind();
    }
 
    protected override void OnInit(EventArgs e)
    {
        base.OnInit(e);       
        this.EnsureChildControls();
    }
 
    protected override void CreateChildControls()
    {
        this.Controls.Clear();
 
        grid = new RadGrid
        {
            ID = "grid",
            DataSource = this.GetJobs(),
            AutoGenerateColumns = false,
            AllowPaging = true,
            ShowStatusBar = true,
            PageSize = 10,
            Height = this.Height,
            Width = this.Width
        };
 
        grid.ClientSettings.Scrolling.AllowScroll = true;
        grid.MasterTableView.DataKeyNames = new[] { "BatchId" };
 
        grid.Columns.Add(new GridBoundColumn { DataField = "PolicyNumber", HeaderText = "Policy Number" });
        grid.Columns.Add(new GridBoundColumn { DataField = "Surname", HeaderText = "Surname" });
 
        var detailTable = new GridTableView(grid) { DataKeyNames = new[] { "BatchId" }, DataSource = this.GetDocuments() };
        detailTable.ParentTableRelation.Add(new GridRelationFields { DetailKeyField = "BatchId", MasterKeyField = "BatchId" });
 
        detailTable.Columns.Add(new GridBoundColumn { DataField = "PolicyNumber", HeaderText = "Policy Number" });
        detailTable.Columns.Add(new GridBoundColumn { DataField = "DocumentType", HeaderText = "Document Type" });
 
        grid.MasterTableView.DetailTables.Add(detailTable);
        this.Controls.Add(grid);
    }
 
    private IEnumerable<Job> GetJobs()
    {
        // Snipped for brevity.
    }
 
    private IEnumerable<Document> GetDocuments()
    {
        // Snipped for brevity.
    }
}


Hoping someone could offer some insight into what I'm doing wrong!
Doug
Top achievements
Rank 1
 answered on 15 Dec 2011
4 answers
76 views
Hi,
I use the method ExtractValuesFromItem (newValue,editedItem)
(This method is great!)

I have a problem :
newValue.key.ToString() return the name of the datafield 
but I need  the name of the uniquename.

I have the datafield and the uniquename different.

can  I have uniquname instead of DataField in the newValue ?
Or can I recover  UniqueName  from DataField?

Thaks 
Lasly
Top achievements
Rank 1
 answered on 15 Dec 2011
3 answers
70 views
hello..
I need your help...
don't be displayed  AAA Column  data in grid item....  i don'y know reason....
help me please.

below source and attached snapshot.
aspx:

<MasterTableView DataKeyNames="CODE_SECTION,CODE_GROUP" EditMode="EditForms">
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton" ItemStyle-Width="50px">
                                <ItemStyle Width="50px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn DataField="CODE_SECTION" HeaderText="시스템1" ReadOnly="true"
                                UniqueName="System">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="CODE_GROUP" HeaderText="그룹코드" ReadOnly="true"
                                UniqueName="GroupCode">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="CODE_GROUP_NAME" HeaderText="그룹코드명" UniqueName="CodeCommonName">
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn ColumnEditorID="GridDropDownListEditor1" DataField="USE_YN"
                                DropDownControlType="RadComboBox" HeaderText="AAA"   UniqueName="UseYN"  ListTextField="TEXT" ListValueField="VALUE">
                            </telerik:GridDropDownColumn>
                            <telerik:GridBoundColumn DataField="INSERT_ID" HeaderText="등록자" ReadOnly="true" UniqueName="InsertID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="INSERT_DATE" HeaderText="등록일" ReadOnly="true"
                                UniqueName="InsertDate">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="UPDATE_ID" HeaderText="수정자" ReadOnly="true" UniqueName="UpdateID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="UPDATE_DATE" HeaderText="수정일" ReadOnly="true"
                                UniqueName="UpdateDate">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <PagerStyle AlwaysVisible="True" />
                    </MasterTableView>


C# Code :

protected void gv_ItemDataBound(object sender, GridItemEventArgs e)
        {
           var q = from result in db.sp_TempSearchCode_s("USEYN")
                    select new
                    {
                        TEXT =  result.TEXT,
                        USE_YN = result.VALUE
                    };
           
            if (e.Item is GridEditableItem && e.Item.IsInEditMode)
            {
                GridEditableItem item = (GridEditableItem)e.Item;

                RadComboBox combo = (RadComboBox)item["UseYN"].Controls[0];

                foreach (var items in q)
                {
                    combo.Items.Add(new RadComboBoxItem(items.TEXT, items.USE_YN));
                }
            }

        }


:

Princy
Top achievements
Rank 2
 answered on 15 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?