w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How can I have gridview showing a different value than its data source?
You can create a new column and set the Property "UnboundType" to object. In the "CustomUnboundColumnData" event you can fill this. So you dont have any link to your datasource. Here is small example: http://www.devexpress.com/Support/Center/Example/Details/E3354

Categories : C#

ASP.net Array List as a data source for Gridview
Hiding a column: are you using autogenerate columns? or did you add your own columns to the grid? Change the column header text: open the grid columns editor (the little > icon on the upper right corner when you select the gridview) Add a command column from the grid columns editor (step 2 above) HTH Jafar

Categories : C#

Enable Page Indexing on GridView with List as its Data Source
You can use following code: public class SearchResults { public string fname { get; set; } public string mname { get; set; } public string lname { get; set; } } set your markup like this in .aspx page: <asp:GridView runat="server" ID="Gridview1" AllowPaging="True" OnPageIndexChanging="PageIndexChanging" PageSize="4"> </asp:GridView> Write following code in your code behind (.aspx.cs) : protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { // Get list of search and bind data with Grid this.Search(); } } private void Search() { var searchResults = new List<SearchResults>(); var search = new SearchResults { fname = "John" }; searchResults.Add(search);

Categories : List

Configure JDBC Data Source for use with JNDI and Tomcat 6 in JSF 2 project
Have a look at Apache Tomcat JNDI How-To There you can read that you just need to modify/create projects context.xml in META-INF and web.xml in WEB-INF ... Configure the JNDI DataSource in Tomcat by adding a declaration for your resource to your Context. <Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30" maxWait="10000" username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/javatest"/> Now create a WEB-INF/web.xml for this test application. <resource-ref> <description>DB Connection</description> <res-ref-name>jdbc/TestDB</res-ref-name> <res-type>javax.sql.Data

Categories : Java

Emacs + clojure. Autocompletion data from all source files in project
auto-complete should be able to complete from all open clojure files, but right now I can't say that it's possible to complete from the project & libraries. Potentially this could be done via Semantic (from CEDET), but right now there is no parser for clojure code there. I've started work on Leiningen support in EDE (CEDET's project-related part) - some code exists in CEDET repo, or you can look to my CEDET repo at https://github.com/alexott/cedet/tree/devel (I plan to merge it back to CEDET some time later)

Categories : Emacs

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#

GridView doesn't apply css in Firefox and IE
If you are using Firebug for Firefox, inspect the table and look at the HTML output. you will be able to style it according to that. table tr td{border:1px solid black}

Categories : C#

Custom view with data source. When should the data source be queried for the first time?
I had a hunch, but to get an authoritative answer, I used the debugger. I set a break point in -numberOfSectionsInTableView: and -tableView:numberOfRowsInSection:. They are called from -[UITableView reloadData] of course, but also from -[UITableView layoutSubviews]. In the special case of -[UITableViewController tableView], -[UITableViewController viewWillAppear:] calls -numberOfSectionsInTableView: directly (iOS 6.1 simulator).

Categories : IOS

R: Split-Apply-Combine... Apply Functions via Aggregate to Row-Bound Data Frames Subset by Class
You've tackled this problem in a way that makes it very hard to debug. I'd recommend switching things around so you can more easily check each step. (Using informative variable names also helps!) The code is unlikely to work as is, but it should be much easier to work iteratively, checking that each step has succeeded before continuing to the next. paths <- dir("C:/Data/", pattern = "\.csv$") # Read in CSV files as data frames raw <- lapply(paths, read.csv, str) # Extract needed rows filter_metrics <- c("MaxTemp", "AvgTemp", "MinTemp") filter_years <- 1970:2000 filtered <- lapply(raw, subset, !is.na(Value) & Year %in% filter_years & Element %in% filter_metrics) # Drop any empty data frames rows <- vapply(filtered, nrow, integer(1)) filtered <- filtered[r

Categories : R

How to bind CheckBoxes from GridView to source DataTable?
Here is how you can go about it, first assign an id to your checkboxes cbx.ID = "cbxDoTest. Then add a RowCommand event handler that will be triggered when your Validate tests button is clicked. Here you need to traverse the e.Row.Cells properties, if the cell belonged to a test column then do a search on the checkbox control (Checkbox cbx = e.Row.Cell[i].FindControl("cbxDoTest"); then check if the cbx.Checked is true or false. I wrote the flow and how to do it from my head so double check the method/property names.

Categories : C#

Why does my shared data source become a custom data source when deployed?
Figured it out. I was adding a shared datasource to preexisting reports to cut down on the amount of manual changes when switching servers. However, once a report is deployed, the data source properties in report manager can no longer be changed by visual studio. The solution is to delete the reports from the report server before redeploying them. It'll be forced to get the get whatever is defined in the report definition then.

