473,404 Members | 2,137 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Selecting full row of a DataGrid

Hello All,

I am new to CSharp. Somebody please tell me how to select the entire row in
a data grid on a mouse click event on any of the cell.

Thanx in advance
Dhannu
Nov 16 '05 #1
3 2599
Dhanraj,

A datagrid (winform) exist from a showing control of the data an the data in
a underlying datasource.

When you want to get all data, you have to get that from that datasource.

This is a short answer because a lot depends what is that underlying
datasource.

I hope this helps anyway

Cor
Nov 16 '05 #2
Hi Dhanraj,

Look for DataDrid's members:
- method Select(int rowIndex)
- property CurrentRowIndex

But i'm not so sure about Click event...

HTH
Marcin
Hello All,

I am new to CSharp. Somebody please tell me how to select the entire row in
a data grid on a mouse click event on any of the cell.

Thanx in advance
Dhannu

Nov 16 '05 #3

Dhanraj K wrote:
Hello All,

I am new to CSharp. Somebody please tell me how to select the entire row in a data grid on a mouse click event on any of the cell.

Thanx in advance
Dhannu


On the mouse up event you can do try this:

DataGrid.HitTestInfo htiHitTest = yourDataGrid.HitTest(e.X, e.Y);
if (htiHitTest.Type == DataGrid.HitTestType.Cell)
{
yourDataGrid.Select(yourDataGrid.CurrentRowIndex);
}

Replace [yourDataGrid] with the name of your datagrid.

Nov 16 '05 #4

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

Similar topics

2
by: Michael Cairns | last post by:
Im trying to work out how to select a row and change the appearance of the selected row i a datagrid. I might also try to show the details of a selected row on a panel in the page. Is this...
6
by: aaa | last post by:
Hi I am trying to create a read-only DataGrid that would always have current row selected. Currently, I am using method: public void SelectDataGridRow(DataGrid dg) { if (dg.CurrentRowIndex >...
1
by: orekinbck | last post by:
Hi There I have a datagrid whose main purpose in life is to provide a nice way for users to make a single choice from a list. The grid is read only, single row select and has its data source as...
6
by: aaj | last post by:
Hi all I use a data adapter to read numerous tables in to a dataset. The dataset holds tables which in turn holds full details of the records i.e. keys, extra colums etc.. In some cases I...
1
by: Jay | last post by:
Hi All, My users are complaining about the page refreshing when they are selecting multiple rows in a datagrid. Has anyone tried to manage this using javascript? I tried smartnavigation but that...
1
by: Bob Loveshade | last post by:
I am looking for an example that shows how to select and highlight multiple rows in a DataGrid. My DataGrid is part of a Web User Control which is contained in an ASPX page. I haven't been...
14
by: Sueffel | last post by:
Okay, I have the following scenerio: Protected Sub DelRows() Dim rw As DataRow Dim rrw As DataRow Dim DT as DataTable Dim rws() as DataRow For each rw in ds.Tables("Table1").Rows rws =...
2
by: Tymbow | last post by:
I'm building a web application that is analogous to the Windows XP file explorer in function. The left column contains a TreeView, and the right column a DataGrid populated by selecting TreeView...
0
by: Satiz | last post by:
Hi All, I've a TreeView(IE Webcontrol) and a DataGrid in my VS.Net 2003 ASP.Net web form. My problem : If i select a particular node(it may be parent, child or leaf), then the corresponding...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.