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

Just upgrading our prototype product from RadControls Q1 2007 to RadControls Q2 2009, which in itself has been a bit of a leap ... but the majority of it has worked fine. There is one control that I'm currently upgrading which uses a bit more client side script then every other section of the associated web projects.

The problem I have is that on the original client side object model, you could query a row's `ItemType` member, when referring to a row object from the rows collection of a table view:

for (var i = 0; i < rows.length; i++) { 
    if (rows[i].ItemType == "EditItem") { editedRow = rows[i]; break; } 
}     

During migration process, I have revised the code and now initialise my rows variable in the above example with the following:

var view = grid.get_masterTableView(); 
var rows = view.get_dataItems(); 

But for the life of me, I can't find anything equivalent of a row/GridItem `ItemType` in the Q2 2009 client side object model, and the client-side API reference is a little thin- I've found a lot of control functions relating to editing items, e.g:

masterTable.editItem(masterTable.get_dataItems()[0].get_element()); 
 
masterTable.editSelectedItems(); 
 
masterTable.updateEditedItems(); 
 
masterTable.editAllItems(); 

But these all change the state of the items when all I want to know is what state the item is in. Is there a collection of GridItems that are dangling off the edge of the object model somewhere, or a simple property I'm missing or a function to evaluate? Please help!

Thanks


Tom
Nikolay Rusev
Telerik team
 answered on 28 Oct 2009
1 answer
211 views
Hi,

The Drag-and-Drop example between a RadTreeView and a RadGrid works fine, but we need to lock-down the TreeView while the user drags to the RadGrid. You see, if the TreeView is large, and the user drags one of the top nodes slowly across the TreeView, then it is quite annoying for the TreeView to expand all the nodes while dragging... I've disabled "Dropping" on the TreeView, but that has no effect on the Expand mode, of course. Any tips on how to elegantly disable ExpandMode while dragging a node?

Thanks!
R
Shinu
Top achievements
Rank 2
 answered on 28 Oct 2009
1 answer
158 views
Hello, i use the radGrid version 2009 Q2, i need to put the filter option in spanish

if some one can help me

Thank
Shinu
Top achievements
Rank 2
 answered on 28 Oct 2009
2 answers
336 views
Hello,

I have a content page that in turn has 'nested' master pages. Please see the following:

MasterPage1
-- MasterPage2
   -- MasterPage3
       -- ContentPage

I have put RadAjaxManager (RadAjaxManagerOnMasterPage1) on MasterPage1 and a RadAjaxManagerProxy on ContentPage.

MasterPage1 has a label (LabelOnMasterPage1) that I need to update when user clicks a button (ButtonOnContentPage) lying on ContentPage.

Now, on ContentPage, I have the following code.

            MasterPage1 masterPage1
                = (MasterPage1)this.Master.Master.Master;

            RadAjaxManager radAjaxManagerOnMasterPage1
                = (RadAjaxManager)masterPage1.FindControl("RadAjaxManagerOnMasterPage1");

            if (radAjaxManagerOnMasterPage1 != null)
            {
                radAjaxManagerOnMasterPage1 .AjaxSettings.Clear();
                radAjaxManagerOnMasterPage1 .AjaxSettings.AddAjaxSetting(ButtonOnContentPage, masterPage1.GetLabelOnMasterPage1);
            }

NOTE: There is a property in MasterPage1 (GetLabelOnMasterPage1) that returns reference to LabelOnMasterPage1.

When I execute the above code, NullReferenceException is raised when AddAjaxSetting is called. Upon analysis, I found that RadAjaxManager.GetCurrent(ButtonOnContentPage.Page) returns NULL.

NOTE: GetCurrent() is eventually called in AddAjaxSetting (as per the disassembler code).

I tried writing this code both at Page_Load and OnPreRender but it worked nowhere.

Kindly tell me what is it that I am missing?

~Abhay

Abhay Jain
Top achievements
Rank 1
 answered on 28 Oct 2009
2 answers
209 views
I have a radgrid that uses a usercontrol as an editform.  How can I access the user control for the item being inserted?  I need to access the insert control from an ajax request.    Apparently this is different from accessing an edit control?
eric
Top achievements
Rank 1
 answered on 27 Oct 2009
1 answer
114 views
Hi, i'm triying to hide all cells with cero value, i just wanto to see values greater than 0 (Cero),
thanks

Gino
Daniel
Telerik team
 answered on 27 Oct 2009
1 answer
177 views
I do have a radgrid and inside one column i am using another radgrid which has checkbox, userid, ssn.
on submit button, is it possible to loop through radgrid on client side and get all the ssn's? I would like to concatenate the ssn's separated by comma.
Schlurk
Top achievements
Rank 2
 answered on 27 Oct 2009
6 answers
304 views
What kind of changes do you guys think we'll see with .NET 4.0? I'm thihnking some of the new file reading, and viewstate features might lend some useful changes and/or additions.
Rob
Top achievements
Rank 1
 answered on 27 Oct 2009
7 answers
826 views
Hi,

I have a Radgrid, which populates with search criteria result set. My requirement is to clear the grid rows when user click on 'Clear criteria' button. I just want to clear the rows and keep the column names as it is.

