Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6809179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:03:17+00:00 2026-05-26T20:03:17+00:00

I have a repeater, on its item_command event i am binding another repeater. And

  • 0

I have a repeater, on its item_command event i am binding another repeater. And i want to show data according to role in the second repeater. For it i want to hide and show some column according to role of users. how can we do it using code behind. Thanks in advance.
My code is

<table id="table1" class="yui" cellpadding="0" cellspacing="0">
                <thead>
                    <tr>
                        <th>
                            <a href='#' title="Click Header to Sort">EmpID #</a>
                        </th>
                        <th>Edit</th>
                    </tr>
                </thead>
                <tbody>
                    <asp:Repeater ID="Repaddressorbbl" runat="server" OnItemCommand="Repaddressorbbl_ItemCommand">
                        <ItemTemplate>
                           <tr id="gh" style="cursor: pointer" onclick="Select(this);">
                                <td style="text-align: center;">
                                    <%#Eval("empid")%>
                                </td>  
                                <td>
                                    <asp:LinkButton ID="lknumber" runat="server" Text="Edit" CommandName="searchbybbloraddress" />
                                </td>                             
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>
                <tfoot>
                </tfoot>
            </table>

 protected void Repaddressorbbl_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "searchbybbloraddress")
        {
          bind_rep2(); 
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:03:18+00:00Added an answer on May 26, 2026 at 8:03 pm

    If you want to databind the second repeater from the ItemCommand in your code behind you have two options.

    You could modify the dataset you set as the DataSource of the second repeater and set the sensitive data to an empty string or **.

    The other option you have is add a IsVisibleToUser boolean property to your dataset and in your second repeater bind the Visible property to this property.

    You can easily modify the data that is given to your DataSource by using a Linq query that produces an anonymous object.

    Something like:

    Repeater2.DataSource = from d in MyData
                           select new
    {
        FirstName = d.FirstName,
        LastName = d.LastName,
        Salary = d.Salary,
        IsVisibleToUser = CurrentUser.IsInRole(...)
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one control named thumbviewer inside repeater. I want to set its imageurl
I have a repeater control outputting some HTML. I want a table which outputs
I have a repeater. i want to get empid when i click on its
In my usercontrol, I have a repeater that contains some data from the DB.
I am binding a List<HtmlImage> to a repeater Its actually a nested repeater and
I have an ASP.NET control that binds data to a repeater. Inside that repeater,
I have a Repeater control who has its dataSource setted with a typed object
I'm writing an admin form for some fairly complex objects. Its a standard repeater
I have a repeater and inside it i have a checkbox. Now i want
I have a class that contains hierarchical data. I want to present this data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.