473,467 Members | 1,351 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Urgent!! Data Grids

Hi,
I have a question regarding data grids
My application requires me to use a grid for displaying data, however
I would not be using a database for procuring the data, instead I
would be exposing interfaces for other methods to pass me the data
that needs to be displayed. In such a case is the data grid the best
control to use in .NET?
Also if I am using a data grid, how can I obtain the value in the
current cell of the data grid?(where the user has clicked within the
data grid)
Thanks,
Ananth
Nov 16 '05 #1
1 1475
Hi there -

you can use whatever you want for a datasource, as long as it implements
either of IList or IListSource interface.
About the current cell - you can use either the CurrentCellChanged event or
the MouseDown Event of the grid.
There's a class called TestHitInfo with which you can check which is the
current cell, at any time.
Here's an example from the MSDN online documentation:

protected void dataGrid1_MouseDown
(object sender, System.Windows.Forms.MouseEventArgs e)
{
Console.WriteLine();
System.Windows.Forms.DataGrid.HitTestInfo myHitTest;
// Use the DataGrid control's HitTest method with the x and y properties.
myHitTest = dataGrid1.HitTest(e.X,e.Y);
Console.WriteLine(myHitTest);
Console.WriteLine("Column " + myHitTest.Column);
Console.WriteLine("Row " + myHitTest.Row);
Console.WriteLine("Type " + myHitTest.Type);
Console.WriteLine("ToString " + myHitTest.ToString());
Console.WriteLine("Hit " + myHitTest.Type.ToString());
}

Cheers,
Branimir

--
Branimir Giurov
MCSD.NET, MCDBA

"Ananth" <an*****@gmail.com> wrote in message
news:d1**************************@posting.google.c om...
Hi,
I have a question regarding data grids
My application requires me to use a grid for displaying data, however
I would not be using a database for procuring the data, instead I
would be exposing interfaces for other methods to pass me the data
that needs to be displayed. In such a case is the data grid the best
control to use in .NET?
Also if I am using a data grid, how can I obtain the value in the
current cell of the data grid?(where the user has clicked within the
data grid)
Thanks,
Ananth

Nov 16 '05 #2

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

Similar topics

3
by: kieran | last post by:
Hi, I have a form which is submitting into a sql server db. i have one of the fields set to ntext which says length of 16. when i insert info, it only sumbits about a paragraph and when i pull...
0
by: Paul Clark | last post by:
Hi, I am converting a VB6 mobile project (Pocket PC) onto a CE.Net machine and am struggling with the new way of handling datagrids. I have my database and tables setup and stuffed with data...
0
by: steve w | last post by:
Hi there I'm trying to do something that in ASP I could do easily. I want a form which will... 1. Bind a record from a database to the text boxes etc. if the user has come from a summary...
2
by: orekinbck | last post by:
Hi There Using C# forms, I have a main screen that contains 2 data grids. * The data grids are connected to ArrayLists (each grid has its own ArrayList) * The data grids are intended for...
0
by: jonefer | last post by:
I have a page that has some textboxes and datagrids placed on scrolling divs (for display purposes) Is there a quick and dirty way to print text of these scrolling data grids even if it is very...
3
by: ivanerz | last post by:
I am at a loss How do i load a vb data grid that is on a web form with data from an MS Acess table? Please forgive me if this is posted to the wrong forum.
0
by: John Wright | last post by:
I have a datagrid that contains a list of decimal values. I want to compare the values of one datatable to the other datatable and update my data grid. For example my first datatable has the...
6
by: muddasirmunir | last post by:
i make a form whic has one data grid and one text box and one button when i write a name on tex box and click add the name stored in database successfully. now in the grid i want to show all the...
6
by: Wael Slaman | last post by:
Hi I am looking for the best PHP UI library - open source - that can support UI controls , like Data Grids, Form Grid, Panel, drag and drop?? Any Suggestions?? Thank you
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
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,...
0
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...
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
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
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...
0
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...
0
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.