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

hello

I am using a radgrid with a master table view and details table, I can update my master table view with a stored procedure however I cannot update detail table with another stored procedure. The two updates must be done simultaneously with the save button of radgrid in edit mode.

Here is what I did for my master table view, it works and i would like to do the same button on my detail table, Can you help me pls


protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {

            GridEditableItem editedItem = e.Item as GridEditableItem;
           
            string pID_OF = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["ID_OF"].ToString();
       
            string pNO_WO = (editedItem["NO_OF"].Controls[0] as TextBox).Text;
            string pRef = (editedItem["CodeArticle"].Controls[0] as TextBox).Text;
            string pQte = (editedItem["QteLancee"].Controls[0] as TextBox).Text;
            string pStatut_WO = (editedItem["StatutOF"].Controls[0] as TextBox).Text;
            string pDate_WO = (editedItem["DateLancement"].Controls[0] as TextBox).Text;
            string pID_Affectation = (editedItem["ID_Affectation"].FindControl("RadCombobox1") as RadComboBox).SelectedValue;


            try
            {
                SqlDSListeOF.UpdateParameters["pID_OF"].DefaultValue = pID_OF;
                SqlDSListeOF.UpdateParameters["pNO_WO"].DefaultValue = pNO_WO;
                SqlDSListeOF.UpdateParameters["pRef"].DefaultValue = pRef;
                SqlDSListeOF.UpdateParameters["pQte"].DefaultValue = pQte;
                SqlDSListeOF.UpdateParameters["pStatut_WO"].DefaultValue = pStatut_WO;
                SqlDSListeOF.UpdateParameters["pDate_WO"].DefaultValue = pDate_WO;
                SqlDSListeOF.UpdateParameters["pID_Affectation"].DefaultValue = pID_Affectation;
                SqlDSListeOF.Update();

            }
            catch (Exception ex)
            {
                e.Canceled = true;
                ErrorAffectation.Text = "Impossible de mettre à jour . " + ex.Message;
            }           
        }

 

 

axel
Top achievements
Rank 1
 updated question on 22 Nov 2021
1 answer
250 views

Trying to use an ODataDataSource with a RadSearchBox.  When I try to use it, I get the following error:

The query specified in the URI is not valid. The value for OData query '$orderby' cannot be empty.

Is there a way to set an orderby that I can pass?  I don't see an option (or maybe I'm going nuts - could be) and it appears as though the ODataDataSource is just passing a blank $orderby= in the query string. 

Thanks,

Richard

Bozhidar
Telerik team
 answered on 09 Jun 2016
1 answer
70 views
Hi there

I'm trying to retrieve a some basic related tables using an OpenAccessLinqDatasource control. I can retrieve one table just fine, but I get stuck trying to use the Custom Grouping as described in the documentation.

Basically I would like to have this query (which works just fine in SQL), work in the DataSource on my page:

"Select custorderitems.quantity, prodmain.itemtitle from custorderitems INNER JOIN prodmain on custorderitems.fkstoreitem = prodmain.id"

I've attached screenshots of the configuration screen where I enter the Custom Select Expression etc. Using a custom expression of new(quantity) actually works, I get that column in the RadGrid. The problem comes in when I specify another context with a field.. If I add Prodmain.itemtitle, I get no data at all.

Is there perhaps a clearer guide or tutorial explaining the Custom Grouping option of the OpenAccessLinqDatasource??

Regards
JohannS
Doroteya
Telerik team
 answered on 20 Jan 2015
9 answers
253 views
Hi,

I am trying to add a RadComboBox to my ASP.NET page using the ODataDataSource.

When I do it the (IMHO) prefered way like this:
<telerik:RadODataDataSource runat="server" ID="ODataDataSourceIBQueue">
        <Transport Read-DataType="JSONP">
            <Read Url="http://localhost/NiceWebApp/InsadBlackBoxModelService.svc/" />
        </Transport>
        <Schema>
            <telerik:DataModel ModelID="IBQueue" Set="IBQueues">
                <telerik:DataModelField FieldName="Code" />
                <telerik:DataModelField FieldName="Description" />
                <telerik:DataModelField FieldName="Notes" />
                <telerik:DataModelField FieldName="QueueID" />
                <telerik:DataModelField FieldName="QueueType" />
            </telerik:DataModel>
        </Schema>
    </telerik:RadODataDataSource>
 
    <telerik:RadComboBox runat="server" ID="RadComboBox1" EnableLoadOnDemand="true"
        DataModelID="IBQueue"
        DataTextField="Code"
        DataValueField="QueueID"
        ODataDataSourceID="ODataDataSourceIBQueue">
    </telerik:RadComboBox>

