w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
The BindingList Datasource of a Combobox refreshes correctly but the Combobox displays items in the wrong order
I think you have two problems here. First, if you want to retain the order of the items you should use an OrderedDictionary instead of a regular one. A normal collection will not retain the order of the items when you use Remove method. You can see more info about this related to List here. You could use such dictionary like this: DropDownDict = new OrderedDictionary(); // Add method will work as expected (as you have it now) // Below you have to cast it before using Select DropDownCollection = new BindingList<KeyValuePair<string, string>>(DropDownDict.Cast<DictionaryEntry>().Select(kvp => new KeyValuePair<string, string>(kvp.Key.ToString(), kvp.Value.ToString())).ToList()); The second problem could be that you change the display name (FrontEndName) of al

Categories : C#

WinRT GridView with custom visual styles and add button
Try ItemContainerStyleSelector.

Categories : Xaml

Exposing commands for MVVM user control inside GridView in WinRT
There are two methods for doing this. first one that you can use is - bind your button to a command that is defined- in your parent viewmodel where you can do your work. second one is - you can use mvvm messenger class. in which you have to send message from your button click eventhandler to your viewmodel. when you received this message add some eventhandler to it and perform your work there.

Categories : Xaml

WP7.8: Bound items in scrollbox updated with wrong data
The issue was caused by the ListBox. Elements that are scroll out of view are recycled and appended on the other side. In the code above, a asynchronous operation did not check if the result was still valid, causing wrong display data.

Categories : C#

Drag and Drop Items in desired position Listview WinRT
This should help: XAML ListView and GridView reorder and drag and drop sample (Windows 8.1) http://code.msdn.microsoft.com/windowsapps/XAML-ListView-and-GridView-6bd77f71

Categories : Xaml

displays search items even if there is !=
The variable SourceTextBox will never be null since the control is always rendered and submitted during posts. You need to check the text of the TextBox instead of the TextBox object to determine if any text has been entered. if (!string.IsNullOrEmpty(SourceTextBox.Text)) { /* do stuff */ }

Categories : C#

Using Javascript to load .tpl displays it wrong
smarty is a server-side templating engine for PHP. You can either use AJAX to call the file and let php/smarty handle the conversion to html or make a copy of the file and convert it to javascript so it works withing the browser.

Categories : Javascript

NSDate dateWithTimeIntervalSince1970 displays wrong timestamp to console
The date is correct. When printing to the console the description of the date is used and that uses your system locale so it applies your time zone to the date before printing. When you want to display the time you need to use a date formatter to convert the date into a string. The important part is setting the locale / time zone that the formatter uses. Take a read of this and this.

Categories : Objective C

ComboBox displays repeated Items in Windows 8 Surface
Combo box uses CarouselPanel as ItemsPanel, you need to change to StackPanel, then your problem will be solved. Here's detailed blog regarding that. I hope it might help you. Windows 8′s combobox and the carouselpanel winRT ComoBox: suggestions to replace it with standard dropdown behavior?

Categories : C#

Game Center Leaderboard (Sandbox) displays wrong score
This is how Game Center works. The scores posted to Game Center appear on a leader-board with a delay. This happens on both sandbox and production servers. So don't worry about it, just wait an hour or two and check again. But remember, when you retrieve the leader-board score for your player with loadScoresWithCompletionHandler: method you might also get outdated results.

Categories : Iphone

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#

Android app installer displays wrong information about required disk space
I'm not sure if this will work: Try restarting your device and then install the app. i was encountering the same problem which got solved by doing the above.

Categories : Android

I have a gridview with a paging event. Everytime I hit a new page it makes me reload the file from the uploadfile control then it displays new page
We generally use a GridView Control to Display Data and also Perform Paging, Sorting, Editing, Deleting records. In each of these we have postback on the page. To avoid Postback during sorting and Paging, the following code can be used inside the GridView Control. If you have created a GridView and Bind the GridView using data source control, you can avoid postback during sorting and paging by setting EnableSortingAndPagingCallbacks' property of the GridView to True. Note : when you use the 'EnableSortingAndPagingCallbacks' property to true for avoid Postback, you cannot use Template Fields in the GridView. Example : <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"AllowSorting = "true" DataSourceID="SqlDataSource1" EnableSortingAndPagingCallbacks = "true">

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#

