e.Item.Cells(3).Text help

R

rbutch

GUYS i need some datagrid help here.
i can make a button column with an image - no problem -
when its clicked it would go and get
the info, for instance from>

e.Item.Cells(3).Text - the button is hit and it grabs the info from that cell.

here's the deal - whats in Cell number 3 is a primary key and i need to use that to find the correct row.

but, my boss, doesnt want that cell to show in the grid - at all.
so the only way i know to do this is to template the columns. i.e. below:
and then
<asp:TemplateColumn HeaderText="CDID" Visible="False">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "IterationID") %>
</ItemTemplate>
</asp:TemplateColumn>


but when i template the columns and turn AutoGenerateColumns="False"
it no longer finds the info in the cell as before (e.Item.Cells(3).Text) and it doesnt matter whether that property is visible or not.
can someone help me with this?????

thanks for any help
rik



**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...
 
A

Alvin Bruney - ASP.NET MVP

If memory serves me correctly, the cell has a visible property that you can
turn off on the databind
e.items.cells(3).Visible = false. This will effectively hide the entire
column but it will still be accessible from code on the server (not from
script running on the client)

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



rik butcher said:
GUYS i need some datagrid help here.
i can make a button column with an image - no problem -
when its clicked it would go and get
the info, for instance from>

e.Item.Cells(3).Text - the button is hit and it grabs the info from that cell.

here's the deal - whats in Cell number 3 is a primary key and i need to
use that to find the correct row.
but, my boss, doesnt want that cell to show in the grid - at all.
so the only way i know to do this is to template the columns. i.e. below:
and then
<asp:TemplateColumn HeaderText="CDID" Visible="False">
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "IterationID") %>
</ItemTemplate>
</asp:TemplateColumn>


but when i template the columns and turn AutoGenerateColumns="False"
it no longer finds the info in the cell as before (e.Item.Cells(3).Text)
and it doesnt matter whether that property is visible or not.
can someone help me with this?????

thanks for any help
rik



**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP &
ASP.NET resources...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top