Thanks
Evan
Telerik team
 answered on 27 Oct 2009
2 answers
339 views
I have a grid with some transactions bound to it. I have the grid working as intended except for when the header checkbox for the grid client select column is selected.

Page/Grid Markup:
        <telerik:RadAjaxManager ID="_pastManager" runat="server" EnableAJAX="true"> 
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="_pastItemsGrid"> 
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="_pastItemsGrid" /> 
                        <telerik:AjaxUpdatedControl ControlID="_selectedAmount" /> 
                        <telerik:AjaxUpdatedControl ControlID="_selectedValue" /> 
                        <telerik:AjaxUpdatedControl ControlID="_continueBtn" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <%--Grid containing the results--%> 
        <div style="margin: 15px 5px 15px 5px;"> 
            <telerik:RadGrid ID="_pastItemsGrid" runat="server" AllowMultiRowSelection="true" 
                ShowFooter="false" AutoGenerateColumns="false" AllowSorting="true" Skin="Web20"> 
                <HeaderStyle Font-Bold="true" HorizontalAlign="Left" /> 
                <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" /> 
                <ClientSettings EnablePostBackOnRowClick="true"> 
                    <Selecting AllowRowSelect="true" /> 
                </ClientSettings> 
                <MasterTableView DataKeyNames="TranID"> 
                    <Columns> 
                        <telerik:GridBoundColumn HeaderText="Date" DataField="Date" /> 
                        <telerik:GridBoundColumn HeaderText="Description" DataField="Description" /> 
                        <telerik:GridBoundColumn HeaderText="Amount" DataField="Amount" UniqueName="Amount" /> 
                        <telerik:GridTemplateColumn HeaderText="Reward Value" UniqueName="Value"> 
                            <ItemTemplate> 
                                <div style="color: #0DAE4B;"> 
                                    <asp:Label ID="_milesLabel" runat="server" Text='<%# GetCurrency(Eval("Miles")) %>' /> 
                                </div> 
                            </ItemTemplate> 
                        </telerik:GridTemplateColumn> 
                        <telerik:GridClientSelectColumn HeaderText="Select" UniqueName="checkSelect" CommandName="RowClick" /> 
                    </Columns> 
                    <NoRecordsTemplate> 
                        <div> 
                            There were no records found.</div> 
                    </NoRecordsTemplate> 
                </MasterTableView> 
            </telerik:RadGrid> 
            <div style="padding-top: 5px;"> 
                <div style="float: left; font-size: 14px; font-weight: bold; width: 370px; text-align: right; 
                    padding-right: 10px;"> 
                    Total Purchase Credit Amount: 
                </div> 
                <div style="font-weight: bold; font-size: 12px; float: left; width: 119px;"> 
                    <asp:Label ID="_selectedAmount" runat="server" Text="$0.00" /> 
                </div> 
                <div style="color: #0DAE4B; font-weight: bold; font-size: 12px; float: left;"> 
                    <asp:Label ID="_selectedValue" runat="server" Text="0" /> 
                </div> 
                <div style="float: right;"> 
                    <asp:Button ID="_continueBtn" runat="server" Text="Credit" /> 
                </div> 
                <div class="clear"> 
                </div> 
            </div> 
            <div class="clear"> 
            </div> 
        </div> 

Code Behind:
    Protected Sub _pastItemsGrid_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles _pastItemsGrid.NeedDataSource 
        Dim ds As New DataSet 
        ds.ReadXml(Server.MapPath("../Transactions.xml")) 
        _pastItemsGrid.DataSource = ds 
    End Sub 
 
 
    Protected Sub _pastItemsGrid_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles _pastItemsGrid.ItemCommand 
        Dim amountTotal As New Decimal 
        Dim rewardTotal As Integer = 0 
 
        If e.CommandName = "RowClick" Then 
            For Each dataItem As GridDataItem In _pastItemsGrid.MasterTableView.Items 
                If dataItem.Selected Then 
                    '' Get the label control which has the value. 
                    Dim toChange As Label = CType(dataItem.Item("Value").FindControl("_milesLabel"), Label) 
                    '' Seperate out the value from the currency wording. 
                    Dim splitValue As Array = toChange.Text.Split(" ") 
                    '' Replace any commas in the value so that it can be converted. 
                    Dim test As String = splitValue(0).ToString.Replace(",", "") 
                    '' Convert the value and add to total. 
                    rewardTotal += CInt(test) 
                    '' Conver the amount and add to total. 
                    amountTotal += CDec(dataItem.Item("Amount").Text) 
                End If 
 
            Next 
        End If 
        '' Update both amount and currency value for user. 
        _selectedAmount.Text = String.Format("{0:C2}", amountTotal) 
        _selectedValue.Text = String.Format("{0:#,##}", rewardTotal) 
    End Sub 

The ItemCommand event fires and all the appropriate controls are updated when i click the row or select the specific row checkbox. But when the checkbox in the header is clicked the ItemCommand event is not fired. Can you guys point me to what im missing. Thanks



Mustafa Hussain
Top achievements
Rank 1
 answered on 27 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?