Reloading a grid view

I have a gridview and records are filtered based on date range selected. Also have a link on the grid that takes me to another page.
On the next page I have a link to take me back to the initial page and load the grid view with the same records that were there initially
here is code below to populate gridview
private void GridBind(DateTime strDate, DateTime endDate)
try
var sDate = Convert.ToDateTime(strDate).ToString("yyyyMMdd");
var eDate = Convert.ToDateTime(endDate).ToString("yyyyMMdd");
using (var conn = new OracleConnection(ConfigurationManager.ConnectionStrings["DbpoolConnectionString"].ConnectionString))
using (var cmd = new OracleCommand("select * from (select account_number,branch_code_sortcode,presdate,(amount/100) as amount," +
"customer_name,rec_id, " +
"(select count(*) from dctblchequeinfo_fc b where a.account_number = b.account_number) count " +
"from dctblchequeinfo_fc a where presdate between '" + sDate + "' and '" + eDate + "' and beneficiary = 'N') where count >= 3", conn))
conn.Open();
using (var reader = cmd.ExecuteReader())
var dataTable = new DataTable();
dataTable.Load(reader);
grdFC.DataSource = dataTable;
grdFC.DataBind();
catch (Exception ex)
Logger.Error(ex);
and link on 2nd page 
<asp:HyperLink ID="hypBack" runat="server" NavigateUrl="ClearingCheques.aspx"><<< Go Back</asp:HyperLink>

