w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How does ListFragment restore scroll position after destroyView?
You won't find saving state in ListFragment or ListActivity cause all process of storing position is done in ListView. ListFragment simply make a use of ListView. When you open AbsListView.java you can take a look at two methods. @Override Parcelable onSaveInstanceState() { [...] if (selectedId >= 0) { // Remember the selection ss.viewTop = mSelectedTop; ss.position = getSelectedItemPosition(); ss.firstId = INVALID_POSITION; } and place where these values are restored @Override public void onRestoreInstanceState(Parcelable state) { [...] if (ss.selectedId >= 0) { mNeedSync = true; mPendingSync = ss; mSyncRowId = ss.selectedId; mSyncPosition = ss.position

Categories : Android

Restoring scroll position on a GridView at the right time
You should call RestoreScrollPos only after the grid has finished loading: public MyPageConstructor() { this.InitializeComponent(); this.itemGridView.Loaded += (s,e) => itemGridView_Loaded(s, e); } private void itemGridView_Loaded(object sender, RoutedEventArgs e) { RestoreScrollPos(); } As to where to load the data, you should try in LoadState: protected override void LoadState(Object navigationParameter, Dictionary<String, Object> pageState) { DataContext = LoadModel(); base.LoadState(navigationParameter, pageState); }

Categories : C#

how to maintain scroll position on postback in Gridview / Repeater
You can use below link using jquery http://www.sergeyakopov.com/2010/11/easily-maintaining-scroll-position-in-gridview-using-jquery

Categories : C#

