Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
415 views
I have a RadGrid that is bound to a objectDataSource and everything is working when using the save/cancel buttons for initiating a change; however when the user presses enter after supplying a value... the data will not submit; it just refreshes the datasource.

Here is some sample code:
01.<%@ Page Title="Goods Received" Language="C#" MasterPageFile="~/App_Masterpage/PurchaseRequest.master" AutoEventWireup="true" CodeFile="Received.aspx.cs" Inherits="apps_rc_purchasing_my_Default" %>
02. 
03.<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
04.<asp:Content ID="Content2" ContentPlaceHolderID="main_content" runat="Server">
05.    <div class="container">
06.        <div class="row">
07.            <h3>Goods Received</h3>
08.            <p>
09.                This page has been configured to allow you to adjust the received quantity.
10.            </p>
11.        </div>
12.        <div class="row">
13.            <telerik:RadGrid ID="rgRequests" MasterTableView-DataKeyNames="DPO,DLINE" MasterTableView-EnableViewState="true"
14.                OnPreInit="rgRequests_PreInit" EnableViewState="true" ItemStyle-Font-Size="smaller" AlternatingItemStyle-Font-Size="smaller"
15.                EnableLinqExpressions="false" PageSize="20" AllowSorting="true" AllowPaging="true" AllowFilteringByColumn="false" runat="server"
16.                CssClass="cat table table-bordered" DataSourceID="odsRequests" OnItemUpdated="rgRequests_ItemUpdated"
17.                AllowAutomaticInserts="false" AllowAutomaticUpdates="true" AutoGenerateColumns="false" Skin="Metro">
18.                <MasterTableView EditFormSettings-EditColumn-AutoPostBackOnFilter="true" HeaderStyle-CssClass="subhead" BatchEditingSettings-EditType="Row"
19.                    EditMode="Batch" CommandItemSettings-SaveChangesText="Save" CommandItemSettings-ShowSaveChangesButton="true"
20.                    CommandItemDisplay="TopAndBottom"  CommandItemSettings-ShowAddNewRecordButton="false" CommandItemSettings-ShowRefreshButton="false">
21.                    <Columns>
22.                        <telerik:GridBoundColumn ReadOnly="true" AllowFiltering="false" HeaderStyle-Width="30px" HeaderText="PO #" DataField="DPO" Visible="true" />
23.                        <telerik:GridBoundColumn ReadOnly="true" AllowFiltering="false" HeaderStyle-Width="30px" HeaderText="Line #" DataField="DLINE" Visible="true" UniqueName="DLINE" />
24.                        <telerik:GridBoundColumn ReadOnly="true" AllowSorting="true" CurrentFilterFunction="Contains" HeaderStyle-Width="180px" AutoPostBackOnFilter="true" DataField="DITEM" HeaderText="Item" MaxLength="25" />
25.                        <telerik:GridNumericColumn ReadOnly="true" AllowSorting="true" CurrentFilterFunction="Contains" HeaderStyle-Width="180px" AutoPostBackOnFilter="true" DataField="DQTY" HeaderText="Quantity" MaxLength="25" />
26.                        <telerik:GridNumericColumn AllowSorting="true" CurrentFilterFunction="Contains" HeaderStyle-Width="180px" AutoPostBackOnFilter="true" DataField="DRQTY" HeaderText="Rcvd Quantity" MaxLength="25" UniqueName="DRQTY" />
27.                    </Columns>
28.                </MasterTableView>
29.            </telerik:RadGrid>
30.        </div>
31.        <div class="row" runat="server" id="dbInfo">
32.            <div class="text-danger" runat="server">
33.                <h3>Admin Information</h3>
34.                <div class="list-group">
35.                    <div id="notify" class="list-group-item" runat="server"></div>
36.                </div>
37.            </div>
38.            <div class="example">
39.                <strong>Database:</strong><small>Web.Config - LIBD31USR - POPPOD - INLINE DATASOURCE - <strong>Usage:</strong> <span class="bs bs-example text-success">RiggsCAT.Finance.PurchaseRequestDET.Search(string search), PurchaseRequestDET.Update(string POID, string DLINE, int DRQTY)</span></small>
40.                <asp:ObjectDataSource ID="odsRequests" runat="server" SelectMethod="GetRequestsByPO" TypeName="RiggsCAT.Finance.PurchaseRequestDET" UpdateMethod="UpdateReceivedQty">
41.                    <SelectParameters>
42.                        <asp:QueryStringParameter QueryStringField="POID" Type="String" Name="PO" />
43.                    </SelectParameters>
44.                    <UpdateParameters>
45.                        <asp:Parameter Name="DPO" Type="String"  />
46.                        <asp:Parameter Name="DLINE" Type="String" />
47.                        <asp:Parameter Name="DRQTY" Type="Int32" />
48.                    </UpdateParameters>
49.                </asp:ObjectDataSource>
50.            </div>
51.        </div>
52.    </div>
53.</asp:Content>

