w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
GridView with both declarative (Html side) datasource and code-behind datasource
It is possible only under one condition.That you set the DataSourceID to nothing of your gridview before re-assigning its datasource to a datatable.Otherwise visual Studio will scream loudly at you in these lines 'Both DataSource and DataSourceID are defined on 'yourGrid'. Remove one definition.' yourgrid.DataSourceID=null; yourGrid.DataSource=yourDataTable;

Categories : Asp Net

Can you use Kendo UI's dataSource to get data straight from a database or C# dataSource?
Yes. It can bind to pretty much any source of json, so you have a lot of options. In WebForms, a good one is WebMethods. You could add a WebMethod to your form and then bind the DataSource to it. Or you could also create a web service, or build an aspx that renders json or xml instead of html (make sure you set the content-type!), or even call a static file that contains json. I would start with reading this overview of the DataSource: http://docs.kendoui.com/getting-started/framework/datasource/overview

Categories : C#

Dynamically binding datasource to a gridview
You have to select something from your SqlDataSource gridview_modules.DataSource = DataSource2.Select(DataSourceSelectArguments.Empty); gridview_modules.DataBind();

Categories : C#

Where in event cycle does gridview get datasource
It happens on the GridView.OnDataBound: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.basedataboundcontrol.databound%28v=vs.90%29.aspx

Categories : C#

Convert GridView.DataSource with DateTime column to datatable
Try this way DataView dv=(DataView) from test in db.Tests select new { testId= test.TestId, courseName = test.Course.Name, onDate = test.OnDate, lastRegisterDate = test.LastRegisterDate }; gridAllTests.DataSource = dv; DataTable dt = new DataTable(); DataSourceSelectArguments args = new DataSourceSelectArguments(); DataView dv = new DataView(); dv = (DataView)dv.Select(args);// This SqlDataSourceObject means your sql query return object ,like dataset or datavi

Categories : C#

Init a List from GridView DataSource with Reflection for the type
It's not easier to order the list before assigning the datasourde? Or using GridView.Sort? http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sort.aspx

Categories : C#

Putting image in DataTable and setting table as datasource to gridview
I'm not aware of a method for natively rendering image files (including BMP) in a GridView. In your case, what I'd do is save that bitmap in a local file in the virtual directory. Once you have the file name, you can bind that filename to an ImageField column in the GridView.

Categories : C#

