Solved

Datagrid modify selected rows

Posted on 2006-06-13
2
232 Views
Last Modified: 2011-09-20
Hey,

I have a datagrid with a context menu. The idea is that the user can select multiple rows on the datagrid, right click and then calls a function that modifies a field for all selected records.

That field is a datetime field in a sql table. I want the user to be able to add or substract minutes to all selected rows. eg. User selects rows 1 to 3, right clicks, chooses "Modify time" and inputs 10 => 10 minutes should be added to the Time filed of rows 1-3 and modify it in the database. If the user inputs -10, 10 minutes should be substracted.
0
Comment
Question by:tsay
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
joachimcarrein earned 250 total points
ID: 16892264
i'll suppose you request your "duration" with an inputbox and you know how to check that value?

after you have the value, lets say variable dDuration
Dim i As Integer
For i = 0 To datagrid.Count - 1
  if datagrid.isselected(i) then
    'Here you know which record it is and you can call your modify functions
  end if
next
0
 
LVL 4

Expert Comment

by:joachimcarrein
ID: 16892279
you can find more info on this here:  
http://aspalliance.com/articleViewer.aspx?aId=141&pId=
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now