Konstantin Dikov
Telerik team
 answered on 31 Mar 2015
1 answer
62 views
I have attempted to recreate this demo on my local PC with the northwind DB:

http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultcs.aspx

Unfortunately, the clientside call in the client pageload event:

PageMethods.GetData(0, tableView.get_pageSize(),

does not initiate the following serverside code:

public static List<Employee> GetData(int startIndex, int maximumRows,

string sortExpressions, List<GridFilterExpression> filterExpressions)

this function fails here:

function RadGrid1_RowDataBound(sender, args) {

var radTextBox1 = args.get_item().findControl("LastName"); 

radTextBox1.set_value(args.get_dataItem()["LastName"]); fails here

}

Can someone please explain why the client side call does not work or provide me with a better example of clientside data binding.

Thanks in advance.

Mark
Pavlina
Telerik team
 answered on 31 Mar 2015
1 answer
108 views
Folks:

I have attempted to recreate the demo here: http://demos.telerik.com/aspnet-ajax/grid/examples/data-binding/client-side/programmatic/defaultcs.aspx. I have a blank and broken grid since this web method:
 public static List<Employee> GetData(int startIndex, int maximumRows,

string sortExpressions, List<GridFilterExpression> filterExpressions)

is not being called from this client script:
PageMethods.GetData(0, tableView.get_pageSize(),

tableView.get_sortExpressions().toString(), tableView.get_filterExpressions().toList(),

updateGrid);

Without this data the following client call is failing with a null error:

function RadGrid1_RowDataBound(sender, args) {

var radTextBox1 = args.get_item().findControl("LastName"); // find control

radTextBox1.set_value(args.get_dataItem()["LastName"]); fails here

}

Can anyone please explain why the server side portion is not being called or provide a better example of client side data binding.

Thanks in advance.

Mark


Pavlina
Telerik team
 answered on 31 Mar 2015
16 answers
315 views
I wasn't sure the best way to describe this, but here is what I have:

I have a RadMenu with Help -> About
When I click about here is the code that is fired:

        protected void aboutClick() 
        { 
            RadWindow windowAbout = new RadWindow(); 
            // Set the window properties  
            windowAbout.NavigateUrl = "~/windows/about.aspx"
            windowAbout.ID = "RadWindowAbout"
            windowAbout.VisibleOnPageLoad = true;  
            windowAbout.Title = "About"
            windowAbout.VisibleStatusbar = false
            //windowAbout.Animation = WindowAnimation.FlyIn; 
            windowAbout.Width = new Unit(400, UnitType.Pixel); 
            windowAbout.Height = new Unit(310, UnitType.Pixel); 
            //windowAbout.Modal = true; 
            windowAbout.DestroyOnClose = true
            windowAbout.Behaviors = WindowBehaviors.Close | WindowBehaviors.Move; 
            RadWindowManager1.Windows.Add(windowAbout); 
        } 

With or without making the window modal the first time I select about everything is fine. The second time I select it I get two instances of the window, and third time I get three.

Any help is appreciated.
Onkaramurthy
Top achievements
Rank 1
 answered on 31 Mar 2015
1 answer
144 views
Is there a way to add additional key/values to the change data so that it will be available in the OldValues and NewValues Hashtables?

I have a grid of data that could be edited from different pages at the same time and I need to pass an additional key/value pair with the change data to track DB Concurrency issues.


// callback function
function cell_changed(sender, args) {
    var row = args.get_row();
    var field = args.get_columnUniqueName(); // column
    var value = args.get_editorValue();
   
    var timestamp = row.getAttribute("data-ts");

     // how can I add an addition change to pass back with the newValues
     cell.add_change("ts", timestamp);
}


// is this close?

var id = sender._masterCleintID;
var editor = sender.get_batchEditingManager();
var changes = editor._changes[id];
changes[{rowIndex}] = {
     {field} = {
          originalValue = {
               "ts": timestamp
          }
     }
}



 

Konstantin Dikov
Telerik team
 answered on 31 Mar 2015
1 answer
149 views
Is there any capabilities in this control to have the image saved on the server vs. having them saved/downloaded to the client's computer. I'm not seeing anything, but i just want to confirm.  

I'd love to have a tool that lets me pass in a URL and create the image based on the rendered page and have that image saved on the server.

Thanks!
-Mark
Hristo Valyavicharski
Telerik team
 answered on 31 Mar 2015
1 answer
149 views
Apparently at some point in time, when you wanted to get the selected row data from a RadComboBox  from a calling form you look to the Request.Form item with the _ClientState in it's key.  For example If I had this on Form1:
<telerik:RadComboBox ID="cbTabDup" runat="server" Height="100px" Width="100px" Skin="Default"
    AutoPostBack="true" DropDownWidth="300px" HighlightTemplatedItems="True" MarkFirstMatch="true"
    ShowDropDownOnTextboxClick="true">
    <ItemTemplate>
        <table cellpadding="1" cellspacing="0" class="Main" width="250px">
            <tr>
                <td width="100px">
                    <%#DataBinder.Eval(Container.DataItem, "Code")%>
                      
                </td>
                <td nowrap>
                    <%#DataBinder.Eval(Container.DataItem, "Description")%>
                </td>
                <td style="display: none;">
                    <%# DataBinder.Eval(Container.DataItem, "ID") %>
                </td>
            </tr>
        </table>
    </ItemTemplate>
    <HeaderTemplate>
        <table cellpadding="1" cellspacing="0" class="Main" width="250px">
            <tr>
                <td class="ComboHeader" width="100px">
                    Code
                </td>
                <td class="ComboHeader">
                    Description
                </td>
            </tr>
        </table>
    </HeaderTemplate>
</telerik:RadComboBox>
and submitted it to Form2 using:
            Response.Redirect("Form2.aspx", True)

In Form2 I could do something like this and get the values:
For Each key In Request.Form.AllKeys
    If InStr(key, "cbTabDup_ClientState") > 0 Then
        Dim clsRad As New clsRadComboRequest
        clsRad.RadClientState = Request(key).ToString
        clsRad.SetValues()
 
        sDupText = clsRad.RadText
        sDupDescText = clsRad.RadDesc
        iDupInd = clsRad.RadValue
        Exit For
    End If
Next

Except for some unknown reason now, the Request array key containing the "cbTabDup_ClientState" is EMPTY?  Where'd it go?

Hristo Valyavicharski
Telerik team
 answered on 31 Mar 2015
3 answers
118 views
How do I bind only one node to a datatable or dataset(or sqldatasource I would like to use cache so it does not load every call as well)

<telerik:RadNavigation ID="RadNavigation1" runat="server" CssClass="siteMainMenu">
                <Nodes>
                    <telerik:NavigationNode ID="NavigationNode1" Text="Home" runat="server" NavigateUrl="/">
                    </telerik:NavigationNode>
                    <telerik:NavigationNode ID="NavigationNode2" Text="Products" runat="server">
                    </telerik:NavigationNode>
                    <telerik:NavigationNode ID="NavigationNode3" Text="Support" runat="server">
                        <Nodes>
                            <telerik:NavigationNode Text="Tutorials"></telerik:NavigationNode>
                            <telerik:NavigationNode Text="Samples"></telerik:NavigationNode>
                        </Nodes>
                    </telerik:NavigationNode>               
                </Nodes>
            </telerik:RadNavigation>


I have a dynamic list of products that I want to display as a drop down under NavigationNode2 "Products".

I suspect I would do something on nodedatabound but not sure what? 

Thanks, Marty



Ivan Danchev
Telerik team
 answered on 31 Mar 2015
1 answer
123 views
Is there any way that we can customize the content of the tooltip functionality in the RadPivotGrid?

I essentially want to be able to customize the tooltip that appears on a row header using load-on-demand functionality to display some content that would not always be needed, and would otherwise slow down the pivot grid significantly if I always had it render with the control.
Marin
Telerik team
 answered on 31 Mar 2015
3 answers
139 views
Hi,

I'd like to access the parent data source from a column template. Something like this:

<telerik:GridTemplateColumn DataField="Number" HeaderText="Number">
    <ItemTemplate>
        <%# ((MyCollection)Parent.DataSource).MyProperty %>
    </ItemTemplate>
</telerik:GridTemplateColumn>

where MyCollection represents a class I use to populate RadGrid and MyProperty is a property of this class that I'd like to access.

Is it possible to accomplish that?

Thanks,
Leszek
Eyup
Telerik team
 answered on 31 Mar 2015
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?