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#

Asp.net devexpress : getting the datasource of the aspxgridview back to collection
You have assigned the DataSource Property of AspxGridview control then you can directly access that assigned assigned List from DataSource Property, it is a read and write property. Check the documentation: ASPxDataWebControlBase.DataSource Property Gets or sets the object from which the data-bound control retrieves its list of data items. From: Get GridView data source to Data table if you bind gridview on every postback..then you can get DataTable dt = GridView1.DataSource as DataTable; Same for you alos as List<SomeType> data = grid.DataSource as List<SomeType>; Hope this help..

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#

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

Spring Transactions not rolling back on Exception (Oracle JNDI datasource)
Please be aware that Spring's transaction management rolls-back transactions only for unchecked exceptions (RuntimeException) by default. If you wish to perform rollback also on checked exceptions, you need to define that. When using annotations as attribute source, you need to provide rollbackFor attribute with the list of exception classes, which should cause a transaction to be rolled-back (quote from the JavaDoc): /** * Defines zero (0) or more exception {@link Class classes}, which must be a * subclass of {@link Throwable}, indicating which exception types must cause * a transaction rollback. * <p>This is the preferred way to construct a rollback rule, matching the * exception class and subclasses. * <p>Similar to {@link org.springframework.transaction.interceptor.

Categories : Oracle

Writing test results back to the TestContext with an Excel WorkSheet as DataSource
MSTest doesn't support writing back to the data rows for data driven tests, and it's not designed to do this. My suggestion is to use Trace.Write() etc. methods to print the results into the results for each individual iteration of the test, which is what I do for debugging purposes in the case of failed tests.

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#

Change DevExpress GridView row back color after SetFocusedRowIndex(-1) by JavaScript
You can use the OnHtmlRowPrepared="gvMore_HtmlRowPrepared" on the aspx file at the ASPxGridview tag and implement it as follows on the cs file: public protected gvMore_HtmlRowPrepared(object sender, ASPxGridViewTableRowEventArgs e) { e.Row.Attributes.Add("id",e.Row.RowIndex.ToString()); } On the client side you can then change the // ??? part with document.getElementById(ri).style.Background = "#122334" or whatever other color you might want. I have not executed the code, and there might be more ins and outs but that's the gist of it.

Categories : Javascript

ASP.net Gridview Events are not firing, that is paging or Select button but causes a post back instead
You code is working. However, here is what I found. GridView's onselectedindexchanged is attached to btnSearchParticipant_Click. I don't know the reason behinds it. onselectedindexchanged="btnSearchParticipant_Click" As the result, whenever gvParticipantResults_RowCommand is fired, btnSearchParticipant_Click is also fired.

Categories : Asp Net

Bind GridView.ItemsSource back to DataTable but only visible columns and rows
if you want to have physical columns which are visible then you can directly iterate over datagrid columns collection like IEnumerable<DataGridColumn> visibleColumns = dataGrid.Columns.Where<DataGridColumn>(col => col.Visibility == System.Windows.Visibility.Visible); and then you can iterate over your DataTable records to get the value of field which has name equal to visibleColumn.Header.

Categories : Wpf

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

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

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 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

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

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

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

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

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

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

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#

Improve page rendering time having gridview, child gridview and grand child gridview on it
You are creating way too many grids. A grid is an expensive component. You could alter your user interface to allow users to select an Item and bind the inner grid only on selection. This ensures that rather than one grid per row or parent grid, you will have only one child grid displayed at a time.

Categories : C#

Slow get data from data gridview into SQL Server
A fast way to insert many records into an SQL Server's table is to use the SqlBulkCopy class. First you will need a function which will copy the content of your DataGridView into a DataTable. Private Function GetDataTable() As DataTable Dim DataTable1 As New DataTable Dim i1, i2, RowsCount1 As Integer For i1 = 0 To DataGridView1.Columns.Count - 1 DataTable1.Columns.Add(DataGridView1.Columns(i1).Name, DataGridView1.Columns(i1).ValueType) Next If DataGridView1.AllowUserToAddRows = True Then RowsCount1 = DataGridView1.Rows.Count - 1 Else RowsCount1 = DataGridView1.Rows.Count End If For i1 = 0 To RowsCount1 - 1 DataTable1.Rows.Add(DataTable1.NewRow) For i2 = 0 To DataGridView1.Columns.Count - 1 DataTabl

Categories : Vb.Net

Failed to convert property value of type C3P0PooledDataSource to required type javax.sql.DataSource for property dataSource
The class C3P0PooledDataSource does not implement javax.sql.DataSource. It is used for something completely different, JMX notifications. Use ComboPooledDataSource instead.

Categories : Mysql

Getting data from gridView
You could add Name as another datakeyname <asp:GridView ID="GridViewCategory" runat="server" OnSelectedIndexChanged="GridViewCategory_SelectedIndexChanged" OnPageIndexChanging="GridViewCategory_PageIndexChanging" AllowPaging="True" DataKeyNames="Id, Name" CellPadding="4" ForeColor="#333333" GridLines="None" > <Columns> <asp:BoundField DataField="Id" HeaderText="Идент. номер" ItemStyle-Wrap="false" ItemStyle-Width="20%" /> <asp:BoundField DataField="Name" HeaderText="ALl name For" ItemStyle-Wrap="false" ItemStyle-Width="60%" /> <asp:CommandField SelectText="Избери" ShowSelectButton="True" /> </Columns> Then in your code behind: protected void GridViewCategory_Select

Categories : Asp Net

C# Data GridView, large data
Read Efficiently Paging Through Large Amounts of Data for a walkthrough of setting up custom paging with a GridView control. You will need to have a separate query for the total record count, which should be done first. Then you can calculate the number of pages the grid will have in order to build the paging controls. Total record count / records per page = number of pages Note: the records per page may be hard-coded in the GridView markup or you can have a control on your page that allows the user to pick a page size.

Categories : C#

Getting rid of duplicated data in a GridView
Are you sure that you don't have your aggregates backwards in your SQL? I would have expected it to be written more like this: SELECT people.name, Max(comage.age) age, Max(grad.date) date FROM people INNER JOIN comage ON people.term = comage.term INNER JOIN grad ON people.term = grad.term WHERE people.ID = @ID GROUP BY people.name ORDER BY LastName Which would produce a result set like this: name | age | date ------------------ Jeff | 23 | DEC Jake | 25 | SUM

Categories : C#

Data Binding in GridView
You'll need to bind a list, like a List<FavData> or an ObservableCollection<FavData> to the Hub. Right now, you've got a GridView that among many other attributes, includes initialization of the ItemsSource property. This property is used as the source for a list of items. <GridView x:Name="itemGridView" ItemsSource="{Binding Items}" </GridView> The binding is specified as {Binding Items} which means that for whatever object is bound currently to the Hub, grab the List stored on the Items property. As you currently had set a single FavData instance to the Hub via the DataContext property, and it did not have a property called Items, there was nothing to display. So, my suggestion is to create a list of FavData instances and bind that to the Hub instance instea

Categories : C#

Concatenate Gridview Data
If you saying to display in particular format of grid view data then there is no other way than running loop of customer name and finding its occurrence and merging it, rather than you should try to join the data source , so i suggest to show schema of data source so that any one can help

Categories : C#



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