Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 9th, 2007, 10:13 AM
Registered User
 
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Moving rows in Datagrid view control in C#

I'm developing windows Application using C#... The App is basically a search app. when a support user(
assume the support Gal :) ) searches for specific record... the query returns say some 100 rows and i display those data in a DATAGRIDVIEW control...

I need couple of things in this.:
1). In my Windows Form i have two buttons for sorting the Queue say like UP and DOWN arrow.
- The user will select a single row in the Search Results list and then select the “Up” or “Down” navigation buttons to order the jobs
      ---> The “UP” navigation button will update the database to indicate the order this job will be executed (decrement the order by 1)
        ---> The “UP” navigation button will move single jobs up in the queue by 1 row, causing the Search Results to refresh showing the new location of the selected job

and vice - versa on click of the DOWN arrow...((increment the order by 1))

2) when the user click UP arrow she should be able to go directly to the row where the Status is of type Queued and the place the selected row before this (queued ) row..

The columns i have:

JobType Country TimeStarted TimeFinshed Status
CP SA "2007-02-17 "2007-05-07 Success
00:00:00.000" 00:00:00.000"

IP NA "2007-02-17 "2007-02-18 Queued
00:00:00.000" 00:00:00.000"

PP FR "2007-02-16 "2007-02-17 Failed
00:00:00.000" 00:00:00.000"

PG IN "2007-02-17 "2007-02-19 Queued
00:00:00.000" 00:00:00.000"

- The “Up” and “Down” navigation buttons only apply to jobs that are of a status “Queued”

Pls help me out ... I am desperate and my life sucks here....


Code :

Datagrigview :dgrBJSList

I tried to get the index as ...

foreach (DataGridViewRow SelectedRow in dgrBJSList.SelectedRows)
            {
                string val = SelectedRow.Cells[5].Value.ToString();
                if (val == "REQUESTED")
                {
                    int xRow = (int)dgrBJSList.Rows.IndexOf(SelectedRow);

                }
            }









Similar Threads
Thread Thread Starter Forum Replies Last Post
Add Rows to Grid View dpkbahuguna ASP.NET 1.x and 2.0 Application Design 0 March 19th, 2008 04:05 AM
populate details view or list view non empty rows iinfoque ASP.NET 2.0 Basics 0 March 11th, 2007 06:11 AM
Moving rows up and Down in Datagrid Baby_programmer ASP.NET 1.0 and 1.1 Professional 5 August 20th, 2006 04:14 AM
Moving a Dataset in a Datagrid up or down TheRealEclipser ASP.NET 1.0 and 1.1 Professional 1 March 13th, 2006 01:02 AM
HELP - Combine Rows in a View HenryE SQL Server 2000 1 July 22nd, 2004 12:58 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.