473,406 Members | 2,451 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,406 software developers and data experts.

Acessing gridview data programmatially


Hello,

Could anyone please help me ?

I've a GridView and I'd like to insert one of the girdview's dataset field as a
row tooltip.

The grid view is declared like:

<asp:GridView ID="grdLista" runat="server" DataSourceID="sdsList"
OnRowDataBound="grdLista_RowDataBound" AllowPaging="True" AllowSorting="True"
OnDataBound="grdLista_DataBound" AutoGenerateColumns="False" PageSize="25">
<Columns>
<asp:HyperLinkField HeaderText="Col1" DataNavigateUrlFields="field1"
DataNavigateUrlFormatString="page.aspx?PPage=page1 &Id={0}"
InsertVisible="False" DataTextField="databaseField1" />
<asp:BoundField DataField="Description" Visible="false"
InsertVisible="False" ReadOnly="True"/>
</Columns>
</asp:GridView>

Now my handler:

protected void grdLista_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.ToolTip = e.Row.Cells[1].Text;
}
}
If I change e.Row.Cells[1].Text to something like "Hello", the HTML is rendered
fine, and the tooltip is inserted (<td title="hello">).

If I remove Visible="false" from BoundField, the description, GridView show the
description column and e.Row.Cells[1].Text returns the right description data.

If I put back Visible="false", the column is not rendered, but
e.Row.Cells[1].Text returns "".
How can I read something data-bounded, but not show in GridView and use it ?

Thanks in advance,

Fernando Monteiro

Nov 19 '05 #1
0 1095

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

Similar topics

3
by: theKirk | last post by:
using Visual Studio 2005 C# ASP.NET I know there has to be a simple way to do this....I want to use C# in a code behind for aspx. Populate a GridView from an xml file Add Fields to the...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
4
by: Jim Katz | last post by:
I have an application that updates a strongly typed data set at run time. I'd like to dynamically create a table that connects to a run time data table. For displaying the data, this works well. ...
5
by: sutphinwb | last post by:
Hi - This could be a simple question. When I relate two tables in a datasetet, how do I get that relation to show up in a GridView? The only way I've done it, is to create a separate table in the...
7
by: GaryDean | last post by:
I'm trying to load a GridView up with data manually, in code. I'm not using any datasource. Using this code.... ArrayList myRowArrayList; GridViewRow myGVR = new...
7
by: bonk | last post by:
Hello I am acessing a Dictionary<TKey,TValuefrom multiple threads and often in a foreach loop. While I am within one of the foreach loops the other threads must not modify the collection itself...
4
by: mohaaron | last post by:
This seems like it should be simple to do but for some reason I have been unable to make it work. I would like to databind a SqlDataSource to a GridView during the click event of a button. This...
3
by: swamimeenu | last post by:
hi, I am facing the problem in vb tht if more than one user accessing my program from various systems,if both of them acessing the progam at a same time (ie) for feeding data in it ,at tht time i...
3
by: Peter | last post by:
I have a GridView which is populated by List<ofObjects> Does anyone have example of how to sort the columns of this GridView? I have found examples without DataSourceControl but these use...
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: 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...
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
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
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.