I get the message 'DataSource with id ODataDataSourceIBQueue was not found on this page'

 When I add the OData settings inside the RadComboBox, like this:
<telerik:RadComboBox runat="server" ID="RadComboBox2" EnableLoadOnDemand="true">
        <WebServiceSettings Path="http://localhost/NiceWebApp/InsadBlackBoxModelService.svc">
            <ODataSettings ResponseType="JSONP">
                <Entities>
                    <telerik:ODataEntityType Name="IBQueue"
                                             DataValueField="QueueID"
                                             DataTextField="Code" />
                </Entities>
                <EntityContainer>
                    <telerik:ODataEntitySet EntityType="IBQueue"
                                            Name="IBQueues" />
                </EntityContainer>
            </ODataSettings>
        </WebServiceSettings>
    </telerik:RadComboBox>

It works as expected.

I have the same problem with the RadTreeView..

Can anyone advise on this? Or might it be a bug?

I am using VS2012, .NET 4.5, Telerik RadControls for ASP.NET AJAX 2012 Q2 Version 2012.2.815.40

Regards,

Insad

EDIT: Copy/Paste issue in samples corrected
احمد
Top achievements
Rank 1
 answered on 09 Aug 2014
1 answer
197 views
I have a RadGrid with client-side binding similar to the "ODataDataSource - Filtering, Sorting and Paging with RadGrid" example.  I have been able to add multiple filter conditions in the past by calling args.set_filterExpressions(filter); multiple times in the "requesting" function (see scripts.js in the example).  However, now I have a specification where I need to search multiple fields for a value (in addition to the other filters on the grid).  So the value might appear in column1,  column2, or column3.  An example of this kind of complex filtering is shown in the list view client-side filtering example

What is the recommended way for a client-side bound RadGrid to have complex filtering expressions?  When calling args.set_filterExpressions(filter), any previous expression uses "AND" logic with the existing expressions.  My resulting filter would be an OData URL as in the list view OData filtering example:
((UnitPrice gt 25 and UnitsInStock lt 40) or (Discontinued ne true and startswith(ProductName,'I') eq true))


Thanks.
Radoslav
Telerik team
 answered on 18 Mar 2014
0 answers
73 views
Hi Everyone

i am making Webmail like this http://demos.telerik.com/aspnet-ajax/webmail/ 
but problem is that.. How to show Total UnRead Email in inbox..
Example: Yahoo or other email sites inbox show Total Unread email
how to do this..?

Thanks
In Advance
Arsalan
Top achievements
Rank 1
 asked on 09 Feb 2014
7 answers
106 views
I was looking forward to seeing some changes to the ODataDataSource - Filtering, Sorting and Paging with RadGrid demo after this latest update to fix some glitches.  However, this demo and two of the others are now broken and have been down for several days.  The service on odata.org seems to have moved.  Using Fiddler on the demo page, I get:

HTTP/1.1 302 Found
Connection: Keep-Alive
Content-Length: 321
Date: Tue, 18 Jun 2013 19:26:16 GMT
Location: /(S(1z3r2a0jbjtlcjtx4j00pwta))/Northwind/Northwind.svc/Orders?$callback=jQuery19107677443233304048_1371583576801&%24format=json&%24inlinecount=allpages&%24top=20&%24filter=&%24orderby=
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Access-Control-Allow-Headers: Accept, Origin, Content-Type, MaxDataServiceVersion
Access-Control-Expose-Headers: DataServiceVersion
 
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/(S(1z3r2a0jbjtlcjtx4j00pwta))/Northwind/Northwind.svc/Orders?$callback=jQuery19107677443233304048_1371583576801&%24format=json&%24inlinecount=allpages&%24top=20&%24filter=&%24orderby=">here</a>.</h2>
</body></html>
Kate
Telerik team
 answered on 25 Jun 2013
9 answers
374 views
Is there a way to send tokens such as OAuth2 with the call to the ODataService?

I can see that there may be a way of injecting headers in the client-side event

OnRequesting but only if these are exposed in the args.set_Options object.



Thanks

Gary
Genady Sergeev
Telerik team
 answered on 04 Mar 2013
1 answer
72 views
Good morning,

I'm using an ODataDataSource to bind data to a RadComboBox. Currently the data source is retrieving all of the fields for each record whereas I'd like to only retrieve the fields I need for binding. I specified the fields (see code below) in the model declaration, which I would've expected to be passed on to the service call but that doesn't seem to be the case. 

Can you please let me know if this is a bug or if there is a way I can inject a $select clause to the service call?

Thanks, Jason

Markup:
<telerik:RadODataDataSource ID="dsComboBoxes" runat="server"
    ClientIDMode="Static">
