Solved

get visible false column value in data grid when submit button

Posted on 2011-03-24
7
731 Views
Last Modified: 2012-06-27
Hi,

 In gridview i give one column visible="false". In item template i have radiobutton. when i click radio button the row is selected. After clicking radio button i click submit button. When i click submit button i need to take value of grid invisible column that what i give visible is false.Is it possible? If it is possible, how we reach this problem? Any suggession. Highly appreciate if any help.

Thanks
Guvera
0
Comment
Question by:guvera
  • 3
  • 3
7 Comments
 
LVL 3

Expert Comment

by:Labelsoft
ID: 35206163
Are you asking how to get the value of an invisible column?
0
 
LVL 8

Author Comment

by:guvera
ID: 35206190
Hi,

Thanks for your reply.

yes..i click radio button the entire row of the column is selected. I put one of the column is visible ="false". When i click submit button i need to get the column value(visible="false").

Regards
Guvera
0
 
LVL 9

Accepted Solution

by:
Roman Gherman earned 500 total points
ID: 35206194
you need not to put visible=false but make this like below:

1) Create a css class dataCellHide

.dataCellHide
{
      display: none;
      visibility: hidden;
      overflow: hidden;
}

2) Hide the column needed with that class
                                       <asp:TemplateField>
                                            <ItemTemplate>
                                                <asp:Label ID="lblListId" runat="server" Text='<%# Bind("list_item_id")%>'/>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="dataCellHide"/>
                                            <HeaderStyle CssClass="dataCellHide"/>
                                            <FooterStyle CssClass="dataCellHide"/>
                                        </asp:TemplateField>

3) On submit:

(Label)yourGridView.SelectedRow.FindControl("lblListId")).Text
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 8

Author Comment

by:guvera
ID: 35206285
hi,
Thanks for your update. Currently I am using boundfield and I have set the visible property as false.

Gridview has a column with radio button. Once I selected the radio buttion, I will click the continue button, at that time I need  the hidden column value.
0
 
LVL 9

Assisted Solution

by:Roman Gherman
Roman Gherman earned 500 total points
ID: 35206475
0
 
LVL 8

Author Comment

by:guvera
ID: 35212870
Hi,

 Using DataKey property is to get unique row id only right, ie can get primary key value.
 I need to get any one of the column value(hidden) in the grid.

Thanks for your reply.

Regards
Guvera
0
 
LVL 9

Expert Comment

by:Roman Gherman
ID: 35213039
Then put that value in a hidden input and then at submit do
(HiddenField)yourGridView.SelectedRow.FindControl("hdnField")).Value
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question