Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

get visible false column value in data grid when submit button

Posted on 2011-03-24
7
Medium Priority
?
740 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 2000 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

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

715 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