Thursday, March 29, 2012

Newbie : Gridview question

Hi all,
I have a gridview on my page and templatecolumns defined in it. I also have
a couple of databound columns. The datatable being bound to the gridview
contains a column (defined as a datacolumn so as to get the value) and in
the ItemDataBound I can access this value but only when the databound
column's visibility is set to true. If I hide the visibility at design-time
I can't get access to the value at run-time. I don't want to show this
column.
How do I go about geting the value so as to do someting with it but not show
the databound column?
Regards
John.Hi John,
You can put these values in DataKeyNames, and retrieve by
.DataKeys[row_index].Values[col_index]
HTH
Elton Wang
"John" wrote:

> Hi all,
> I have a gridview on my page and templatecolumns defined in it. I also hav
e
> a couple of databound columns. The datatable being bound to the gridview
> contains a column (defined as a datacolumn so as to get the value) and in
> the ItemDataBound I can access this value but only when the databound
> column's visibility is set to true. If I hide the visibility at design-tim
e
> I can't get access to the value at run-time. I don't want to show this
> column.
> How do I go about geting the value so as to do someting with it but not sh
ow
> the databound column?
> Regards
> John.
>
>

0 comments:

Post a Comment