473,569 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datagriditem

VS 2005
What is the difference between the DataGridItem's ItemIndex and
DataSetIndex? Aren't they the same thing?

Here is what I found on msdn.

ItemIndex
Gets the index of the DataGridItem object from the Items collection of the
DataGrid control.

DataSetIndex
Gets the index of the DataGridItem object from the bound data source.
Mike

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Apr 2 '06 #1
2 2630
The ItemIndex is between 0 and the PageSize (if the DataGrid AllowPaging is
set to true). The DataSetIndex is the row position on the datasource which
is between 0 and the DataView.count or DataTabl.Rows.C ount. If the datagrid
does not allow paging then both are equal.
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Mike Gaab" wrote:
VS 2005
What is the difference between the DataGridItem's ItemIndex and
DataSetIndex? Aren't they the same thing?

Here is what I found on msdn.

ItemIndex
Gets the index of the DataGridItem object from the Items collection of the
DataGrid control.

DataSetIndex
Gets the index of the DataGridItem object from the bound data source.
Mike

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Apr 2 '06 #2

"Phillip Williams" <WE******@newsg roups.nospam> wrote in message
news:E0******** *************** ***********@mic rosoft.com...
The ItemIndex is between 0 and the PageSize (if the DataGrid AllowPaging
is
set to true). The DataSetIndex is the row position on the datasource
which
is between 0 and the DataView.count or DataTabl.Rows.C ount. If the
datagrid
does not allow paging then both are equal.

So I can use the DataSetIndex as an index into my business objects
collections.

Thanks, Mike

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Apr 2 '06 #3

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

Similar topics

0
1230
by: Paul Perot | last post by:
Hi All: I am populating a Data Table with File/Folder information from my drive... I am then binding this data table to a DataGrid. Due to the size of the DataGrid data, I use the built in paging. All of this seems to work just fine. In certain circumstances I need to programically change one of the data column values from true to false...
2
1751
by: Richard Loupatty | last post by:
I put a datagrid in a panel with an overflow set on auto. I want to show just 5 items in the grid. My question is how to make sure that the selecteditem is always visible in the grid. Because now i have this situation that after each selection (I use the itemcommand) the grid starts from the top. when i (for example) set selectedindex = 8,...
4
4366
by: Souri Challa | last post by:
Hello All, When a datagrid in a web form is getting re populated from view state on post back, it is firing the datagrid Item Created event but the DataGridItem(e.Item.DataItem is null) in the event arguments has no values. Is there any way to access and manipulate the row contents in this case ? Thanks in advance for any insigts in to...
2
6136
by: Joel Lyons | last post by:
The help pages make it look like the DataGridItem.DataItem property would return a row from the bound table. Like so: //(during setup) myGrid.DataSource = myDataset.MyTable; myGrid.DataBind(); //(in OnSelectedIndexChanged) MyTableRow row = myGrid.SelectedItem.DataItem as MyTableRow; myLabel.Text = "You selected: " + row.Name;
4
2392
by: tshad | last post by:
Is there a way to get the text from control, without actually defining it? For example, I have a DataGrid that has fields that are either Labels or Textboxes, depending on whether they are in edit mode or not. Dim answer as String Dim lblAnswer as Label = CType(oDataGridItem.FindControl("Answer"),Label) if lblAnswer = nothing then Dim...
1
2838
by: Samuel Chowdhuri | last post by:
this peace of code is giving me trouble DIM i as DataGridItem for each i in myDataGrid checkbox chkbox = Ctype(i.findcontrol("deletethis"),checkbox) if(chkbox.checked) then ...... .....
3
2634
by: GD | last post by:
Got a simple ASPX page (.NET v1.1) with a DataGrid displaying a list of widgets. If the page has a QueryString called WidgetId specific, I need to automatically mark the specific DataGridItem as selected. Pretty simple, here's what I did: for (int i=0; i<dgWidgets.Items.Count; i++) { DataGridItem oDataGridItem = dgWidgets.Items; if...
15
2587
by: Laser Lu | last post by:
Hi, all, I was tangled by the DataGridItem.DataItem property. I tried to invoke that property to get and display the contents that was bound to the currently selected row. However, an exception surprised me that it said "Object reference not set to an instance of an object." How could it happen? I have set the data source, and called the...
3
1579
by: Steve Hershoff | last post by:
Hi everyone, I'm wondering if anyone has a suggestion on how to do this, or if it's even possible. In my datagrid's OnItemDataBound function I'd like to somehow "add" a child row beneath one of the datagriditems (chosen via a QueryString variable) and use it to hold a secondary datagrid. It would act as a drilldown of sorts, showing...
0
7703
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...
0
7926
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. ...
0
8138
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...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
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...
0
5223
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...
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.