I have a vb.net application in which a grid view is there with a hidden field. I want to get the value of that hidden cell
Code behind statusGrdvw.Rows(assign).Cells(5).Text
I have a vb.net application in which a grid view is there with a hidden field. I want to get the value of that hidden cell
Code behind statusGrdvw.Rows(assign).Cells(5).Text
Well you can add this style in the html
<style>
.hidden {display:none;}
#exportother {
position: relative;
top: 13px;
left: -840px;
}
</style>
Then on the field you want to hide
ItemStyle-CssClass="hidden"
HeaderStyle-CssClass="hidden"
The field will be hidden but will be accessible from code behind.
You didn't provide much to go on but what you need to do is get it by its control index. So basically if you have 2 controls in one column you have a control at index 0 and index 1. Something like this (you'll have to look up the exact syntax):
((HiddenInput)statusGrdvw.Rows(assign).Cells(5).Controls[0]).Value
Try this one to fetch the value in hidden field :
Dim hidden2 As String = CType(statusGrdvw.SelectedRow.Cells(5).FindControl("HiddenfieldID"), HiddenField).Value;