Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
237 views

When I programmatically add a grid in the Page Init event, I understand how I can create the paging and it works.

However if the grid is not created in the Page Init, but in the Ribbon Buttonclicked event the paging command on the grid is not working. How should I enable this.

Private Sub ribbon_ButtonClick(sender As Object, e As Telerik.Web.UI.RibbonBarButtonClickEventArgs) Handles ribbon.ButtonClick
Dim radGrid = New RadGrid() With {
.AllowCustomPaging = True,
.AllowFilteringByColumn = True,
.AllowPaging = True,
.AllowSorting = True,
.AutoGenerateColumns = True,
.ID = "myGrid",
.PageSize = 4,
.ShowGroupPanel = True,
.ShowStatusBar = True,
.VirtualItemCount = 20,
.Width = Unit.Percentage(95)
}
AddHandler radGrid.NeedDataSource, Sub(_sender As Object, _e As GridNeedDataSourceEventArgs) RefreshData(CType(_sender, RadGrid))
AddHandler radGrid.PageIndexChanged, Sub(_sender As Object, _e As GridPageChangedEventArgs) RefreshData(CType(_sender, RadGrid))
AddHandler radGrid.PageSizeChanged, Sub(_sender As Object, _e As GridPageSizeChangedEventArgs) RefreshData(CType(_sender, RadGrid))
phGrid.Controls.Add(radGrid)
RadAjaxManager.AjaxSettings.AddAjaxSetting(radGrid, radGrid)
End Sub
Private Sub RefreshData(grid As RadGrid)
grid.DataSource = New List(Of String)({grid.CurrentPageIndex, grid.PageSize})
End Sub
Iana Tsolova
Telerik team
 answered on 13 Jun 2011
2 answers
87 views
Hi,

I have 2 FilterEditors with the same FieldName, but when selecting the 2nd item, it displays the first.

<FieldEditors>
    <custom:CustomDropdown DisplayName="Priority" FieldName="post_priority" DataTextField="Display" DataValueField="Value" />
    <custom:CustomDate DisplayName="Date" FieldName="post_time" DataType="System.DateTime" />
    <telerik:RadFilterDateFieldEditor DisplayName="Post Date" FieldName="post_time" DataType="System.DateTime" />
</FieldEditors>

Can this be done?

Take Care
Mira
Telerik team
 answered on 13 Jun 2011
3 answers
432 views
As the title says, is this possible?

I would like to have a two- or three column based layout exported to pdf, instead of the gridview look which is one item per row.

Daniel
Telerik team
 answered on 13 Jun 2011
1 answer
48 views
I'm using a RadGrid to display a list of invoices. The Invoices can be in multiple currencies (dollars, pounds, euros, etc.) and I'd like to have each row use a different culture for currency display. I have the currency culture in a seperate database field, so I'd like to use that to determine the currency type.

Is there a way to do this? (Other than format it in SQL, which I can do, but would prefer not to)
Pavel
Telerik team
 answered on 13 Jun 2011
7 answers
252 views
I have RadWindow, inside page with RadTabStrip/RadMultiPage, each RadPageView have RadSplitter with Width/Height=100%. RadSplitter usualy have 2 horizontal panels, up for main content (grid or test boxes) and bottom is height=40 for buttons like Save/Cancel. When I open RadWindow, RadSplitter fills entire space and controls iniside fills pane and everything is ok.


When I resize RadWindow at same time is RadSplitter resized to fill space and that is ok but only in active RadPageView. Other  RadSplitters in other RadPageViews is frozen to initial size and it looks ugly and the useless.
How to persuade all RadSplitters in all RadPageViews to resize and fill Width/Height=100% when I resize RadWindow?


It can be done by some client function on RadTabStrip.OnClientTabSelected but what to do with RadPageViews without tabs? 
I have some RadPageViews that are accessed by code behind (not by tabs) and there is no RadMultiPage.OnClientSelected event. 
Niko
Telerik team
 answered on 13 Jun 2011
1 answer
57 views
Hi guys, I've been pouring over the demos looking for a solution to a scenario i'm facing, and I'm starting to get a little bug-eyed so I thought I would throw it out there...

I have a radgrid with rows that contain a location, a quantity, and a dollar amount like this:

  • location X, qty 1, amount $1
  • location X, qty 2, amount $1.33
  • location Y, qty 1, amount $1.01
  • location Y, qty 2, amount $1.17
  • etc