Categories : Sql Server

how to encrypt the data source password or data source in tomee
The <Resource> in Tomcat has an attribute called factory. Here you specify a datasource factory. For encrypted password you need a custom datasource factory which reads the encrypted password. Here is what you need An encryption/decryption algorithm for password. Custom datasource factory For more details, please check out this very detailed step by step example for achieving the same.

Categories : Java

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#

Why missing in project file cause "The project file is not bound to source control"
This happens because the Solution file has the Source Control Information in it and the .csproj file will just implement what the solution file tells it. <SccProjectName>SAK</SccProjectName> <SccLocalPath>SAK</SccLocalPath> <SccAuxPath>SAK</SccAuxPath> <SccProvider>SAK</SccProvider> The SAK referes to "Should Already Know" as it pulls the information from the solution file. The solution file should contain something similar to what is shown below GlobalSection(TeamFoundationVersionControl) = preSolution SccNumberOfProjects = 4 SccEnterpriseProvider = {3BA58AB2-18FA-4F8D-95D4-32DDF27D184A} SccTeamFoundationServer = http://TFSSERVER:8080/tfs/DPC SccLocalPath0 = . SccProjectUniqueName1 = Project1\Proje

Categories : Visual Studio 2012

TableView not reloading when data is inserted into source from different source
Try this: - (void)reloadDataInTableView:(NSString *)message :(NSString*)sender { NSLog(@"Text: %@ Sender: %@", message, sender); NSMutableDictionary *m = [[NSMutableDictionary alloc] init]; [m setObject:message forKey:@"msg"]; [m setObject:sender forKey:@"sender"]; if (!messages) { messages = [[NSMutableArray alloc] init]; } [messages addObject:m]; [self.tView reloadData]; NSLog(@"Number of rows: %d", [messages count]); }

Categories : IOS

WPF apply a theme to a particular project not the entire app
Create a project theme resource dictionary and put reference to FooTheme.xaml into it. In all your windows of the project, put reference to ProjectTheme.xaml. This way, in order to change the theme of the project, you'll need to modify only one line. Code: FooTheme.xaml (sample theme) <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Style TargetType="Button"> <Setter Property="Background" Value="Blue"/> </Style> </ResourceDictionary> ProjectTheme.xaml (project theme) <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

Categories : Wpf

How to apply both cell color and alternating row color in aspx gridview at a time
I recommend you to use DevExpress css styles (instead of setting up properties of ASPxGridView) like this: .dxgvDataRow:hover { color: gray; } You can also use CssPostfix property of an ASPxGridView to set different styles for the control. For example: <dx:ASPxGridView ID="grid" runat="server" Styles-CssPostfix="MyGrid" ... would use following css: .dxgvDataRow_MyGrid:hover { color: gray; } To observe ASPx css class names just open a browser in development mode and look through the source code, you can find such classes: dxgvDataRowHover, dxgvFocusedRow, dxgvSelectedRow and many others. The advantage of such style customization is that html markup doesn't create style attribute for each of an html element, css editing is easier and faster and there's no need to cus

Categories : C#

What method am I missing? MissingMethodException on project.apply plugin: 'customPlugin'
The full stack trace should tell you where the problem is. You can get it from Gradle's HTML test report, from your IDE, or by reconfiguring test.testLogging. PS: Please don't double-post here and on http://forums.gradle.org.

Categories : Groovy

What to put under Source Control in a Java Project
Source control is/should be used to put the source and resources files in it. You should avoid putting the .class or any project settings file in source control. Class files are generated as per the latest source, you should put the build file in source control to help with that. Any project/environment related settings should not be pushed to source control as each person using that source may have different environment settings. web.xml is a resource file and should be put in source control. All other resources such as config files can also go in your repository.

Categories : Java

Silverlight - Avoid project recompile action to apply layout change
Ok, I created a new project with VS2012 Update 3 and made settings to look like theese: How do you get Visual Studio to recognise XAML changes?. Now everything seems to be working fine.

Categories : Visual Studio

How to enable Source Control in existing iOS project?
I am not sure how to do this from within XCode, but if you are on OSX you can easily initialize git from the command line (within Terminal). From the base directory of the project invoke git init. Once the project is associated with a git repository, XCode should recognize that and you will see the project listed among the repositories in XCode's Organizer (available from the Window -> Organizer menu) To upload the project into github, look at the directions here: https://help.github.com/articles/create-a-repo

Categories : IOS

WPF Binding image source from Project Resources
Make sure your Build Action for image is marked as Resource and then you can simply do this in your XAML - <Image Source="Properties/Resources/a.png"/> Assuming Propetries/Resources is folder structure in your project where your image is present.

