|
Rank: Advanced Member Groups: Member
Joined: 5/15/2009 Posts: 33
|
1. Is it possible to show tooltips or some sort of pop-up when hovering over cells. Eg. I my grid I show some Id, and when I hover over each I would like to show more information for that Id. I don't want a tooltip for each column. I would like a tooltip for each cell.
2. If I add a custom control in a customColumn in a grid, how can I make the sutom control id unique? Here is an example: HierarchyTerritory2 will always have the same id.
<eo:CustomColumn StyleField="CmdRemoveStyle" ClientSideGetText="on_column_gettext" ClientSideEndEdit="on_end_edit" ClientSideBeginEdit="on_begin_edit" DataField="MovedTo" Width="150" > <EditorTemplate> <uc1:HierarchyTerritory ID="HierarchyTerritory2" runat="server" AutoPostBack="true" ShowLabel="false" OnMySelectedChange="MoveAction" OnPreRender="LoadFirstItem" /> </EditorTemplate> </eo:CustomColumn>
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, As to your question: 1. It is possible to do that with DataFormat on your Grid column. For example, if you only set the columns' DataField to "ID", then the Grid will show the ID in the cell. However if you also set DataFormat to something like this:
Code: HTML/ASPX
<div title="This is the record ID">{0}</div>
The Grid will use this string to format ID, then show the result. For example, if ID is "1", then the Grid will show this in the Grid cell:
Code: HTML/ASPX
<div title="This is the record ID">1</div>
Visually this is no different than showing the ID directly. But because it is wrapped around a DIV element with its title set to "This is the record ID", it shows tooltip "This is the record ID" when you hovers your mouse over it. Because each column can only be bound to one data field, which goes to “{0}”, the tooltip is always fixed here. If you wish different cell to have different tooltips, you will need to format that in your data source. For example, assuming you have a “Description” and “ID” property in your table, you can do:
Code: SQL
SELECT '<div title="' + Description + '">' + ID + '</div>' as f1 FROM….
You can then set the GridColumn's DataField to "f1". This way you do not need to set DataFormat at all since everything is already formatted in your SQL. 2. It always does because there is only one instance of HierarchyTerritory. The Grid reuse the same "EditorTemplate" for all cells for the column. It does not create a separate instance for each cell. Hope this helps. Thanks!
|
|
Rank: Advanced Member Groups: Member
Joined: 5/15/2009 Posts: 33
|
Wow... Thanks for the fast reply. I implemented what you suggested in the SP and works as expected.
ANother question on this:
If I want to style the tool tip, how can I do that? In the grid I want to show a store Id, and when you mouse over show more information like the Store name, Address, Zip, State, each on a separate line...
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
You are welcome. Please feel free to let us know if you have any more questions.
|
|
Rank: Advanced Member Groups: Member
Joined: 5/15/2009 Posts: 33
|
I do have another question on Grid style. I'm using the XP one and at the top of the grid there is a light blue square that the Grid sticks to. What is that and how can I get rid of it. Not sure it's coming from... Is it the Content Pane style? I comment it out but it still shows... And if I set display:none;, the grid doesn't show anymore...
How can I style this so it doesn't show?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
We are not exactly sure what you meant by light blue square. Do you see that in our demo page? Or do you have the page online so that we can take a look?
|
|
Rank: Advanced Member Groups: Member
Joined: 5/15/2009 Posts: 33
|
Yes I do see it in your demo (Grid - XP style) - it's the blue box surrounding the grid.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
The double line blue box are created by:
1. The Grid's BorderColor and BorderWidth property. This creates the outer lines; 2. The Grid's ContentPaneStyle property. This creates the inner lines;
Thanks!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Mona wrote:If I want to style the tool tip, how can I do that? In the grid I want to show a store Id, and when you mouse over show more information like the Store name, Address, Zip, State, each on a separate line... You can not style the tooltip. You can always implement a floating element by yourself to display whatever information you wanted to display with DHTML and JavaScript (or use another third party control/library to do so), but that would have nothing to do with the Grid or any of our controls. None of our controls offer any functionality to do styled tooltips. BTW: Next time when you have new question, please make a new post instead of modifying your existing post. Thanks!
|
|