How to bind data to GridView table


In the table seen in the picture below I'm trying to populate column 1 with information based on the users login name.  The first section will provide two boxes for the user name and domain.  Based on this information the cells in column 1 will automatically populate.

Need help with this.

Who is Participating?
jinn_hnnlConnect With a Mentor Commented:
Create your gridView, bind your gridView datasource to an ObjectDataSource which rely on username and domain, this ObjectDataSource has a select method which require 2 parameters loginname & domain.

Look at my example, the UserProject.UserClass is a class where you define the GetUserChangeTable(string loginname, string domain)

Hope this helps


<asp:GridView ID="gvUserChange" runat="server"  DataSourceID="objdsUserChange" ...>
<asp:ObjectDataSource ID="objdsUserChange" runat="server" SelectMethod="GetUserChangeTable" TypeName="UserProject.UsersClass" ...>
                    <asp:ControlParameter ControlID="tbLoginName" PropertyName="Text" Type="String" />		
                    <asp:ControlParameter ControlID="ddlDomain" PropertyName="SelectedValue" Name="Domain" Type="String" />

Open in new window

John500Author Commented:
Thank you
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.