Windows store app, How to get the header value of gridview?
2 options : The MVVM way would be to use an ICommand instead of the event and pass the value as the command parameter. <Button x:Name="HeaderBtn" Command="{Binding HeaderCommand}" CommandParameter="{Binding Title}"> In the event Handler, you should be able to retrieve the data context of the button, and the value of title private void HeaderButton_Click(object sender, RoutedEventArgs e) { var button = (Button)sender; var dataContext = (HeaderClass)button.DataContext; var title = dataContext.Title; //here is your value }

Categories : C#

Windows Store App: Uneven UI with grouped GridView
GridView Grouping can be done using CollectionViewSource. In your Xaml, add a CollectionViewSource in the Resources section of your page. Make sure IsSourceGrouped is set to true: <Page.Resources> <CollectionViewSource x:Name="FruitsCollectionViewSource" IsSourceGrouped="True"/> </Page.Resources> We can set the Source of CollectionViewSource later from codebehind, Then the CollectionViewSource(FruitsCollectionViewSource) should be set as the ItemsSource for your GridView <GridView ItemsSource="{Binding Source={StaticResource FruitsCollectionViewSource}}" x:Name="FruitGridView" Padding="330,20,40,0" SelectionMode="None" IsSwipeEnabled="false" IsItemClickEnabled="True" ItemClick="FruitGridView_ItemClick"&g

Categories : C#

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#

Error on adding image to gridview windows 8 store app
Why do you add the image to the Grid.Items collection when you add it to IncidentPictures collection too? You already bind the GridView's ItemsSource to the collection. Maybe this cause the error ... Remove the IncidentPictureGrid.Items.Add and make sure, that IncidentPictures is an ObservableCollection.

Categories : C#

Getting the position of controls in a windows store app in C#
You can get position of control using transform object. <Button x:Name="btn" Content="Button" Margin="131,339,0,391" /> void BlankPage4_Loaded(object sender, RoutedEventArgs e) { var trans = test.TransformToVisual(null); var point = trans.TransformPoint(new Windows.Foundation.Point()); }

Categories : C#

Windows 8 Store App Live Tile Image Position
Unfortunately I found out that there is no out-of-the-box-solution for my problem. I solved it by creating a BitmapResource out of my image, cropping it programmatically and save it back to my ApplicationFolder, where I can reference the image in my live tile with "ms-appdata:///...."

Categories : Windows

How to animate Button position (Margin) in Windows Store app?
You can handle CompositionTarget.Rendering event although you will have to manage all the positioning mathematics yourself which can be difficult in case of many objects - this is only an example and looks a bit strange but works: public MainPage() { this.InitializeComponent(); CompositionTarget.Rendering += OnCompositionTargetRendering; } private void OnCompositionTargetRendering(object sender, object e) { RenderingEventArgs args = e as RenderingEventArgs; double t = (args.RenderingTime.TotalMilliseconds) % 20; button1.Margin = new Thickness(t); }

Categories : C#

fix scroll position on button click at certain scroll position
I'm not sure if this is exactly what you're looking for, but I made a jsFiddle demonstrating how you can 'lock' (or toggle) document scrolling after the user clicks a link. You may be able to create a solution based on this: var ScrollHandler = (function() { //Assumes jQuery has initialized var hasScrollListener = false; var toggleScrollLock = function() { if(!hasScrollListener) { $('body').css('overflow', 'hidden'); $('.freezeScroll').css('color', '#ff0000'); } else { $('body').css('overflow', ''); $('.freezeScroll').css('color', '#0000ff'); } hasScrollListener = !hasScrollListener; } //Return a public toggle method return { toggleScrollLock: toggleScrollLock }; })

Categories : Javascript

How can I set the scroll position relative to the click event and the initial scroll after resizing the inner div?
I managed to solve it after some headaches: parent.scrollLeft = (clientX + parent.scrollLeft ) * ratio - clientX; parent.scrollTop = (clientY + parent.scrollTop ) * ratio - clientY;

Categories : Javascript

Android ListView resets scroll position after first scroll
I'm not sure but I think when you call removeAllViews for some reason it can't save the previous state. I'm not sure again if it is the best way to solve the problem but what you can do is to save your scroll position before remove it, and after add your views again you can set it. Something like this: int posX = listView.getScrollX(); //remove your view and after: //add your views listView.setScrollX(posX);

Categories : Android

position:fixed floating menu confined to scroll position
I think it will not work without java script (or maybe very tricky css trick?), but if you have the option to use JQuery, the solution is quite simple, just do: $(document).on('scroll', function () { if ($(document).scrollTop() > ($("#container")[0].offsetTop + $("#container").height())) { $("#menu").css({ display: "none", }); } else { $("#menu").css({ display: "block", }); } }); In the condition, it checks if the actual scrolling position is under the beginning of the container. If yes, the css of the #menu is changed to display: none; otherwise to display: block; See Fiddle: http://jsfiddle.net/Fg2MA/3/

Categories : Javascript

How to assign proportional space for gridview columns on window maximize and restore down
Your code is explicitly setting one column to take all remaining space. Instead, you need to set them all to the same value, the ListView width divided by the number of columns: if (double.IsNaN(listView.ActualWidth)) listView.Measure(new Size(Double.PositiveInfinity, Double.PositiveInfinity)); double colWidth = listView.ActualWidth / gridView.Columns.Count; for (int i = 0; i < gridView.Columns.Count; ++i) gridView.Columns[i].Width = colWidth;

Categories : Wpf

Change css position to fixed without resetting scroll position
If the scroll is reset automatically, you could reset it after click event. Get the actual position of the scroll -> change position to fixed and reset scroll with the previous position. Use .scrollTop() method to achieve it --- jquery

Categories : Jquery

Wrong validation position when I try to restore browser
Please add an empty span for your error message right to the input fields. And then use js to add the error to the span. But you have to clear it if it is right. I have also reformatted your HTML a bit, that each form input/label/error message is being wrapped in one div. <form name="contact" method="post" action="save.php" target="_self" id="Form1"> <div id="wb_Text2" style="position:absolute;left:10px;top:15px;width:70px;height:34px;z-index:0;text-align:left;"> <span style="color:#F5FFFA;font-family:Arial;font-size:15px;">Telemóvel</span> <input type="text" id="phone" style="position:absolute;left:82px;top:10px;width:155px;height:28px;line-height:28px;z-index:1;" name="phone" value="" maxlength="8" placeholder=""> <span id="e

Categories : PHP

Restore scrollbar position of QWebView after setHtml()
Perhaps the size of the page changes. Call setScrollBarValue when contentsSizeChanged is emitted by the frame (typically webView->page()->mainFrame()).

Categories : Qt

the simplest way to store/restore queue of downloads
Use the built-in DownloadManager class. The download manager is a system service that handles long-running HTTP downloads. Clients may request that a URI be downloaded to a particular destination file. The download manager will conduct the download in the background, taking care of HTTP interactions and retrying downloads after failures or across connectivity changes and system reboots. Instances of this class should be obtained through getSystemService(String) by passing DOWNLOAD_SERVICE. Apps that request downloads through this API should register a broadcast receiver for ACTION_NOTIFICATION_CLICKED to appropriately handle when the user clicks on a running download in a notification or from the downloads UI. Note that the application must have the INTERNET permission to use this clas

Categories : Java

Restore WebView position to same content on orientation change (Android)
View classes have an onSaveInstanceState() method that returns a Parcelable, and an onRestoreInstanceState(Parcelable state) method to restore the state. If I recall correctly, the saved state includes scroll position. All you need to do is save the Parcelable you get from a call to the WebView's onSaveInstanceState() in your fragment's onSaveInstanceState method: public void onSaveInstanceState(Bundle savedState) { super.onSaveInstanceState(savedState); WebView webView = (WebView) findViewById( ... ); savedState.putParcelable("myKey", webView.onSaveInstanceState()); } Then in your onCreateView method you restore that state, if available: public View onCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { ... if (savedInsta

Categories : Android

Store current SAS title, change it temporarily, and restore it at end of macro
It seems like instead of first setting the title and then trying to create a macro variable from it, you'd be better off first setting a macro variable (or multiple if there are several different titles you'll want to use repeatedly), then using that in the title statement, like this: %let title_text = "This is my pre-macro title"; /* Set title first time. */ title "&title_text"; /* Call macro. */ %xl; /* Restore title. */ title "&title_text";

Categories : Sas

How to achieve SematicZoom like Windows App Store in Windows store app?
You can achieve this by wrapping the GridView with a SemanticZoom object <CollectionViewSource x:Name="Results" Source="{Binding esults}" IsSourceGrouped="true" ItemsPath="Items"/> <SemanticZoom > <SemanticZoom.ZoomedOutView> <GridView ItemsSource="{Binding CollectionGroups, Source={StaticResource Results}}"> <GridView.ItemTemplate> <DataTemplate> <!-- Template for ZoomedOut --> </DataTemplate> </GridView.ItemTemplate> </GridView> </SemanticZoom.ZoomedOutView> <SemanticZoom.ZoomedInView> <GridView x:Name="itemGridView" ItemsSource="{Binding Source={Sta

Categories : C#

Scroll offset of GridView
You can use GridView.getFirstVisiblePosition(). http://developer.android.com/reference/android/widget/AdapterView.html#getFirstVisiblePosition()

Categories : Android

How to restore svn repository after installation of windows & SVN tool
as @zerkms noted, SVN repository is just a bunch of files holding the versionning data! just place your backed up files (from D:svn-reposcode...) anywhere you like (maybe at the same spot) and you can just point your WC to the new location or check-out a new Working-Copy.

Categories : Svn

ASP.NET GridView within Scrollable Div: Scroll to SelectedIndex
Some bit of javascript can help. Have a look at the following post: http://stackoverflow.com/a/4558637/145682 Here is a POC: Markup: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GridViewScrollIndex.Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <style type="text/css"> #form1 { height: 225px; } </style> <script> function focusRow(id, rowIndex) { var tbl = document.getElementById(id); var rows = tbl.childNodes[0].childNodes; rows[rowIndex].childNodes[0].focus(); document.getElementById('console').innerText = rows[rowIndex].chi

Categories : Asp Net

How to get GridView scroll to top using keyboard in Android TV
I have an idea that might work for you. If instead of scrolling the grid view you simply destroy it and recreate it when you want to jump to the top that might work. How ever for the case where you want to allow the user to scroll it requires a different approach. I recommend that you offset the grid view such that its elements are not perfectly aligned with the parent. For example, if you had the bottom visible row only half showing (cut off half way) it indicates to the user that there is more items to scroll down too. The same would apply as you scroll up - the top row would only be half showing (top of the items cut). This is a pattern that I see a lot for TV apps.

Categories : Android

Textview within GridView very difficult to scroll
Not sure, but it's probably because you made one of the inner textviews scrollable, which will mess with the scrolling properties of the parent AdapterView: <TextView android:id="@+id/grid_item_answer" android:layout_alignParentBottom="true" android:layout_width="match_parent" android:layout_height="150dp" android:gravity="center_horizontal" android:layout_centerHorizontal="true" android:focusable="true" //<-- this android:focusableInTouchMode="true" //<--- this android:fadeScrollbars="false" //<-- this android:scrollbars="vertical" //<--- this >

Categories : Android

Restore Windows application crash Debug button
Found in this answer. Go to the Tools | Options | Debugging | Just-In-Time dialog. Then make sure all Native and Managed (if you're debugging a .NET application) are checked. Next time you get a crash, the Visual Studio Just-In-Time debugger will come up. And this restores automatically the Debug button:

Categories : Visual Studio

How to Disable restore box of windows form when it is in maximized condition?
Have a look at this question: How do I remove minimize and maximize from a resizable window in WPF? The first and most upvoted answer doesn't belong to WPF only. So it should also work with a Winforms application.

Categories : C#

Windows Azure Active Directory Backup/Restore
You could consider using some of the Windows Azure Active Directory PowerShell Cmdlets to save your configuration. The various Get- Cmdlets (see http://technet.microsoft.com/en-us/library/jj151815.aspx) should allow you to save all your configuration settings, users, roles, etc.

Categories : Azure

how to set scroll view in customized gridview of 2 columns
Somewhat unclear question but I guess you want this? <FrameLayout> <ScrollView> <GridView> </GridView> </ScrollView> </FrameLayout>

Categories : Android

GridView.setItemChecked(position, value)
I believe the documentation is wrong. Testing on an emulator, the method was not available on API level 8. This applies for all extensions of the AbsListView setItemChecked() method as far as I can tell (ListView etc). I think it's safe to assume it's only available on API level 11+

Categories : Android

Can not scroll and click item on gridview inside scrollview
no need to put gridview inside scrollview and for item click I hope this help you

Categories : Android

How to show application name on first position of GridView
I think the simplest solution is to recreate another List then add the rest of applications. You can do something like this: List<App> apps = new ArrayList<App>(); List<PackageInfo> packs = getPackageManager().getInstalledPackages(0); for(PackageInfo package : packs) { String name = package.packageName; if("com.baqa.quran.tafheemulquran".equals(name)) { // Add other "equals" here App app = new App(); // Create your App […] apps.add(app); packs.remove(package); } } for(PackageInfo package : packs) { App app = new App(); // Create your App […] apps.add(app); }

Categories : Android

Aspx - position of Gridview PagerSettings
The issue is that the pager is rendered as a TABLE inside of the TABLE that the GridView is rendered as, in other words the inner row of the last table row in the grid is what you need to change. Check out this blog entry for a better explanation and code: GridView and Paging Alignment

Categories : Asp Net

About GridView: getView() auto called from first position to last
There have been many people with this problem already asked on SO. I am working with ListView with my custom Adapter too. And I can assure you that, There is absolutely no guarantee on the number of times getView() will be invoked for any given position I my case, the ListView also called all getView() function from the start to the end, then it call it again from 0 to 3 (for on my phone, 4 items are on the screen). Anyway, it's always good to make your getView doing things as fast as possible, because it will also be called when you scroll your GridView, and no one can tell you which position will be given. EDIT: The most important part is the one I put in the box. I have little uses of GridView before, but I suppose its behaviours are mostly the same on ListView, since both of the

Categories : Android

Images in gridview change their position while scrolling
try this class Holder { ImageView imageView; } public View getView(int position, View convertView, ViewGroup parent) { Holder holder; if(holder.imageView==null){ holder=new Holder(); holder.imageView = new ImageView(ctx); holder.imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); holder.imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); holder.imageView.setPadding(8, 8, 8, 8); imageView.setTag(holder); } else { holder= (Holder) imageView.getTag(); } holder.imageView.setBackgroundResource(tmp[position]); holder.imageView.setImageResource(blank); return imageView; }

Categories : Java

How to get Item View by position in GridView (in onCreateView )?
gridView.getCount() is the size of your adapter, so you have 25 items in the adapter gridView.getChildCount() is the size of the children of the grid, so the grid has no children when you call this, so in this time you probably hasn't been draw on screen yet. That's why you get a NPE because you have no child view to get.

Categories : Android

How to get the scroll position of webView
What I did was to create a customized WebView that overrides a onScrollChanged method. The complete code you can see here

Categories : Android

Get scroll position to set variable
Got it! if condition was incorrect, scrolling had to be set to false to allow restart... function doScroll() { $('body').scrollTop($('body').scrollTop() + 20); if($("#pause").offset().top >=100 && $("#pause").offset().top < 150){ clearInterval(t); scrolling = false; return; } } Thanks to zvona

Categories : Javascript



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