Solved

get visible false column value in data grid when submit button

Posted on 2011-03-24
7
733 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 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
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 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

Independent Software Vendors: 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!

Question has a verified solution.

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

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.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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