Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

get visible false column value in data grid when submit button

Posted on 2011-03-24
7
Medium Priority
?
741 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 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
Industry Leaders: 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

927 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