473,757 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Binding manager to retrieve several clicked rows

VMI
I'm using Binding Manager to retrieve the current table row that the user
clicked on (one highlighted row). But if I want to retrieve all the
highlighted rows, how can I do it?
This is the code to retrieve one row:
DataRowView rowViewAudit = (DataRowView)
((CurrencyManag er)BindingConte xt[_table_auditAdd ress]).Current;

Now I want to modify this line so it retrieves all the highlighted rows. Is
it possible?

Thanks.
Nov 16 '05 #1
3 1998
I might be wrong but I don't believe there's support for that. It wouldn't be
hard to just use a foreach selected item and pull directly from table.

"VMI" wrote:
I'm using Binding Manager to retrieve the current table row that the user
clicked on (one highlighted row). But if I want to retrieve all the
highlighted rows, how can I do it?
This is the code to retrieve one row:
DataRowView rowViewAudit = (DataRowView)
((CurrencyManag er)BindingConte xt[_table_auditAdd ress]).Current;

Now I want to modify this line so it retrieves all the highlighted rows. Is
it possible?

Thanks.

Nov 16 '05 #2
VMI
Thanks for the post.
How can I use Binding Manager to go through the grid in order to find the
highlighted rows?
"Alex K" <Al***@discussi ons.microsoft.c om> wrote in message
news:41******** *************** ***********@mic rosoft.com...
I might be wrong but I don't believe there's support for that. It wouldn't be hard to just use a foreach selected item and pull directly from table.

"VMI" wrote:
I'm using Binding Manager to retrieve the current table row that the user clicked on (one highlighted row). But if I want to retrieve all the
highlighted rows, how can I do it?
This is the code to retrieve one row:
DataRowView rowViewAudit = (DataRowView)
((CurrencyManag er)BindingConte xt[_table_auditAdd ress]).Current;

Now I want to modify this line so it retrieves all the highlighted rows. Is it possible?

Thanks.

Nov 16 '05 #3
Like this:

public ArrayList GetSelectedRows (DataGrid dg)
{
ArrayList al = new ArrayList();
CurrencyManager cm =
(CurrencyManage r)this.BindingC ontext[dg.DataSource, dg.DataMember];
DataView dv = (DataView)cm.Li st;

for(int i = 0; i < dv.Count; ++i)
{
if(dg.IsSelecte d(i))
al.Add(i);
}
return al;
}

"VMI" wrote:
Thanks for the post.
How can I use Binding Manager to go through the grid in order to find the
highlighted rows?
"Alex K" <Al***@discussi ons.microsoft.c om> wrote in message
news:41******** *************** ***********@mic rosoft.com...
I might be wrong but I don't believe there's support for that. It wouldn't

be
hard to just use a foreach selected item and pull directly from table.

"VMI" wrote:
I'm using Binding Manager to retrieve the current table row that the user clicked on (one highlighted row). But if I want to retrieve all the
highlighted rows, how can I do it?
This is the code to retrieve one row:
DataRowView rowViewAudit = (DataRowView)
((CurrencyManag er)BindingConte xt[_table_auditAdd ress]).Current;

Now I want to modify this line so it retrieves all the highlighted rows. Is it possible?

Thanks.


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2814
by: Tomek Kmiecik | last post by:
Hello! I'm writing simple database application. One table in the database stores some information about keywords (among other, keyword name, id number and description). Description is stored in rtf format. Following code is responsible for data binding (lstKeywords is ListBox,rtbDescription is RichTextBox): lstKeywords.DataSource = manager.KeywordsDataView;
2
1798
by: VMI | last post by:
I'm currently using Binding manager to get the current datagrid row the user clicked on: DataRowView rowViewAudit = (DataRowView) ((CurrencyManager)BindingContext).Current; But, instead of retrieving the current row, I want to retrieve row 6. How can I modify the above code so that rowViewAudit holds the data from row 6 of the grid?
0
3504
by: Dave | last post by:
Tried posting in the Winform Forum without much luck, so posting here... After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is after the newly added row without getting bizarre results. I have added the full code for the test below. Create a project drop in the code and run. There is nothing crazy about the code. I used the designer to add the dataset and to do the...
0
2833
by: Jim French | last post by:
I have a page that takes a comma delimited string and needs to bind to a Repeater control. The string is split into an Array, and each value is put into a DataBase query via a For Each loop. The purpose is to retrieve address information for the user. Sometimes, the address_fk field in the people table is null, so there will be no linking address information. In this case, the section to be displayed asks if the user would like to create...
1
6428
by: ratnakarp | last post by:
Hi, I have a search text box. The user enters the value in the text box and click on enter button. In code behind on button click i'm writing the code to get the values from the database and binding it to a repeater control. This repeater control has multiple text boxes and buttons. Can you please tell me how can i do paging in this case ? I'm posting my code below. The problem is that if i click on "AdjustThisAd" button, it opens...
2
3626
by: Andrew Robinson | last post by:
Is there any way to accomplish two way data binding in a Details View with a DataSet or DataTable as the DataSource. All I want is to get an updated DataSet or DataTable back from the DetailsView and then handle my updating manually. -Andrew
3
4586
by: amber | last post by:
Hello, I have 6 comboboxes, that I thought I could bind to the same datasource, and have them display different 'selectedvalue's', but apparently I can't... My code is as follows: dim drv as datarowview = me.listbox1.selecteditem dim dtbDL as datatable = _dataset1.Tables(0) dim dtvDL as new dataview(dtbDL) dtvDL.RowFilter = "STR_ONE" = 'Matching Text'"
8
11516
by: moondaddy | last post by:
I'm posting code for a user control ( FunctionConnectorSelector) below which has 3 content controls in it. each content control uses a style from a resource dictionary merged into the app.xaml file. each control has a border with another style, and each border has a unique path inside of it. I need to dynamically add these content controls using c# at runtime and am having trouble referencing the styles and adding the path into the...
6
4568
by: =?Utf-8?B?QnJhc3NpY2FOaWdyYQ==?= | last post by:
Greetings, I have a web application that prints a form using PrintDocument on the server. Currently it is set up to print to the default printer (on the server). My users would like to be able to select the printer (there are several on the network that the server can use). How can I bring up a print dialog box in the client browser that offers the
0
9487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9297
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10069
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9904
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8736
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6556
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5324
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.