Maintainig LinkButton State In Grid View

Posted by Vikie4u under ASP.NET on 9/8/2008 | Views : 2504 | Status : [Member] | Replies : 2
Hi All,

I am having a problem with maintaining the State of Link button in Grid View.Like Suppose when the page is loaded for first time there are two colums in grid view which contains Link Button and the state of the link button that whether it is enabled or disabled depends on the some values from DB.Now the problem isthat when i'm sorting the GridView the Link Button is changing from 'Disabled' to 'Enabled'.

How can I stop this.Please help me.

Thanks
Vikram




Responses

Posted by: Poster on: 9/8/2008 [Member] Starter

Up
0
Down
This may not be your exact answer but it can help you.

Add OnRowDataBound event into the GridView and implement that event. In that event try to find the link button using FindControl method and based on the value that is available you can enable and disable the linkbutton.

Vikie4u, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Majith on: 9/8/2008 [Member] Starter

Up
0
Down
hi vikram

can you send ur coding so that i can understand liitle bit more and give more explanation on the gridview method.

Vikie4u, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response