473,385 Members | 1,602 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,385 software developers and data experts.

2 Questions about DataGrid

hello,

i have a datagrid (in C#) and i have 3 questions:

1. how can i know how many rows my dataGrid(dataSet\DataAdapter) has? is it possiable to know with asking the database or i must do it in my storedprocedure and sent it back to the application?

2. how can i make my dataGrid to display the last rows and not the first?

3. my last row is an empty row, how can i prevent that row from being created?

thanks
Nov 16 '05 #1
1 1263
Hi ,
i have a datagrid (in C#) and i have 3 questions:

1. how can i know how many rows my dataGrid(dataSet\DataAdapter) has? is it possiable to know with asking the database or i must do it in my
storedprocedure and sent it back to the application?

You can use DataTable.Rows.Count to know the number of rows in it. In
general you use the datasource to know it.

2. how can i make my dataGrid to display the last rows and not the first?
You have to filter the datasource for this and eliminate the rows as needed.
3. my last row is an empty row, how can i prevent that row from being

created?

IIRC this is done by using a DataView as the datasource and setting it as
read only.

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
Nov 16 '05 #2

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

Similar topics

3
by: Gidi | last post by:
hello i'm writing an appliction in C# and i have 2 questions: 1. i have a dataGrid which contains data from my DataBase, and when the dataGrid loads the scroll is at the first line and i want it...
2
by: Hemang Shah | last post by:
Hello I've few questions regarding ADO & C#: 1) Is it possible to view tata from multiple tables in the Datagrid control ? Most of the examples I see are only for 1 table. 2) In...
0
by: smith.felicity | last post by:
I have two questions about using the data grid and c# If one of my columns returned in my dataset is null I want another column to be used in the displayed column. So this is what my datagrid...
1
by: Sky | last post by:
Although I've been using C# for the last month or so, and accepting out of blind faith the ViewState, I do have some nagging questions about it... can you help verify the following statements? ...
9
by: eitan | last post by:
Hello, I am using Microsoft Visual Studio 2003 .NET. I have several question, please. 1) I have a connection to the database, which I create it at login, by application("conMain") (I have...
10
by: Kejpa | last post by:
Hi, I've just started using the datagrid and I have a few questions on it... 1. How do you autosize the columns to fit the content programmatically? When you double click between two columns...
1
by: Brian | last post by:
I've got a couple questions on the new Datagridview control in VS2005. 1) In the old datagrid control at design time I was able to add multiple tablestyles with columns from different...
3
by: melton9 | last post by:
I'm just getting into using datagrid and have a couple of questions. 1.)How do you get the grid to show the values of a datatable automatically? Currently I have to hit the + sign and then...
0
by: Newish | last post by:
Hi Couple of questions on datagrid 1) Is there a performance issue when using datagrid to display data from a datatable. 2) Is there a security issue when using datagrid to display data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.