@ajibolao
What's your problem?
By the way, question related to Asp.Net should be posted in
Asp.Net forum.
Thanks for your understanding and effort.
Have  a nice day!
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • FillBy always fills in the same row in data grid view. How to make it fill in a new row for each click of the Fillby Button? VB 2010 EXPRESS?

    Hi there, 
    I am a beginner in Visual Basic Express 2010. I have a Point of Sale program that uses DataGridView to display records from an external microsoft access
    database using the fillby query. 
    It works, but it repopulates the same row each time, but i want to be able to display multiple records at the same time, a new row should be filled for
    each click of the fillby button. 
    also I want to be able to delete any records if the customer suddenly decides to not buy an item after it has already been entered. 
    so actually 2 questions here: 
    1. how to populate a new row for each click of the fillby button 
    2. how to delete records from data grid view after an item has been entered 
    Thanks 
    Vishwas

    Hello,
    The FillBy method loads data according to what the results are from the SELECT statement, so if there is one row then you get one row in the DataGridView, have two rows then two rows show up.
    Some examples
    Form load populates our dataset with all data as it was defined with a plain SELECT statement. Button1 loads via a query I created after the fact to filter on a column, the next button adds a new row to the existing data. When adding a new row it is appended
    to the current data displayed and the primary key is a negative value but the new key is shown after pressing the save button on the BindingNavigator or there are other ways to get the new key by manually adding the row to the backend table bypassing the Adapter.
    The following article with code shows this but does not address adapters.
    Conceptually speaking the code in the second code block shows how to get the new key
    Public Class Form1
    Private Sub StudentsBindingNavigatorSaveItem_Click(
    sender As Object, e As EventArgs) Handles StudentsBindingNavigatorSaveItem.Click
    Me.Validate()
    Me.StudentsBindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.MyDataSet)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'MyDataSet.Students' table. You can move, or remove it, as needed.
    Me.StudentsTableAdapter.Fill(Me.MyDataSet.Students)
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Me.StudentsTableAdapter.FillBy(Me.MyDataSet.Students, ComboBox1.Text)
    End Sub
    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
    Me.MyDataSet.Students.AddStudentsRow("Jane", "Adams", "Female")
    End Sub
    End Class
    Get new key taken from
    this article.
    Public Function AddNewRow(ByVal sender As Customer, ByRef Identfier As Integer) As Boolean
    Dim Success As Boolean = True
    Try
    Using cn As New OleDb.OleDbConnection With {.ConnectionString = Builder.ConnectionString}
    Using cmd As New OleDb.OleDbCommand With {.Connection = cn}
    cmd.CommandText = InsertStatement
    cmd.Parameters.AddWithValue("@CompanyName", sender.CompanyName)
    cmd.Parameters.AddWithValue("@ContactName", sender.ContactName)
    cmd.Parameters.AddWithValue("@ContactTitle", sender.ContactTitle)
    cn.Open()
    cmd.ExecuteNonQuery()
    cmd.CommandText = "Select @@Identity"
    Identfier = CInt(cmd.ExecuteScalar)
    End Using
    End Using
    Catch ex As Exception
    Success = False
    End Try
    Return Success
    End Function
    In closing I have not given you a solution but hopefully given you some stuff/logic to assist with this issue, if not perhaps I missed what you want conceptually speaking.
    Additional resources
    http://msdn.microsoft.com/en-us/library/fxsa23t6.aspx
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • How to get list data and bind to data table or Grid view in share point 2010 using j query

    hi,
    How to bind list data in to data table or  grid view  using Sp Services.
    How to use sp services in share point 2010 lists and document library 

    Hi, You can use List service, SPServices and JQuery to get your requiement done-
    See here for an sample implementation -
    http://sympmarc.com/2013/02/26/spservices-stories-10-jqgrid-implementation-using-spservices-in-sharepoint/
    http://www.codeproject.com/Articles/343934/jqGrid-Implementation-using-SpServices-in-SharePoi
    Mark (creator of SPServices) has some good documentation on how to use SPServices-
    http://spservices.codeplex.com/wikipage?title=%24().SPServices
    SPServices Stories #7 – Example Uses of SPServices, JavaScript and SharePoint
    http://sympmarc.com/2013/02/15/spservices-stories-7-example-uses-of-spservices-javascript-and-sharepoint/
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • Why does iTunes grid view not remember default sort settings?

    Hello,
    I am using iTunes 8.1 and I like to use the Grid view (Artists). Using the Grid view and clicking on an artist to look at the albums, I like to sort the albums within using "Album by Year".
    Once I have made this change, it sticks until I close iTunes, so I can go into any other artist from Grid view and the albums will be listed using "Album by Year" automatically.
    When I restart iTunes and click on an artist in grid view, iTunes has reverted to sorting via the first column, the one with track numbers. I then have to manually click "Album by Year" to get it sorted again.
    I was wondering if anyone else has had this issue and if there is a solution to it? This also happened in iTunes before I upgraded to 8.1.
    Thanks

    Unfortunately, I can't offer any solution because I'm experiencing the same kind of trouble. Please help us! It would be greatly appreciated.
    Cheers,
    -- D

  • Slow-to-load album covers in Grid View

    I've encountered a problem for a while that I thought I might bring up...
    Whenever I start iTunes, it defaults to Grid View, the only view I use when browsing iTunes. Now, I'm unsure if iTunes caches album art or not, but every time I boot it up and scroll down, all of my albums appear artless for half a second before slowly applying the album art. This makes scrolling down incredibly slow and clunky.
    Once I fully scroll down, I can scroll smoothly all I want, but if I close iTunes, everything is clunky again. Any tips? Does iTunes not cache album art?

    iTunes will need to load all of your artwork when using cover flow and grid view. There IS a cache folder in the Album Artwork folder of iTunes, but i don't know how effective that is.
    However, if you are running a version earlier than 9.2, iTunes 9.2 runs cover flow and grid view A LOT faster than previous versions, since what it does is create thumbnail versions of your images for those views only, making those views operate a heck of a lot quicker.
    I know 9.2 still has some bugs and some people may advise against it, but if you really want to see a boost of performance with grid view I'd recommend updating if you haven't already. Besides, for any bugs there, Apple will probably release fixes for them shortly.

  • Help! Where is the button to toggle Grid-View in Dreamweaver CC 2014.1?

    Just downloaded the latest version last night, and now the grid-view button is gone, so if I want to re-size a fluid-element, I can't.
    Help!

    See changes in latest update
    Dreamweaver Help | New features summary
    Nancy O.

  • How can I compare two collections at the same time? (View two grid views)

    I have two collections containing some of the same images. (My Nikon D70 did not put an end-of-file on some images. I recovered them into a different collection.) Now I want to display both collections side-by-side in grid view. I will select those images in the "recovered" collection that correspond to the bad images in the "main" collection, add the ratings etc, and move just these to another collection.
    It is extremely frustrating to have to bounce back and forth between collections, remembering each image one by one and selecting it in the "recovered" collection. (The image names are not preserved in the "recovered" collection -- I have to go by what the image looks like.)
    LightRoom allows me to compare photos in the compare view. I want to compare collections in two grid views.

    CaptureTheLight,
    you have ran into a situation when you have to compare two sets of images and now you're wondering how come Lightroom doesn't have such "obviously necessary" functionality? But you have to admit it, this is not such a common situation in a photographer's workflow recovers broken files and tries to compare them against themselves. I think it's a pretty specific feature you need. Still, Lightroom has enough powerful tools for editing and sorting images.
    For example...
    You could just put them all - "main" and "recovered" - into a single collection or into the Quick Collection. Label the entire "recovered" collection with, say, red and sort by capture time. Now you'll have everything side by side, ordered chronologically. The "recovered" images will stay next to the "main" images since their capture time will be the same, and they will also stand out since they have the red label.
    Make the thumbnails bigger and set up the grid view so it tints the thumbnail cell are tinted with the label color. Now, you can go quickly through them visually checking labeled vs unlabeled.

  • File name not showing in grid view

    I just upgraded to LR 5.4 and I noticed that now when I am in grid view, only the capture date and dimensions show on the image when I run my cursor over it. I used to get a quick pop-up with the file name, capture date & dimensions, so I can quickly see where I am in my numbering system. I have looked at the preferences and also in view, but it is not apparent to me where it went, plus I know I didn't change anything, intentionally.
    BTW, I also upgraded to Mavericks OS on my iMac, but I hope that is not what is wrong. I know Adobe put out a bunch of "patches" for Bridge, etc. but I have already downloaded and updated all that.

    When you are in Library module/Grid mode, the text that appears in the hovering action is controlled by the Info Overlay. The Info Overlay has three states: Off, Info 1 and Info 2.
    Go to View>Loupe Overlay and put a check mark next to the Overlay you wish to be active and your hovering enabled text will change to match that text. 

  • How can I add a new column to Grid view under Tests tab

    I understand in "ORACLE Test manager for web Applications", the Grid view under Tests tab should be customised.
    How can I add a new column to Grid view under Tests tab? Thanks Katherine

    I don't think this is possible.
    Regards,
    Jamie

  • Print Grid View

    I have 300+ movies in iTunes and would like to print a catalog of the artwork/titles exactly how Grid View displays it in iTunes.
    I know I can print an album list using the print menu, but that would take way too much paper.
    I can't seem to find any way to print a grid view. I've even tried to find a scrolling print screen capture utility or a third-pary movie database app that would import my itunes data (and then allow me to print it), but not having any luck.
    Is there really not an easy way in iTunes to print what we see in the Grid View?

    Use the Grab application in your iMac's Utilities folder to take a series of captures as you scroll manually.

  • I am using the latest Safari. When I open a saved web page, the page is replaced by a grid view of 12 sites I visited.  How can I restore the original setting ?

    I am using MacBook Air 13 for more than two years.  I appears some setting in Safari has been changed unwittingly. Now whenever I open a web-page I have previously saved, the "saved as" page disappears and is replaced by a screen showing in grid view the last 12 pages of sites I have visited.  How to restore the setting so that the web page when opened shows the page I have saved.

    From the Safari menu bar, select
              Safari ▹ Preferences... ▹ Extensions
    Turn all extensions OFF and test. If the problem is resolved, turn extensions back ON and then disable them one or a few at a time until you find the culprit.

  • Why are keywords not being shown in the Browser Grid View

    Hi,
    All the tutorials and manuals seem to have screenshots showing the browser grid view images with keywords at the bottom of the image. Now matter what i try i cannot get them to show up. Here are some of the things I've tried/observed.
    - in the split view and viewer views the keywords show up as expected
    - used the "browser metadata overlays" option (bottom right) to switch the browser between "show metadata" and "switch to basic view"
    - used the "browser metadata overlays" edit option to confirm that both basic and standard overlays/views are configured to show keywords (ie. keyword is in the list on the right)
    - i can see labels (red, green etc) in the browser grid view
    - quit, deleted all my library preferences, restarted aperture
    Are you seeing keywords in the browser view? Any ideas what i'm doing wrong?
    Also note I imported my library from iPhoto.
    Cheers
    Oliver

    Hi i dont have primary checked heres what ive done
    Hi thank youve tried editing all the basic and extended metadata options and so far i have managed to get the key words to show up on one photo at a time with a colour label.
    To do this i have to go to the metadata tab on the left add a custom field to the general tab called it keywords to keep things simple lol.
    This is the only way of getting my keyword to appear below the photo
    However when i try and tag all the photos in the project with the same keyword and label it only tags the last one in the project ive held down cmd /option /ctrl nothing / some of these just tag one random picture with the metadata
    i thank you guys in advance for your help
    Craig

  • Rating / Label "Buttons" active, although not shown in Grid View

    While I was investigating the reason for JPEG images being written back with no obvious changes applied to them (see also How to filter on Metadata Status "Has been changed"?) I noticed something I think is a bug:
    Becaus it sometimes happened to me that I unintentially changed the rating for a picture because I wanted to click into the frame of an image to select it as the only image, I have set my Library View Options as follows for Compact Cell Extras (for a better description also see Grid View: Flags, Rating, Color Label read only? / Mark Images Read only?):
    Index Number checked
    Top Label checked with File Name
    Rotation unchecked
    Bottom Label unchecked with Rating and Label
    Now, if I click into the area, where rating or color label would show (if shown), the rating of the images changes. So I am clicking on an option I don't even see ...
    This was one of the reasons, why metadata in pictures sometimes  would get updated without me knowing why. Anybody else who has experienced this behaviour?
    Beat Gossweiler
    Switzerland
    P.S: My workaround now is to have Common Photo Settings shown in the bottom label.

    Yes it's a bug. I see it on Mac platform.

  • Playing a playlist with multiple albums in Grid View in iTunes 8

    Hi All,
    Here is a situation I came across, that was quite unexpected compared to the behaviour in iTunes 7.
    Suppose I have a playlist with multiple artists/albums. I have this playlist in Grid View. I choose this playlist from the left side navigation tree and press the play button. This playlist is set to shuffle by songs. I expect it to play a song and jump to the next song. iTunes 8 would just keep playing the same songs in the first album listed in the Grid View and would not jump to any other.
    http://img152.imageshack.us/img152/4726/itunes20080910191124oh2.jpg
    In this screenshot above, it will keep the songs in "The Very Best Of". If I press Ctrl+L (show now playing) then it would show only the songs in this album. This quite explains why it doesn't play other songs.
    To explain a bit more on what's happening:
    If I go to List View the song now playing does not have the Now Playing icon:
    http://img98.imageshack.us/img98/1113/itunes20080910191500vf3.jpg
    Notice it is playing "Opa Opa" but in the List View, it doesn't show it.
    This is because in Grid View if you play a song from the playlist, it has its own "virtual playlist"
    http://img98.imageshack.us/img98/5269/itunes20080910191525wl1.png
    Notice the now playing icon there.
    Why is this the case?
    I hope you guys understood what I was trying to explain.

    turingtest2: I had already done exactly what you described in the *"Missing Artist or Album not with others by same artist"* section of your article. But what I hadn't done was the advice you gave as the last sentence in this section...*"In addition if you change the Compilation status of tracks they may be temporarily treated as tracks from an Unknown Album, again things should resolve themselves if you close and reopen iTunes".* As soon as I closed and restarted iTunes, the Unknown Album with five tracks disappeared and the tracks were again displayed with the correct album.
    Your article is a great read, even for people who understand iTunes...there is a lot of helpful advice there to have bookmarked just in case any of the other problems you address are ever encountered. Thanks for taking the time to compile it and share it iTunes users.

  • How can I change the highlight color of grid view folders in the dock?

    Using OSX 10.10 Yosemite, the highlight color for a folder in Grid view is barely noticeable.
    Can you spot the highlighted icon below?
    I've grown accustom to clicking the applications folder in the doc then typing a few letters to get me close to the app I want- now it takes an extra few seconds for me to visually find the icon that got highlighted.
    Is there a way to change the highlight color here?

    I would open up the grid spacing slightly so everything does not run together. In System Preferences > General, try setting Highlight color: Red. This won't change the grey selection background around the icon, but it will turn the background behind the icon text to red. That stands out. However, the collateral effect is that text you select in this editor, and other OS X applications, will now have a red background too. Changing colors will require a killall Finder in the Terminal. Actually set mine to #ffff00 which is a vivid yellow, which is more practical when selecting text in a document.

Maybe you are looking for