</telerik:RadODataDataSource>               
 
<telerik:RadComboBox ID="cbxQuickAdd" runat="server"
    Width="100%" Height="190px" Skin="Simple"
    EnableLoadOnDemand="true"
    EmptyMessage="Type to Filter"
    EnableItemCaching="true"
    ODataDataSourceID="dsComboBoxes"
    DataModelID="Resource"
    DataTextField="Description"
    DataValueField="ID">
</telerik:RadComboBox>

Codebehind:
dsComboBoxes.Transport.Read.Url = ConfigurationManager.AppSettings.GetURL("BindingServiceURL");
dsComboBoxes.Transport.Read.DataType = ODataSourceResponseType.JSONP;
     
DataModel quickAdd = new DataModel()
{
    ModelID = groupType.Singularize(),
    Set = groupType
};
 
quickAdd.Fields.Add(new DataModelField() { FieldName = "ID" });
quickAdd.Fields.Add(new DataModelField() { FieldName = "Description" });
dsComboBoxes.Schema.Add(quickAdd);
Dimitar Terziev
Telerik team
 answered on 09 Jul 2012
3 answers
155 views
I've got a WCF Data Service which is correctly publishing data (checked in the browser), yet when I hook it up to a RadTreeView or a RadMenu, nothing is rendered in the Browser...

My markup looks like this (generated by smart tags): 

<telerik:RadODataDataSource ID="RadODataSource1" runat="server">
  <Transport>
    <Read Url="http://localhost:8989/ODService.svc/" DataType="XML" />
  </Transport>
  <Schema>
    <telerik:DataModel ModelID="Thing" Set="Things">
      <telerik:DataModelField FieldName="Id" />
      <telerik:DataModelField FieldName="Name" />
      <telerik:DataModelField FieldName="Value" />
    </telerik:DataModel>
  </Schema>
</telerik:RadODataDataSource>
 
 
<telerik:RadTreeView ID="RadTreeView1" Runat="server" DataFieldID="Id" DataModelID="Thing" ODataDataSourceID="RadODataSource1"></telerik:RadTreeView>


The output in the browser when directed  to http://localhost:8989/ODService.svc/Things looks like this:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
  <title type="text">Things</title>
  <id>http://localhost:8989/ODService.svc/Things</id>
  <updated>2012-07-03T10:27:17Z</updated>
  <link rel="self" title="Things" href="Things" />
  <entry>
    <id>http://localhost:8989/ODService.svc/Things(0)</id>
    <title type="text"></title>
    <updated>2012-07-03T10:27:17Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="Thing" href="Things(0)" />
    <category term="RadApp.Data.Model.Thing" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:Id m:type="Edm.Int32">0</d:Id>
        <d:Name>Thing0</d:Name>
        <d:Value>e55187e0-1439-4ac8-984b-504236caf274</d:Value>
      </m:properties>
    </content>
  </entry>
  <entry>
    <id>http://localhost:8989/ODService.svc/Things(1)</id>
    <title type="text"></title>
    <updated>2012-07-03T10:27:17Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="Thing" href="Things(1)" />
    <category term="RadApp.Data.Model.Thing" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:Id m:type="Edm.Int32">1</d:Id>
        <d:Name>Thing1</d:Name>
        <d:Value>cfb491c8-9a07-4393-a539-5d7078cc9ded</d:Value>
      </m:properties>
    </content>
  </entry>
  <entry>
    <id>http://localhost:8989/ODService.svc/Things(2)</id>
    <title type="text"></title>
    <updated>2012-07-03T10:27:17Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="Thing" href="Things(2)" />
    <category term="RadApp.Data.Model.Thing" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
    <content type="application/xml">
      <m:properties>
        <d:Id m:type="Edm.Int32">2</d:Id>
        <d:Name>Thing2</d:Name>
        <d:Value>7daecdaa-4a69-4f61-87f6-55eaca455ccc</d:Value>
      </m:properties>
    </content>
  </entry>
</feed>

 
and finally, the source from the rendered web page where the control should be, looks like this:

<div id="RadTreeView1" class="RadTreeView RadTreeView_Clear">
    <input id="RadTreeView1_ClientState" name="RadTreeView1_ClientState" type="hidden" autocomplete="off" value="{"expandedNodes":[],"collapsedNodes":[],"logEntries":[],"selectedNodes":[],"checkedNodes":[],"scrollPosition":0}">
</div>


Is there something I'm doing wrong?

I can post up the code from the data classes or the context, but the fact that the service is outputting into the browser (as above) without problems, allowing me to correctly query it, would suggest that the problem isn't in the service itself.
Genady Sergeev
Telerik team
 answered on 05 Jul 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?