Gridview-Hiding columns in gridview control

Posted by Goose_oh under ASP.NET on 6/19/2008 | Views : 1711 | Status : [Member] | Replies : 4
I have a drop down which shows Top(6) months from the store proc.

I have a gridview, which shows datas for the current month which has some editable columns in it.

If need to see the dats from previous months, by selecting from drop down, i am those months corresponding data.

my question now is, those previous months should not be editable.

I tried doing gridview1.column(0).visible=false

but i need the edit column of gridview to go false.

Any help is really appreciated.

Thank YOU.




Responses

Posted by: Kumaran1987 on: 1/28/2013 [Member] Starter | Points: 25

Up
0
Down
Click here How to Hide Gridview and Show the selected gridview row details in Form View using ASP.NET C# http://www.kumaran198726.com/2013/01/how-to-hide-gridview-and-show-selected.html

Kumaran K

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

Posted by: Raja on: 6/19/2008 [Member] Starter

Up
0
Down
In this case you need to manually place Edit Link button and do following.

I think you can achieve it in mutliple ways.

1. OnRowDataBound event try accessing the Link button of the GridView and make id disabled
2. Use gridview1.Rows[e.RowIndex].FindControl("linkEdit") and make it disabled.

There are more ways but you can try above.

Thanks

Regards,
Raja, USA

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

Posted by: Goose_oh on: 6/22/2008 [Member] Starter

Up
0
Down
I dont have link button for edit and update. I just have onrowediting=true in my gridview.

How to do this?

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

Posted by: Raja on: 6/26/2008 [Member] Starter

Up
0
Down
You can disable AllowEditing and write your own Template field


Regards,
Raja, USA

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

Login to post response