Solved

get visible false column value in data grid when submit button

Posted on 2011-03-24
7
727 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now