Hi Guys,
I've got a datagrid that is bound at runtime to a table adapter query.
The query returns a user id amongst many other items. A snippet of the first two lines is below...
Now the database only stores the user id. I then elsewhere been using that user id to grab a GUID from a users table and then using the GUID to return a display name from an Active Directory query.
I want that display name to display to display in the above datagrid and thought a template field would be the way forward?
Can this be done? Can I call a method using code tags in the label control, pass the user id from the gridview values and then return and response.write?? the value to the page?...
I apologise if i've explained myself poorly! One solution I've thought of is to just store the full display name in the database and just sync it each evening. The reason I haven't been storing the display name is in case it gets changed in Active Directory.
Many Thanks,
I've got a datagrid that is bound at runtime to a table adapter query.
The query returns a user id amongst many other items. A snippet of the first two lines is below...
Code:
<asp:TemplateField HeaderText="User"><ItemTemplate><asp:Label ID="lblUsername" runat="server" Text='<%=test;%>'></asp:Label></ItemTemplate></asp:TemplateField>
<asp:BoundField DataField="age" HeaderText="Age" />
Now the database only stores the user id. I then elsewhere been using that user id to grab a GUID from a users table and then using the GUID to return a display name from an Active Directory query.
I want that display name to display to display in the above datagrid and thought a template field would be the way forward?
Can this be done? Can I call a method using code tags in the label control, pass the user id from the gridview values and then return and response.write?? the value to the page?...
I apologise if i've explained myself poorly! One solution I've thought of is to just store the full display name in the database and just sync it each evening. The reason I haven't been storing the display name is in case it gets changed in Active Directory.
Many Thanks,