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

How to Access Template Field Value In Gridview

I have a gridview component and it has a template field associated with it.

However when I used
gridview.Cells[i].Text it is null or balnk.

Also the template field has not control associated with it

here is the code:
<asp:TemplateField HeaderStyle-Width="1000px" HeaderStyle-Wrap="true" ItemStyle-Width="200" ItemStyle-HorizontalAlign="Center" HeaderStyle-CssClass="Header" >
<HeaderTemplate>
<!-- Extended Comments -->
FieldNumber1
</HeaderTemplate>
<ItemTemplate >
<%# DataBinder.Eval(Container.DataItem, "FieldNumber1")%>
</ItemTemplate>
<HeaderStyle BackColor="LightGray" CssClass="MyClass" />
</asp:TemplateField>

I have even tried making the width as 0(zero) pixels or adding a hidden column , used css to make it hidden too ,but cannot access it?

Any ideas or suggestions?

Please HELP
Oct 11 '07 #1
1 2378
nateraaaa
663 Expert 512MB
What are you trying to accomplish with your TemplateField? The code that you posted does not really describe what you are trying to do with the DataBinder.Eval. I generally use DataBinder.Eval so that I can pass the value as a querystring to another page via the CommandArgument. Please provide the additional info and I will do my best to get you on the right track.

Nathan
Oct 11 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: NateDawg | last post by:
I'm reposting this. I'm kinda in a bind untill i get this figured out, so if anyone has some input it would sure help me out. Ok, I’ve noticed a few gridview problems floating around the forum....
0
by: Yog | last post by:
Hi, How to access the value of a Texbox column(Template field) in gridview and to update a column next to it in the Gridview...! Example:Let's say there are four columns Product,Cost,Quantity...
6
by: CSharpguy | last post by:
In my gridview I have 2 -3 template fields which are hyperlinks. I allow the user to print this grid. When the grid prints it also prints the links, how can I take the user to a print preview page...
9
by: =?Utf-8?B?c3Jpbml2YXM=?= | last post by:
Hi All, Can anybody please help me, how to access all rows in a grid view if the paging is enabled? If gridview contains 100 rows and pagecount=10, then in the gridview.rows collection, i'm...
3
by: Dariusz Tomon | last post by:
Hello, I have GridView in EditItem Template of DetailsView (in normal - read-only mode there is a label). When I'm in edit mode I can select one item from GridView. The main problem is that as...
4
by: Debbiedo | last post by:
My software program outputs an XML Driving Directions file that I need to input into an Access table (although if need be I can import a dbf or xls) so that I can relate one of the fields...
0
by: jimbob91577 | last post by:
I have a Gridview that I am dynamically adding template columns to which contain text boxes in their "Item Data" field. After adding the columns to the gridview in my Page_Load event, the page binds...
1
by: zergziad | last post by:
Hi All, I really need help to solve my problem. My case is on looping through textbox in gridview. I had a gridview placed in my page. The gridview contains template field which I created it...
1
by: neobonzi | last post by:
Hello! I'm dynamically creating a GridView bound to a datatable using custom template columns using the following method: protected void ShowGrid(DataTable dt) { ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.