why dont show me the data ? WINRT
Okay, so what's happening is your GridView is getting the ListaPersonasAgrupada, and then you are changing it, but your GridView doesn't know that it was changed. You need to have your ViewModel tell your GridView that ListaPersonasAgrupada has changed. You can do this with INotifyPropertyChanged. Or, if you're using MvvmLight, you can use RaisePropertyChanged. The other option is to re-set the ItemsSource of the GridView, but that will break the binding.

Categories : C#

asp:GridView EmptyData row has wrong colspan
Sounds like you need an EmptyDataTemplate: <asp:GridView ... <EmptyDataTemplate> render any markup </EmptyDataTemplate> </asp:GridView> Replace render any markup wity any w3c compatible markup.

Categories : C#

Devexpress GridView.PageIndex value is wrong
This is how I fixed the problem, but still don't know why grid.PageIndex contained random values in the code above. private void SetGridDataSource() { grid.DataSource = GetListOfSomeType(); grid.DataBind(); grid.PageIndexChanged += new EventHandler(grid_PageIndexChanged); } void grid_PageIndexChanged(object sender, EventArgs e) { grid.Settings.ShowFooter = (grid.PageIndex == grid.PageCount - 1); }

Categories : Asp Net

How to get all the items of a dropdown list to gridview?
You need a loop: DataTable dt = new DataTable(); dt.Columns.Add(new DataColumn("Country", typeof(string))); foreach(ListItem item in DDLCountry.Items) { DataRow dr = dt.NewRow(); dr.SetField("Country",item .Text); dt.Rows.Add(dr); } Grd1.DataSource = dt; Grd1.DataBind(); or the minimized version: DataTable dt = new DataTable(); dt.Columns.Add("Country"); // string is default foreach (string country in DDLCountry.Items.Cast<ListItem>().Select(i => i.Text)) dt.Rows.Add(country);

Categories : Asp Net

Wrong number of the element in Adapter at GridView
You were not setting the TextView properly when convertView was not null. Try this: if (convertView == null) { gridView = inflater.inflate(R.layout.grid_element, null); } else { gridView = convertView; } ImageView logo = (ImageView) gridView.findViewById(R.id.grid_logo); TextView tv = (TextView) gridView.findViewById(R.id.grid_textView1); tv.setText(level + position);

Categories : Java

ListBox displays "System.Windows.Forms.ListBox.Items.Count..."
To write the items, change the line that does the write to: rollLog.WriteLine(lstBoxOut.items[count]); To read it back in: private void btnReadFile(object sender, EventArgs e) { lstBoxOut.Items.Clear(); foreach (string line in File.ReadLines("Roll Results.txt")) { lstBoxOut.Items.Add(line); } } The reason you're getting that output "System.Windows.Forms.ListBox...." is because the statement rollLog.WriteLine(lstBoxOut) is equivalent to rollLog.WriteLine(lstBoxOut.ToString()). The ToString() method returns A string that states the control type, the count of items in the ListBox control, and the Text property of the first item in the ListBox, if the count is not 0.

Categories : C#

Editable list of items GridView or DataGrid
Both the DataGrid and GridView controls are derived from the WebControl class. Although it has a similar object model to that of the DataGrid control, the GridView control also has a number of new features and advantages over the DataGrid control, which include: Richer design-time capabilities. Improved data source binding capabilities. Automatic handling of sorting, paging, updates, and deletes. Additional column types and design-time column operations. A Customized pager user interface (UI) with the PagerTemplate property. Differences between the GridView control and the DataGrid control include: Different custom-paging support. Different event models. Try this link - http://msdn.microsoft.com/en-us/library/05yye6k9(v=vs.100).aspx

Categories : C#

How to change items color in gridview in android
In setOnItemClickListener() before starting the activity change the color of the currently clicked letter. When you'll return, the text should be pre-colored already. Something like this: gridView.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View v, int position, long id) { TextView currentLetter = (TextView) v.findViewById(R.id.grid_item_label); currentLetter.setTextColor(Color.GREEN); // start Activity2 here } } As a side note, provide implementations for the getItem() and getItemId() methods, otherwise you may get strange behaviours. @Override public Object getItem(int position) { return mobileValues[position]; //return the element from array at specified position } @Override publi

Categories : Android

when gridview have lots of items ,"out of memory" issue
Maybe you're storing the blob as full size? If so, there's no need to do that as you're wasting too much space and you're having these memory issues. The users is not going to see the big image anyway, so redo your image storing in order to store the scaled down images as blobs. You're getting these OOE because you're loading the full blob byte array - and the way it is now, you can't make use of the article from developer article. Also, don't load the images in that Stock object as you're going to hold them unnecessarily. Rather than that, use a bitmap loader mechanism that keeps the images in a LRUCache and if not found in there, it loads them from database. In your GridView adapter getView method request to load that image. If found in LRUCache, get it from there, if not start an Asyn

