Home All Groups Group Topic Archive Search About

DataGrid displaying hidden EditCommandColumn Values on PostBack

Author
21 Jul 2005 7:53 PM
freshRecruit
Hi

I am filling a datagrid with values. One of the columns is a EditCommand
Column and an other column is an 'Y/N' Bound column. If the value is 'Y' than
the Edit Command link is displayed if the values is 'N' than the EditCommand
link is not displayed and the value is disabled. I am doing the text setting
and disabling on the ItemDataBound Event of the DataGrid. This datagrid is in
one of the panels(trying to do a tabbed form) which is a usercontrol. When I
click on an other tab and hide this panel and than display it again(on click
of the particular image button) the hidden values are displayed and are
Enabled. The EnableViewState is Enabled.

Please help..I am on a deadline.

Thanks in advance.

--
GettingHelp/JustTryingToHelp

Author
22 Jul 2005 5:35 PM
Harolds
It sounds to me like you need to rebind the datagrid on postback.

Show quoteHide quote
"freshRecruit" wrote:

> Hi
>
> I am filling a datagrid with values. One of the columns is a EditCommand
> Column and an other column is an 'Y/N' Bound column. If the value is 'Y' than
> the Edit Command link is displayed if the values is 'N' than the EditCommand
> link is not displayed and the value is disabled. I am doing the text setting
> and disabling on the ItemDataBound Event of the DataGrid. This datagrid is in
> one of the panels(trying to do a tabbed form) which is a usercontrol. When I
> click on an other tab and hide this panel and than display it again(on click
> of the particular image button) the hidden values are displayed and are
> Enabled. The EnableViewState is Enabled.
>
> Please help..I am on a deadline.
>
> Thanks in advance.
>
> --
> GettingHelp/JustTryingToHelp
Author
22 Jul 2005 6:30 PM
freshRecruit
Thanks I figured it out. I was just doing e.Item.Cells[0].Text for the
editColumn hence the viewState was not saving the values. I had to typecast
it to (LinkButton)(e.Item.Cells[0].Controls[0]).Text and now it is saved.

--
GettingHelp/JustTryingToHelp


Show quoteHide quote
"Harolds" wrote:

> It sounds to me like you need to rebind the datagrid on postback.
>
> "freshRecruit" wrote:
>
> > Hi
> >
> > I am filling a datagrid with values. One of the columns is a EditCommand
> > Column and an other column is an 'Y/N' Bound column. If the value is 'Y' than
> > the Edit Command link is displayed if the values is 'N' than the EditCommand
> > link is not displayed and the value is disabled. I am doing the text setting
> > and disabling on the ItemDataBound Event of the DataGrid. This datagrid is in
> > one of the panels(trying to do a tabbed form) which is a usercontrol. When I
> > click on an other tab and hide this panel and than display it again(on click
> > of the particular image button) the hidden values are displayed and are
> > Enabled. The EnableViewState is Enabled.
> >
> > Please help..I am on a deadline.
> >
> > Thanks in advance.
> >
> > --
> > GettingHelp/JustTryingToHelp