I have a radwindow pop-up that 'sits on top' of this radgrid (actually a separate aspx). The popup allows them to enter a value that will be used to adjust the amount for all rows matching a given quantity. So if I pick qty 1 and adjust by .1 (up), i want to programmatically and automatically update the data for the matching rows in the grid. regardless of the value of location. In this case the data would look like this after the update:

  • location X, qty 1, amount $1.1 (updated +.1)
  • location X, qty 2, amount $1.33
  • location Y, qty 1, amount $1.11 (updated +.1)
  • location Y, qty 2, amount $1.17

I have the radwindow passing back the necessary values and I'm trying to plug through the JavaScript necessary to programmatically  1) loop through and find the rows with the matching quantity (it's a key field), 2) edit them with a new amount, 3) post the update.Sort of an automatic batch update.

Is there a demo on this scenario out there? I'm sure I'm missing it.

Thanks!

  • location X, qty 1, amount $1
  • location X, qty 2, amount $1.33
  • location Y, qty 1, amount $1.01
  • location Y, qty 2, amount $1.17
  • etc
  • location X, qty 1, amount $1
  • location X, qty 2, amount $1.33
  • location Y, qty 1, amount $1.01
  • location Y, qty 2, amount $1.17
  • etc
  • Marin
    Telerik team
     answered on 13 Jun 2011
    1 answer
    140 views
    Hi All,

    I have one functionality where in RadGrid when user clicks on row i am redirecting to another page. I have updated radgrid, before updating i can found ItemType by row.Itemtype property where as after updating i can't getting RowType. Can any one please help in this.

    I did like below but no use

    function RowSelected(sender, eventArgs)
    {
    if (($get(eventArgs.get_id()).ItemType == "Item") ||
    ($get(eventArgs.get_id()).ItemType == "AlternatingItem")) {
    var rowTable = $get(eventArgs.get_id()).Owner;
    var myIdCell = rowTable.GetCellByColumnUniqueName($get(eventArgs.get_id()), "ID");

    I have searched in below link but i did not find suitable solution for me

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

    Thanks in advance.

    Thanks,
    Sai Charan.M
    Iana Tsolova
    Telerik team
     answered on 13 Jun 2011
    5 answers
    281 views
    Hello,

    I saw my problem has already been explained in others threads, but I can't resolve it.

    Here it is:

    Server side:
    - I use a datasource to populate my listbox, and I select an item

    Client side:
    - I want to scroll to my selected item with te code below:

    <

     

    body >

     

     

    <form id="form1" runat="server">  

     

    <asp:ScriptManager ID="ScriptManager1" runat="server">

     

    </asp:ScriptManager>

     

     

    <script type="text/javascript"> 

     

    function 

     

    scrollToSelected(sender, args)
    {

     

     

            var item = sender.get_selectedItem();  

     

            if (item)

            {  

     

                item.ensureVisible(); 

     

                sender.clearSelection();  

     

            }  

     

    }

     

    </script 

     

    <div>...

     

    and in my listbox definition I add

     

     

    OnClientLoad

     

    ="scrollToSelected"

     

     

    This works only when I refresh my page, but it doesn't work the first time. I tried with OnSelectedIndexChanged, but it doesn't work anymore.

    Coul do help me please?
    Best regards,

    André

    Helen
    Telerik team
     answered on 13 Jun 2011
    1 answer
    112 views
    I would like to create a hierarchical Grid that has a parent row and then 1-n child rows.
    The parent row would be indexed by a unique datetime. Then containing many rows of data that would make up the
    parent rows many attributes.

    Example

    Automobile          1/1/2009
                    Color              red
                    Engine            V8
                    Horse Power  225

    Automobile          2/1/2009
                    Color              Green
                    Engine            V6
                    Horse Power  200

    My question is if I had created the parent row and the children rows is there a way to select the parent and then copy/duplicate/clone
    all of the rows that makeup the parent and children and then allow the user to set the new date for the copied parent row. 
    Veli
    Telerik team
     answered on 13 Jun 2011
    1 answer
    95 views
    I have an radListView, I bind images from database, each page will display 3 images,
    if inside the database, got 4 images, it will have 2 pages

    in the page 2, it have 1 image only. i want to reload the first two image and show in page 2,
    I want to rebind the same record and again and again...
    do you know how can i do???


    radlist view page 1                      radlistview page 2                           
    1                                                              4
    2                                                              1
    3                                                              2
    Iana Tsolova
    Telerik team
     answered on 13 Jun 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?