Categories : C#

CMake: cannot compile out of source project with subprojects
The line mpicc CMakeFiles/pi_mpireduce.dir/src/mpi_pi_reduce.c.o CMakeFiles/pi_mpireduce.dir/src/dboard.c.o -o . -rdynamic -lmpi tells the linker that the output name of the compilation shall be ., which is not a valid name for an executable or library or anything at all. This may come from you setting a target name from a variable that is empty during configure time or you accidentally wrote a . there.

Categories : C

How to include iText to my project as a source code?
you've downloaded the source code. It's better to download the ZIP file from here: http://sourceforge.net/projects/itext/files/iText/iText5.4.3/ The zip file in this directory contains several jars. Normally you'll only need the itextpdf-5.4.3.jar to start with. The easiest way to build your project from the iText source code (should you wish to do that anyway), is to use the POM file. If you don't know what a POM file is, please search the net for Maven. The POM file allows you to import the project as a Maven Project. This will automatically import all dependencies. (Of course: now I'm assuming that you've installed Maven in Eclipse.) The reason why the code doesn't compile when you download it, is simple: iText has a dependency on BouncyCastle and if you don't add BouncyCastle to you

Categories : Java

Compiling a project with different java source compatibility
The question is fundamentally about how to produce and consume two variations of an artifact that are based off the same Java code. Provided that you really need to produce two Jars that only differ in their target compatibility (which I would first question), one way to achieve this is to use the Java plugin's main source set (and the tasks that come along with it) to produce the first variation, and a new source set to produce the second variation. Additionally, the second variation needs to be published via its own configuration so that depending projects can reference it. This could look as follows: core/build.gradle: apply plugin: "java" sourceCompatibility = 1.4 sourceSets { main1_4 { def main = sourceSets.main java.srcDirs = main.java.srcDirs resource

Categories : Gradle

Tolven source to Eclipse project structure
Note sure of your Eclipse version. In 4.2, Select Window>Open Perspective>Other... and then CVS Repository Exploring. In the "CVS Repositories View", right click and select New>Repository Location.... Connection Type: pserver User: anonymous Host: tolven.cvs.sourceforge.net Repository Path: /cvsroot/tolven Use default port Click on OK. You should see something like this: You're going to want this to be an Eclipse Java Project. So create a Java project with separate source and binary folders. In the "CVS Repositories View", right click on the stuff you want to edit in Eclipse and select Check Out As.... Select ...into an existing project, then Next>. Now select the source folder of the Java project you just created. and Finish. You're probably going to want to move the non-Java files

Categories : Java

Build a 3rd party library from source within an existing Qt project
Yes, you need to create a project file for it. You can find my version below what I used for several projects. zlib.pro QT -= core gui TARGET = zlib TEMPLATE = lib # Use this for static zlib rather than the default dynamic # CONFIG += staticlib include(zlib.pri) zlib.pri HEADERS += $$PWD/crc32.h $$PWD/deflate.h $$PWD/gzguts.h $$PWD/inffast.h $$PWD/inffixed.h $$PWD/inflate.h $$PWD/inftrees.h $$PWD/trees.h $$PWD/zconf.h $$PWD/zlib.h $$PWD/zutil.h SOURCES += $$PWD/adler32.c $$PWD/compress.c $$PWD/crc32.c $$PWD/deflate.c $$PWD/gzclose.c $$PWD/gzlib.c $$PWD/gzread.c $$PWD/gzwrite.c $$PWD/infback.c $$PWD/inffast.c $$PWD/inflate.c $$PWD/inftrees.c $$PWD/trees.c

Categories : C++

Working on 2 features on the fork of an open source project
If your second feature is not related to the first, why is it built on top of the commits of your first one? Are you modifying your local master branch directly instead of creating feature branches? If you're contributing to an open-source project, you'll probably want to make feature branches off of the local master instead of modifying it directly. Then you can use your feature branches to send pull requests against the upstream master. If your feature is merged by the maintainer, then you an fetch the newly updated upstream master to update your local one. In the meantime, if your features really are unrelated, then just keep making branches off of the unmodified version of master, or use upstream/master: git checkout -b feature upstream/master

Categories : GIT

Is there a way to organize the source tree in Eclipse Java project?
If you have lots of files, you should be organizing them into packages (and even separate modules/projects if possible to help keep your code clean). This will require moving them into new directories, but that's part of how Java works, and moving classes between packages is a common task that Eclipse will handle easily; if you drag-and-drop a class from one package to another, Eclipse will update the necessary references in all the open projects in your workspace.

Categories : Java

