I have a gridview that becomes quite long with some information that could be somewhat hidden.
Here's my asp:
<asp:GridView ID="gvLogBody" runat="server" CssClass="Grid" AllowPaging="true" AllowSorting="true" PageSize="10" AutoGenerateColumns="true">
</asp:GridView>
And here's my code behind:
DataSet ds = new DataSet();
ds.Tables.Add("LogBody");
ds.Tables["LogBody"].Columns.Add("timeStamp");
ds.Tables["LogBody"].Columns.Add("name");
ds.Tables["LogBody"].Columns.Add("message");
foreach (LogObject l in logLines)
{
ds.Tables["LogBody"].Rows.Add(l.TimeStamp, l.Name, l.Message);
}
gvLogBody.DataSource = ds.Tables["LogBody"].DefaultView;
gvLogBody.DataBind();
This gives me a gridview that looks like this: ____________________________________________________________________________________________
|timeStamp| name | message |
+---------+-----------------------------------------------+--------------------------------+
|01-01-01 | someLongAndQuiteUnnecesaryNameThatIWishToHide | someMessageThatIsMoreImportant |
+---------+-----------------------------------------------+--------------------------------+
What I want is something like this:
_________________________________________________________
|timeStamp| name | message |
+---------+-------------+--------------------------------+
|01-01-01 | clickToShow | someMessageThatIsMoreImportant |
+---------+-------------+--------------------------------+
And once the user clicks the text, it expands / opens a popup or something.
How can this be done?
Anonymous User
14-Nov-2014This piece of code will help you out.