Categories : Java

Wrong linkbutton command argument after sorting gridview
Here was the issue: When the LinkButton is clicked, the first thing that happens is the page reloads. However, Response.Redirect(Request.RawUrl) doesn’t preserve the ViewState, so the sort order is lost. Therefore, the GridView is repopulated with unsorted data. Then, the LinkButton onClick event function is called. The Object passed in is the LinkButton from the correct row number, but since the sort order of the table had changed (back to its unsorted state), the LinkButton in that row was no longer the LinkButton the user had clicked. Therefore, the command argument was wrong. To fix the issue: I changed all the ViewState[string] to Session[string] (so that the sort direction is preserved when the page reloads), and added the following code in the Page_Load function, before the G

Categories : Asp Net

WinRT - Windows Store - WinRT Originate Error - How do decipher such an error?
As Raman said - it's good to look up the hex values shown. The first one is the memory location which won't tell you much without the symbols/source, which in this case is reported directly by Windows. Perhaps the public symbols can shed some more light on where the error came from, but the error code lookups are more helpful. If you Bing for 0x80070057 you will find an MSDN article on Common HRESULT Values which lists E_INVALIDARG : One or more arguments are not valid : 0x80070057 It doesn't give you all the details of course, so you're off to theorize. Perhaps you can only call args->GetCurrentPoint(nullptr) once and you should store/reuse the value? Maybe gesture recognizer is not configured correctly? Maybe the app window is not visible at the time the exception is thrown or t

Categories : Visual C++

Android GridView not firing onLongItemTouchListener for items not visible
This is how I did it, it is working for me: package com.test.progress; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Picture; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.View; import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ImageView; public class MainActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final WebView mWeb = (WebView) findViewById(R.id.webView1); // final WebView mWeb = new WebView(this); final ImageView imgView = (ImageView) findViewById(R.id.imageView1); mWeb.setInitialScale(100); mWeb.

Categories : Android

using view property animator to move items in gridview
you must first define gridview location by getLocationOnScreen method and subtract it from each item like the following code int gridLoc[] = new int[2]; myGrid.getLocationOnScreen(gridLoc); . . . item1View.animate().x(originalPos1[0]-gridLoc[0]).y(originalPos1[1]-gridLoc[1]).... . . . item2View.animate().x(originalPos2[0]-gridLoc[0]).y(originalPos2[1]-gridLoc[1])....

Categories : Android

Iterating selected items in Windows App Store Gridview
Sure, I know what you mean. Too bad this isn't automagic, but it isn't. The solution involves a simple custom GridView that inherits from GridView. Nothing too crazy, that is, if you let it sink in. Here's the code, I just tested it: Here's your XAML: <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> <Grid.ColumnDefinitions > <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <local:MyGridView ItemsSource="{Binding Items}" SelectionMode="Multiple" BindableSelectedItems="{Binding Selected}" /> <local:MyGridView Grid.Column="1" ItemsSource="{Binding Selected}" /> </Grid> Here's your view model (super-simplified): public class ViewModel { Obser

Categories : C#

How to Display Gridview items with variable width in Window 8?
Check Windows 8 GridView and Variable-Sized Items and Different Sized Tile Items in WinRT GridView and also check Variable Sized Grid Template Hope this help

Categories : C#

How do I hide the mouse over effect and make it so items are not clickable in a Gridview?
Take a look at this Link in MSDN Removing Hover and Selection in Listview I am still looking for the manuall style edit of list view. if this satisfies your answer then please reply. Else i am looking for it :) try visual State Manager for both: Grid and List EDIT AND THIS CODE WORKED PROPERLY. I AM PASTING THE ENTIRE XAML <Page x:Class="ListViewSimple.ScenarioOutput1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Page.Resources> <Style x:Key="GridViewItemStyle1"

Categories : Xaml