kendo ui how to filter dataSource requestStart
The changes I did to solve the progress endlessly problem where 2. Removing requestEnd function from the dataSource Adding dataBound function to the Grid Data Source Code dataSource = new kendo.data.DataSource({ transport: { read: { url: url_Obtener_Periodo, type: "POST" }, parameterMap: function (options, operation) { if (operation == "read" && options) { return { "periodo.Year": $("#periodo-anio").val(), "periodo.Month": $("#periodo-mes").val(), "Filtro": $("#Filtro").val() }; } } }, schema:{ model: { id: "Codigo_De_Pedido", fields: { Codigo_De_Pedido: { type: "number" }, Fecha_Y_Hora_De_Creacion: { type: "date" }, UserName: { type: "string" },

Categories : Kendo Ui

display gridview data in another page or other gridview with row data in editable mode
You need to add RowCommand Event in GridView. <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView1_RowCommand"> <asp:LinkButton ID ="lnkEdit" runat ="server" CommandArgument='<%#Eval("Recordid")%>' CommandName ="cmdEdit" Text ='Edit'></asp:LinkButton> </asp:GridView> Here rocordid is the id of your record. In Page behind you need to write code. protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "cmdEdit") { string Recordid = Convert.ToString(e.CommandArgument.ToString()); Response.Redirect("EditPage.aspx?recordid="+Recordid ); } } On EditPage you can get recordid from the query string and can fetch the record form the datab

Categories : Asp Net

Gridview returning empty even when there is data. I want to use data in the gridview to update another database
Per my comment above you may want to do something like: List<string> _OrderIds = new List<string>(); DataTable table = gvOrderLines.DataSource as DataTable; foreach (GridViewRow gvr in table.Rows) { Label myOrderIDLablel = (Label)gvr.FindControl("lblOrderID"); //find control since it is a template field _OrderIds.Add(myOrderIDLablel.Text); } I hope this get you headed in the right direction.

Categories : C#

DevExpress Report must filter BindingSource with Parameters at the datasource level
I would use LINQ to select the data before it goes into the report. My code is in VB.net but can fairly easily be translated: 1 - Create a data object - that will contain our data Public Class Animal Public name As String Public livesYears As Integer Public location As String End Class 2 - Create the XtraReport1. Drop a BindingSource onto the designer and set it's DataSource to Animal. If Animal doesn't show up in the list that the wizard generates, you will need to rebuild your solution. Drop a couple of the Fields onto the designer... 'name' etc so that the report will have something to... report! 3 - Create sub to populate the list Private Function createAnimals() As List(Of Animal) Dim allAnimals As New List(Of Animal) allAnimals.Add(New Animal With {.name =

Categories : C#

Filter GridView with Javascript
If I understand your question correctly, you are looking for something like this: $(function(){ $('#tabela input').keyup(function(){ var val = $(this).val().toUpperCase(); $('#GridView1> tbody > tr').each(function(index , element){ if($(this).text().toUpperCase().indexOf(val)<0) $(this).hide(); else $(this).show(); }); }); }); Essentially, it iterates through the rows in the grid looking for matches, hiding/showing the rows accordingly. In your markup provided inside the tabela, you can simply have one text input instead of 3. Here's a quick demo.

Categories : C#

filter gridview using checkbox
You can use following properties of gridview 'onrowdatabound and DataKeyNames'. In DataKeyNames you can give the name of your class variables or properties where you are reading from database through a datareader. Fire the rowDatabound event of your gridview so that you can check the status protected void gvtransaction_RowDataBound(object sender, System.Web.UI.WebControls.GridViewRowEventArgs e) { int Status = (int)this.gvtransaction.DataKeys[e.Row.RowIndex].Values[0]; if (Status) { . check status values for Accepted, pending and rejected through if else. . . } }

Categories : Asp Net

It is possible to use DataTables Column Filter Add-on with a Gridview
In order to add anything to the footer, you need to use TemplateField controls rather than BoundField controls. See http://www.dreamincode.net/forums/topic/222381-insert-data-using-gridview-footerrow/ for an example of how to do this. One thing to note though, the HTML generated by the GridView control will use <td> elements in the footer rather than <th> elements as expected by the DataTables documentation.

Categories : C#

Is it possible to use DataTables Column Filter Add-on with a gridview.
You need to set Gridview's attribute "ShowFooter" to True. It is set to False by default <asp:GridView ID="GridView1" runat="server" ShowFooter="True" />

Categories : C#

ASP.NET C# CodeBehind DB Filter a GridView with a textbox
Don't care about the control type: (sample) <asp:sqldatasource id="SqlDataSource1" runat="server" connectionstring="<%$ ConnectionStrings:MyNorthwind%>" selectcommand="SELECT LastName FROM Employees WHERE Title = @Title"> <selectparameters> <asp:controlparameter name="Title" controlid="yourTextBox" propertyname="Text"/> </selectparameters> </asp:sqldatasource>

Categories : C#

Gridview onRowCommand fired gridview no data
Problem in this line ID = gvWorkshop.DataKeys[grdrow.RowIndex]["workshopID"].ToString(); You have mention "grdrow" in place of "row". please change it to ID = gvWorkshop.DataKeys[row.RowIndex]["workshopID"].ToString();

Categories : C#

How to filter the rows of a gridview in yii using radio buttons
I used a drop down for this, the values are Yes and No. Just translate the approved column into text using the following code: array( 'name' => 'approved', 'value' => '($data->approved ? "Yes" : "No")', 'filter' = >CHtml::dropDownList('Approved', '', array( ' '=>'All', '1'=>'On', '0'=>'Off', ) ), ) This link is where I got this info: http://www.yiiframework.com/forum/index.php/topic/30694-cgridview-filter-dropdown-from-array/ I googled using cgridview filter example

Categories : PHP

filter gridview based on dropdownlist selected value
You are not showing where you initialize idTeacher. However, you have to DataBind the GridView in ASP.NET after you have assigned the DataSource: GridView1.DataSource = table; GridView1.DataBind(); // <-- this is missing in your code You should use sql-parameters anyway, otherwise you are potentially open for sql-injection and you should use the using statement to ensure that all unmanaged resources are disposed (even on error): using (var con = new OleDbConnection("ConnectionString")) using (var da = new OleDbDataAdapter("select * from teacher where idteacher=@idTeacher", con)) { da.SelectCommand.Parameters.AddWithValue("@idteacher", idTeacher); DataTable table = new DataTable(); da.Fill(table); // opening or closing connection not needed, done by Fill GridView1.D

Categories : C#

Adding filter to one hearder column of the Gridview
take one textbox <asp:TextBox runat="server" ID="txtSearch"/> on button click event Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click cmd.Connection = cx cmd.CommandText = "select cl1, Carrier, cl2, cl3 from table where Carrier='"+txtSearch.Text+"'" da = New SqlDataAdapter(cmd) da.Fill(dt) GridView1.DataSource = dt GridView1.DataBind() End Sub

Categories : Asp Net

Filter dropdownlist in gridview based on form parameter
http://asimsajjad.blogspot.in/2009/09/raising-dropdownlist.html DropDownList SelectedIndexChanged within Gridview not firing!

Categories : Asp Net

How to register wso2 datasource defined in custom-datasource.xml in jndi
The useDataSourceFactory should be set as an attribute of jndiConfig element. So your datasource configuration should shange as follows. <datasource> <name>IPL_DS_IDB</name> <description>My custom datasource</description> <jndiConfig useDataSourceFactory="true"> <name>IPL_DS_DB</name> <environment> <property name="java.naming.factory.initial">com.sun.jndi.rmi.registry.RegistryContextFactory</property> <property name="java.naming.provider.url">rmi://localhost:10002</property> </environment> </jndiConfig> <definition type="RDBMS"> <configuration> <url&g

Categories : Wso2

Angular factory filter - Can't get data passed to the filter
Apparently I managed to pass the filter value, in a dirty way (I GUESS), like this <a ng-bind="category.slug" ng-click="returnFilter(category.slug);" ng-model="category.slug">{{ category.title }}</a> it goes here $scope.returnFilter = function(theSlug) { $scope.filterBy = theSlug; }; and it comes out here <li ng-repeat="photo in photos|filteringService:filterBy"> It's working, but Is this correct? EDIT: Also with this way in mind, I could pass an array as theSlug so I can do multiple filtering, and when clicking two times on the same item it would get it out of the array. hmmm EDIT 2: Let's say the resulting array is under 15 items, could do I run some action in the controller knowing this? Actually the other way around, could I quer

Categories : Javascript

filter the data from database using django filter
Your form is using location ids for its value keys, not location titles. ChoiceFields use the first part of each tuple in choices as the value which gets POSTed and the second part of each tuple is just the name of the choice as the user sees it. Add a print statement to check the value of your loc_id and you'll see what I mean. So you'll want to look up a location title for the location id in request.POST. If your ReportLocation model has a ForeignKey to Location you can do something like location_list = ReportLocation.objects.filter(location__id=loc_id) but if that doesn't work with your schema you might have to look up the title as a separate query. Here's a simplistic example: def search(request): reportlist = [] loc_id = request.POST.get('location') if loc_id:

Categories : Django

How to export a datasource's selected data to excel?
When I instituted database-level paging, I had to create a separate "Export" page that would render all of the data without paging into a separate GridView. Then I called the function you have in your question to render it. I suggest you do it that way.

Categories : Asp Net

How to set data item in datasource for listview kendo ui
Can you use something like this? var firstItem = $('#listView.product1 h3').data().kendoListView.dataSource.data()[0]; Or with jquery, you just use $('#listView.product1 h3').text("Some updated text"); or $('#listView div.product1 h3').text("Some updated text"); if you want it to search in divs only.

Categories : Jquery

Clean approach for refreshing UITableView data from datasource
You can call [dictB addEntriesFromDictionary:dictA]; and that should copy everything from dictA into dictB. Now you may have to clear out dictB before doing so, but it should work NSMutableDictionary Something a simple as dictB = [dictA copy]; may also work. Not sure though if that has problems with retain counts, or anything like that.

Categories : IOS

bind kendo.data.DataSource to combo using MVVM
I didn't get the answer , so i found an alternate working ice of code. just have a look and if it helps then please vote. created model for ddl in js file ddl = kendo.data.Model.define({ fields: { CountryId: { type: "int" }, ConfigurationID: { type: "int" } } }); added var ddl to MVVM js file vmSupplier = kendo.observable({ CountryId: new ddl({ CountryId: 0 }), ConfigurationID: new ddl({ ConfigurationID: 0 }),}); added code in controller using (CountriesManager objCountriesManager = new CountriesManager()) { ViewBag.Countries = new SelectList( objCountriesManager.GetCountries().Select(p => new { p.CountryID, p.CountryDesc }) , "CountryID", "CountryDesc"); ; } added code in cshtml

Categories : Asp Net Mvc

How to remove all data item in kendo ui listview datasource
When you add the data to your grid datasource, you can create a new datasource and set the listview datasource like the following: /// ... do your add code to grid dataSource var listView = $("#listView").data("kendoListView"); var newDataSource = new kendo.data.DataSource(/* your data source options */); listView.setDataSource(newDataSource); See the official documentation for more information here: http://docs.kendoui.com/api/web/listview#methods-setDataSource

Categories : Kendo Ui

cocoa, table view with core data datasource
You put the fetch code at that location of your program at which fetching is useful. You store the data in a way that is convenient for you, probably a property typed array in your controller. After fetching the data, you tell the table view, that there is new data to display by sending a reloadData (et al.) message to it. The data source of the table view, probably your controller will receive messages defined within the data source protocol to transport the date into the view. Since this is code written by you, too, it is totally under your controller, how you get the data. (See step 2).

Categories : Objective C

How to Ommit DataGridViewRow from DataSource Based on Another Table's Data
You could iterate through the datatable and remove the one you have selected and redraw the datagridview. Not another SQL call just using the datatable you already have. You can reinsert the row if you want, when done, or just use that same beginning datatable to refresh the DGV. For example if the open bill was id 1287: Dim dtTemp As DataTable = dtOpenBills.Clone() For Each dr As DataRow in dtOpenBills.Rows If Cint(dr("OpenBillID")) <> 1287 Then Dim drTemp As DataRow = dtTemp.NewRow() drTemp = dr dtTemp.Rows.Add(drTemp) End If Next DataGridViewName.DataSource = dtTemp DataGridViewName.Refresh() 'Might not be needed You haven't touched the original datatable.

Categories : SQL

kendoui kendoGrid datasource aggregate to existing data
Once you set the data you can add new aggregate like shown in the documentation. var dataSource= new kendo.data.DataSource({ data: [ { name: "Jane Doe", age: 30 }, { name: "John Doe", age: 33 } ] }); // calculate the minimum and maximum age dataSource.aggregate([ { field: "age", aggregate: "min" }, { field: "age", aggregate: "max" } ]); var ageAggregates = dataSource.aggregates().age; console.log(ageAggregates.min); // displays "30" console.log(ageAggregates.max); // displays "33"

Categories : Kendo Ui

Kendo UI Grid JSON DataSource not loading data
Code looks good. I wonder if you change data source creation as below . Change type from POST to GET and see if it works, var remoteDataSource = new kendo.data.DataSource( { transport: { read: { type: "GET", dataType: "json", url: "/home/getopportunities/" } }, pageSize: 4 })

Categories : Json

iOS: Update table view datasource with animations without core data
Take a look at TLIndexPathTools. It is an alternative to NSFetchedResultsController that, in addition to working with NSFetchRequest and Core Data objects, also works with plain arrays containing any type of data. It provides a standardized data model class TLIndexPathDataModel that can automatically organize your data into sections and has many APIs to simplify the implementation of your data source and delegate methods. But the main thing it does is automatically calculate and perform the animated batch updates for you when you update the data model. Try running the numerous sample projects to get an idea what can be done. The Shuffle sample project is a good starting point: tap the Shuffle button and the collection view grid randomly rearranges itself with animation. Here is the full

Categories : IOS

Bind kendo.data.datasource json data to kendo listview
You have placed schema inside transport definition while it is member of DataSource. Try: category = new kendo.data.DataSource({ serverFiltering: true, transport : { read: { type : "POST", url : "http://localhost:60143/Mobile/Menu/MenuData.asmx/getCategory", contentType: "application/json; charset=utf-8", dataType : "json", error : function (xhr, ajaxOptions, thrownError) { alert("error " + xhr.responseText); } } }, schema : { data: "d" }, type : "json", parameterMap : function (options) { return JSON.stringify(options); } });

Categories : Json

How to do filter in the new Ember Data? Also how does filter compare to find in the new Ember Data
In the new Ember Data (Beta 1.0.0) you can use the filter function from the DS.Store class. Unlike the previous filter function of the Model, you have to specify the type of Model you want: this.get('store').filter('person', function(record){return record.get('age') == 30});

Categories : Ember Js

Ways to display XML data obtained from SQL datasource as html in LABEL text in ASP.net
I would personally never try to do string manipulation/parsing on XML from scratch. There are a lot of built-in utilities in many languages and frameworks which handle that for you. Below are three methods to do display XML data similar to what you want. You will still have to modify this to do exactly what you want, but these should give you some pretty good ideas. Method 3 is probably the closest, however it is best to know about as many options as possible so you use the best method for the scenario. Method 1: When I have to display xml data in a webpage, I prefer to use XSLT. However, doing so assumes your users are using an XSLT compatible browser. artist.xml - This file includes a reference in the xml file itself. <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-st

Categories : Asp Net

ASP.Net object reference error when writing data to xml file via Gridview Empty data template
The issue is when you have the xml file without 'po' node. You can move the node to a new method like: Private Function CreatePOSDataset() As DataSet Dim oDs As New DataSet() oDs.DataSetName = "newshipmentnotification" oDs.Tables.Add("pos") oDs.Tables("pos").Columns.Add("pos_Id") oDs.Tables("pos").Columns("pos_Id").ColumnMapping = MappingType.Hidden oDs.Tables.Add("po") oDs.Tables("po").Columns.Add("ponumberID") oDs.Tables("po").Columns.Add("pos_Id") oDs.Tables("po").Columns("pos_Id").ColumnMapping = MappingType.Hidden oDs.Tables("po").Columns.Add("ponumber") Dim pos_po As DataRelation = oDs.Relations.Add("pos_po", oDs.Tables("pos").Columns("pos_Id"), _ oDs.Tables("po").Columns("pos_Id"))

Categories : Asp Net

Export Gridview Data to Excel in ASP.NET Linq data bind
It's pretty easy to set up the excel export that will export only the gridview. This has been tested and will only export the gridview that appears on your given web page. For your C# code use the following: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class vxcel_export : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button2_Click(object sender, EventArgs e) { Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=file-name.xls"); Response.ContentType = "application/vnd.xlsx"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); Sys

Categories : Asp Net

What's the minimum requirement for the DataSource property of ASPX server side data-bound controls?
Yes the DevExpress ASP.NET controls can be data bound to anything that supports IEnumerable. Online help docs: WebForms DevExpress ASP.NET GridView MVC Data Binding Hope that helps. If you have other questions, please feel free to contact the DevExpress support team: http://www.devexpress.com/Support/Center/CreateIssue.aspx?issuetype=Question

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.