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

Datagrid tutorial needed.

Coming from VB, I find the changes needed to manipulate a datagrid are much
more taxing than previously.

Is there a good tutorial for things like:

Setting the column widths
making the grid uneditable
making the whole row highlight when selected

There are a number of posts but as I am trying to learn on my own, they are
a bit confusing.
For example,. I have found the following code to remove the updating row at
the end, but dont understand why I need a currencyManager to do this. (I
know it is C# code)

CurrencyManager cm = (CurrencyManager)dataGrid.BoundContext[
dataGrid.DataSource,
dataGrid.DataMember];

DataView theView = (DataView)cm.List;
theView.AllowNew = false;

Any help appreciated.

Thanks

Andrew Baker.
Nov 20 '05 #1
2 1935
Cor
Hi Andrew,

You are a little bit confusing.
Coming from VB, I find the changes needed to manipulate a datagrid are much more taxing than previously.


Do you want to do it with VB.net code or with C# code because you are
talking about that also?

However in general, there are lots of methods to manipulate a datagrid. For
the columnwidth and things like that I think that the best you can do is
look at the datgridstyles and datagridcolumnstyles on msdn.microsoft.com

http://msdn.microsoft.com/library/de...ridcontrol.asp

For manipulating rows, you can look at the underlaying layers. Mostly the
dataview or basicly the datatable. However some people like to do the
manipulating from rows using the binding and currency manager. I think that
is a matter of preference (I like the most the dataview).

One of the nicest thing from dotNet is that there is not one best method,
but you can choose the best method for your problem or your way of thinking.

I hope this helps?

Cor
Nov 20 '05 #2
Cor
Hi Andrew,

You are a little bit confusing.
Coming from VB, I find the changes needed to manipulate a datagrid are much more taxing than previously.


Do you want to do it with VB.net code or with C# code because you are
talking about that also?

However in general, there are lots of methods to manipulate a datagrid. For
the columnwidth and things like that I think that the best you can do is
look at the datgridstyles and datagridcolumnstyles on msdn.microsoft.com

http://msdn.microsoft.com/library/de...ridcontrol.asp

For manipulating rows, you can look at the underlaying layers. Mostly the
dataview or basicly the datatable. However some people like to do the
manipulating from rows using the binding and currency manager. I think that
is a matter of preference (I like the most the dataview).

One of the nicest thing from dotNet is that there is not one best method,
but you can choose the best method for your problem or your way of thinking.

I hope this helps?

Cor
Nov 20 '05 #3

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

Similar topics

4
by: Aaron Ackerman | last post by:
I am using typed datasets in an N-Tier Windows app using VB.NET. I know this posting cannot be fully explained in a single post that is why I am asking for someone to point me to a real world...
0
by: admin | last post by:
New Article Building a DataGrid with Add and Edit Features By Tulga Kalayci The DataGrid server control is one of the most widely used controls in ASP.NET-based projects to display data in a...
0
by: Stephen | last post by:
This is a real brain-teaser and i'd really appreciate it if someone can try and understand what im trying to do and give me a few pointers or ideas to help me work out my problem. Im basically...
4
by: Do | last post by:
Hi, I tried to bind an XML similar to the following to a datagrid. <Idontwant> <Iwant> <Yes></Yes> <Yes></Yes> <Yes></Yes> <Yes></Yes>
1
by: jm | last post by:
I manually put a datagrid in on a form. I then added this code to an event to populate it: OdbcConnection conn = new OdbcConnection("DSN=CardBase"); sqlCardHolders = "SELECT * FROM...
5
by: quanga | last post by:
Hi- I have a datagrid that in some cases can be several thousand rows in length. What I'd like it to do is have the data pushed to the browser after every, say, 100 rows or so. Kind of a...
2
by: Andrew Baker | last post by:
Coming from VB, I find the changes needed to manipulate a datagrid are much more taxing than previously. Is there a good tutorial for things like: Setting the column widths making the grid...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
7
by: Mark B | last post by:
Can someone write some VB.Net example code for me that does this: 1) Creates a gridview control with the results of a SQL stored procedure that has 1 parameter (text) 2) Adds an extra column...
2
by: brock wade | last post by:
I have a Datagrid that is working fine displying my records, but I'm trying to program buttons on each record line to launch another web page that shows all the details for the product: ...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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.