Word Search Game: How to Select Multiple Items in a GridView By Dragging? (Android)
I'm late to this question but coming across a similar problem recently, I decided to create my own custom board view library to address this problem. It adds more flexibility to what you can do and it leads to a more straightforward implementation. Here are some snippets of code showing how it works. First, it is easy to draw the board grid on a custom view's onDraw() method: @Override protected void onDraw(Canvas canvas) { for (int i = 0; i <= numRows; i++) { //For custom grid sizes, y can't be equal the board size or the line drawn won't show int y = Math.min(boardHeight - 1, i * tileSize); canvas.drawLine(0, y, boardWidth, y, boardPaint); } for (int i = 0; i <= numCols; i++) { //For custom grid sizes, x can't be equal the board size o

Categories : Android

What is the appropriate Python data structure to hold its items and a combined list of its items?
I would go for @joel-cornett comment, i.e. consistency in the type of data stored. MATERIALS = [ ['AR'], ['ARU'], ['ARC'], ['CON'], ['CSR'], ['MCR'], ['USF'], ['AR', 'ARU', 'ARC', 'MCR', 'CSR'], ['AR', 'ARU', 'ARC', 'MCR'], ['AR', 'ARU', 'ARC'], ] If this doesn't suit you, then have two lists. And if you know in advance your models, you would preferably use variable than string: AR = 'AR' ARU = 'ARU' ARC = 'ARC' CON = 'CON' CSR = 'CSR' MCR = 'MCR' USF = 'USF' MATERIALS_SIMPLE = [ AR, ARU, ARC, CON, CSR, MCR, USF, ] MATERIALS = [ [AR, ARU, ARC, MCR, CSR], [AR, ARU, ARC, MCR], [AR, ARU, ARC], ] As long as you are not limited in terms of performance, I would tell you not to bother optimizing memory storage

Categories : Python

Gridview using model binding not showing newly added items made by a Formview on the same page
GridView stores last select data in viewstate and does not update it after postback. So if you want to see updated result, right after insert, you need to rebind grid or disable viewstate for it

Categories : C#

Nested ListView only displays first selected data
The reason could be: The ListForumSubjectByCategoryID only returns one record Something weird is going on with the inner ListView Everything is ok except the browser for some reason is not showing all the data Based on the code you have provided (which seems sane, and a quick test of my own shows that it should work), the problem is likely the third option. Can you check by viewing the source of the rendered page to see it the content is there? If so, you need to investigate your CSS to figure out why the browser is only showing the first line.

Categories : Asp Net

C TCP Echo Server - Data displays only on close()
Examples for python send are of the following variety: def mysend(self, msg): totalsent = 0 while totalsent < MSGLEN: sent = self.sock.send(msg[totalsent:]) if sent == 0: raise RuntimeError("socket connection broken") totalsent = totalsent + sent The reason for that is the data may not be sent until the socket is closed or a newline is encountered. See Python Socket Programming HOW-TO for more information

Categories : Python

SlickGrid in Bootstrap modal displays data only first two columns
Make sure you're calling the .resizeCanvas() method on the grid after the modal has been shown and all the CSS transitions have completed. Lets say your Slick.Grid instance that lives inside the modal is named modalGrid: $('#modal').on('shown', modalGrid.resizeCanvas)

Categories : Javascript

Lithium content negotiation displays all data - how to filter it out?
Specifying fields explicitly has several advantages: you don't get data that you don't need, so it can be potentially faster you can't leak the data by accident if you forget to unset it as you specify which fields you need, you'll get an early warning if the JSON format would change It's a similar principle as not doing SELECT * FROM in SQL.

Categories : PHP

UITableView data displays multiple times when scrolling
You are creating a UILabel instance for every time a cell gets loaded/reloaded into view. This is not how it's done. Instead - add the UILabel as a property (probably an IBOutlet) in a UITableView subclass and alter it in cellForRowAtIndexPath:. So you would have a new class, inheriting from UITableViewCell - let's call it MyCustomCell. In MyCustomCell.h: @interface MyCustomCell : UITableViewCell @property (weak, nonatomic) IBOutlet UILabel *nameLabel; @end MyCustomCell.xib will define the UILabel position and configuration and of course needs to be associated with the nameLabel property. In cellForRowAtIndexPath, rather than instantiating a new UILabel, you would just refer to cell.nameLabel and change the text. Be sure to define a resuseIdentifier for the cell class in interface

Categories : Iphone

Flex - Call JavaScript Function And Open a Popup Window that Displays Data
I figured this out and thought I would share it for anyone else experiencing this problem: In my Flex Code: if (ExternalInterface.available) { try { ExternalInterface.call("onPrintRequest", dataToPass); } catch (error:SecurityError) { Alert.show("Printing Security Error"); } catch (error:Error) { Alert.show("Printing Error"); } } else { Alert.show("Printing currently unavailable"); } In my index.template.html I added this JS method: <script type="text/javascript"> function onPrintRequest(val

Categories : Javascript



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