Welcome Guest Search | Active Topics | Sign In | Register

GridView - add control in the header of a column Options
Mona
Posted: Wednesday, March 31, 2010 3:10:59 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2009
Posts: 33
Hi,

Could you tell me if it's possible to attach a drop-down list to the header of the column? The drop-down list I want to use is a custom control (when page laoding, the drop-dwon will fill with the list items)...

The idea is the column would be a checkbox column. The header of the column would contain a drop-down and a button. When clicking the button, an action will take place based on the drop-down selection for all the items checked in the column.

Please let me know how would you work this one out. I was able to add the button and figure out what's checked in the column, but I could not add the drop-down list in the Header of the column...

Thanks
eo_support
Posted: Wednesday, March 31, 2010 4:35:51 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You can do that with raw HTML. The grid header's HeaderText would take any HTML you give to it. So for example, if you set the column's HeaderText to

Code: HTML/ASPX
<input type="button" value="Test!" />


You will see a push button on the column header.

Thanks!
Mona
Posted: Wednesday, March 31, 2010 5:06:58 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2009
Posts: 33
I figured that out for the button,

<eo:CheckBoxColumn HeaderText="<button id='btnCancelSelected' class='cursor' onclick='cancelSelected();' runat='server'><img src='../Images/cancel.gif' alt='Cancel All selected' /></button></a>" Width="30" StyleField="CmdCancelStyle" >
</eo:CheckBoxColumn>

but I was trying to insert a dropdown list.

raw HTMl only? That's a problem because I can't hard-code a drop-down list. The list is dynamic becaused on differetn criteria and it's values are determined by page load. Any suggestions with that?

I would like to do something like this. Ideally, instead of using a drop-downlist using an asp.net custom control, but a drop-down lsit would work too.

<eo:CheckBoxColumn HeaderText="<asp:dropdownlist ID='HierarchyTerritory2' runat='server' AutoPostBack='true' OnSelectedIndexChanged='' OnPreRender='LoadFirstItem' /><button id='btnMoveSelected' class='cursor' onclick='moveSelected();' runat='server'><img src='../Images/move.gif' alt='Move All selected' /></button></a>" Width="150" StyleField="CmdRemoveStyle" >
</eo:CheckBoxColumn>

Any suggestions?

Thanks,
Mona
eo_support
Posted: Wednesday, March 31, 2010 5:14:21 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Unfortunately yes. It's raw HTML only. We won't be able to assist you on the HTML details. I would recommend you to try a server DropDownList with a blank page, then view the rendered HTML source to find out how to create a drop down with HTML.

Thanks!
Mona
Posted: Wednesday, March 31, 2010 6:18:41 PM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2009
Posts: 33
What about textboxes? I want to update the values of selected cells with one click.

Even if I add the html, it doesn't seem to let me type in the box... Any suggestions on this?

<eo:TextBoxColumn DataField="StoreCallTime" HeaderText="Call Time <input name='txtAllCallTime' type='text' size='5' runat='server'>" Width="80" AllowSort="False" ClientSideBeginEdit="on_begin_edit_text">
<CellStyle CssClass="editableCell" />
</eo:TextBoxColumn>

I click on the textbox to type, but it doesn't seem to let me type. It actually writes to the upper left corner of the screen!

Thanks again
Mona
Posted: Thursday, April 1, 2010 11:33:39 AM
Rank: Advanced Member
Groups: Member

Joined: 5/15/2009
Posts: 33
Sorry I might sound impatient... But is there any progress on my question below... Adding a texbox to the header and typing in it. I figured out showing the textbox, but how can I type in it? I couldn't type into the header box...

<eo:TextBoxColumn DataField="StoreCallTime" HeaderText="Call Time <input name='txtAllCallTime' type='text' size='5' runat='server'>" Width="80" AllowSort="False" ClientSideBeginEdit="on_begin_edit_text">
<CellStyle CssClass="editableCell" />
</eo:TextBoxColumn>


Thanks!
eo_support
Posted: Thursday, April 1, 2010 11:38:23 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We are aware of the issue and we are still working on it. There may not be a solution at all but we will do our best to try finding one for you.

Thanks!
eo_support
Posted: Friday, April 9, 2010 5:14:49 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We have posted a new build that addressed this issue. Please see your private message for download location.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.