Hello All
I have a web grid in my web form. I would like to set the title of that grid at the time of Pageload. I have five LinkButtons in my my previous page. And the title of Grid depends on the link button which is clicked in last page.
Any suggestions will be highly appreciated.
Thanks
Gaurav
Hello,
If you are using asp:LinkButton controls with postback, you can store the Title in Session, e.g. Session["Title"] = "some title" and use that in grid later.
I am saving my title in Session. But my problem is that which property or attribute of webgrid to use for displaying title on the top of the grid.
I have used "Text" property to show heading in windowApplication. But there is no such propert in WebGrid.
I have tried to use caption also. But still its not working.
Here is my sample code=
ManagementDetailsUltraWebGrid.Caption=_selectedReport + ": " + FromDateTextBox.Text +
" - " + ToDateTextBox.Text;
Thanks in advance.
I am still looking for solution.
Thanks in advance
WebGrid doesn't have an "overall header", "title", or "caption" similar to WinGrid's caption, at least not with a single property. That's why you're unable to find a WebGrid property for this.
There are two ways that I can think to implement this in WebGrid.
One way is to provide a separate control, such as an HTML label (a SPAN element) or an HTML TABLE, just above the grid and with the same width as the grid. This control can contain what you want to appear above the grid.
Another way is to establish a multi-column header in the grid itself, setting the ColSpan of this header element so that it appears over all the columns, and set the Caption of this header element to the text you want to appear. This article from our online help documentation of NetAdvantage for .NET 2008 Volume 3 provides some information about multi-column headers in WebGrid, including showing how to span that new header across more than one column's width.
Thanks for your reply. yeah you are right I want to set header of the grid. But i dont know which property of webgrid to use for setting text to header?
Can you please clarify what you mean by "title" in this context?
In web programming, "title" generally refers to a tooltip. That's because this is the name of the HTML attribute that you'd apply to an HTML element to control the contents of the tooltip to be displayed for that element.
What you're describing sounds like you want a "header" above the grid itself to display some text. Is this what you're after, or is it something else?
Lastly, is this request at all related to the following thread you've also posted?http://forums.infragistics.com/forums/t/23335.aspx