LLDB: Must I build it from source (XCode project) to use it from the command line?
Maybe I took the scenic route here. % /Applications/Xcode.app/Contents/Developer/usr/bin/lldb (lldb) version LLDB-179.6 (lldb) This is probably useful enough to get work done with. It's kind of unfortunate to see that the Xcode CLT and Xcode itself come with similar tools, it's a waste of disk space. See the sister question here.

Categories : Osx

C# Get image source from project resources creates memory leak
You are using unmanaged resources to create bitmap from your image. GC doesn't takes care of memory allocated to unmanaged resources. You need to dispose of your memory that you are using in that method. After you have converted your image to bitmap you need to release all the unmanaged resources. my memory explodes 100MB EVERY TIME As a general statement if your memory increases by 100MB doesn't means that you have a memory leak. In case of managed resources GC will collect all the memory that is collectible whenever it will feel feasible. Your Problem: As stated in the MSDN You are responsible for calling the GDI DeleteObject method to free the memory used by the GDI bitmap object You need to change your code like this [System.Runtime.InteropServices.DllImport("gdi32.dll"

Categories : C#

Can't compile the project after splitting the source files to cpp and h, getting "undefined refernce to..."
undefined reference is a linker error, you are not passing the objects for the linking process. In the makefile, replace main.o: lines with main.o: main.cpp g++ $(FLAGS) -c main.cpp remove -lncurses from $(FLAGS) and add: link: <all the o files> g++ <all the o files> -lncurses -pthread -o dvoram64 then calling: make link will create the correctly linked executable. Edit: If you define the $(OBJECTS) variable, the link should be: link: $(OBJECTS) g++ $(OBJECTS) -lncurses -pthread -o dvoram64

Categories : C++

Integrate RestKit pod or source into project that has another framework with AFNetworking baked in
The typical method in the ObjC realm is to distribute your framework using http://cocoapods.org to manage the dependency chain for you (and eliminate potential duplication of something like AFNetworking). Here's a nice read: http://blog.chariotsolutions.com/2012/07/using-cocoapods-to-manage-private.html

Categories : IOS

Is there a way to add source files to visual studio project from command-line?
You could try to modify your .vcxproj file to include any .h and .cpp file in your project folder or folders below. In case of a c++ VS project you can try to alter your .vcxproj file like this: <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <!-- rest of project file untouched --> <!-- start of modified part --> <ItemGroup> <ClInclude Include="***.h" /> </ItemGroup> <ItemGroup> <ClCompile Include="***.cpp" /> </ItemGroup> <!-- end of modified part --> <Import Project="$(VCTargetsPath)Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> &l

Categories : Windows

git:How can I apply commits from old version on a new version of source-code
git cherry-pick <commit> will apply commit to the current repository. Use git stash before this commang and git stash pop after this command, if you have any unstaged changes.

Categories : GIT

"new project wizard" source code in eclipse to be implemented as a part of plugin
This code is available at org.eclipse.ui.workbench. Class is NewWizard.java. If you want your contribution to come in the New Wizard UI.You should implement org.eclipse.ui.newWizard extension point. cheers, Saurav

Categories : Eclipse

How to compile and link additional source code without including it explicitly into the project?
You can solve this problem by adding a file to your project that contains something like the following: #include "generatedFile1.c" #include "genreatedFile2.c" And so on. Then, you just need to make this file (or build phase) depend on (or run after) the source-code generating step. I'm not very familiar with Xcode, so I don't know specifically how you would accomplish that; hopefully someone with more specific experience can point you in the right direction on that front. Edit: I made it work with a simple project here. Example: main.m: #import <Foundation/Foundation.h> #import "generatedFile.m" int main(int argc, const char * argv[]) { @autoreleasepool { // insert code here... NSLog(@"%@", string); } return 0; } script.sh: #!/bin/sh ech

Categories : Xcode

Use requirejs to build project to single file and then optimize it (creating source map)
It seems that i have misunderstood what requirejs does when it optimizes and creates source maps. It turns out requirejs creates a map and source file for every single JS file in your project as well as a source map for the optimized JS file (typically called main.js). If you're only after a source map for the main.js file then you can delete all the others. Hope this helps somebody else!

Categories : Javascript

ERROR: Android Source Generator: [project] AndroidManifest.xml file not found
Go to the directory where you have installed Android SDK. There, go to tools directory. Note down the path of tools directory. Open command prompt/terminal, and cd to tools directory: cd <tools directory path> Run command: android update project -p <path to project directory> -n <name of project> -t android-15 To create a new project: android create project -p <path to project directory> -n <name of project> -k <package name> -a <hello world activity name> -t <android version like: android-15>

Categories : Android

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