How to bind data to GridView table

Greetings,

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.

Thanks
UserModTable.JPG
John500Asked:
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

JINN


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

Open in new window

0
 
John500Author Commented:
Thank you
0
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.