Showing posts with label item. Show all posts
Showing posts with label item. Show all posts

Monday, March 26, 2012

TreeView within TabPanel - TabControl resets to first tab

Hi!

I have a TabPanel-Conrol with 3 TabPanels. In the 2nd and 3rd one I got a TreeView. Whenever I select an item of the treeview the TabControl "resets" itelself to the first Tab, which I don`t want of course. Did I miss something?

Regards and thanks,

Martin

Have a look at:http://forums.asp.net/thread/1579184.aspx

Wednesday, March 21, 2012

trying to add a popup/tooltip to an updatepanels gridview item

Hi everyone,

I have a Gridview that I want to place inside an update panel, but the current javascript tooltip calls bomb out. These calls are created dynamically (some results have the popup, others don't) and store text helping to explain the search results. Can someone lead me in the direction of what I need to be doing here or the control needed to make it work?

Try to take a look at the following links about javascript tooltip for reference.
http://www.walterzorn.com/tooltip/tooltip_e.htm#download
http://www.webreference.com/js/column16/
http://www.dustindiaz.com/sweet-titles
http://javascript.internet.com/generators/dhtml-tooltip-generator.html
http://tooltip.crtx.org/
Wish the above can help you.

Trying to make the CascadingDropDown read only

Hi, i'm trying to stop the CascadingDropDown value from being changed when the item the user is editing (via the formview control) is blocked. I notice there is no read only property on the DropDownList control or on the CascadingDropDown control so I figured the best way to do this was to disable the control and add a hidden field which would post the original value back.

<asp:Label ID="lblSectionIDValue" runat="server" Text='<%# Eval("SectionName") %>' Visible='<%# (bool)Eval("Blocked") %>'></asp:Label>
<asp:HiddenField ID="hfdSectionID" runat="server" Value='<%# Bind("SectionID") %>' Visible='<%# (bool)Eval("Blocked") %>' />
<asp:DropDownList ID="lstSectionID" runat="server" Visible='<%# !(bool)Eval("Blocked") %>'>
</asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="cddSectionID" runat="server" TargetControlID="lstSectionID" Category="Section" PromptText="-- Please Select --" LoadingText="[Loading sections...]" ServicePath="~/CascadingDropdownsService.asmx" ServiceMethod="GetSectionsList" SelectedValue='<%# Bind("SectionID") %>' Enabled='<%# !(bool)Eval("Blocked") %>' />

However a null value is being posted back instead of the original value. I've tried just about every combination now but nothing works. Without the CascadingDropDown control i can successfully say:

<asp:HiddenField ID="hfdSectionID" runat="server" Value='<%# Bind("SectionID") %>' Visible='<%# (bool)Eval("Blocked") %>' />
<asp:DropDownList ID="lstSectionID" runat="server" SelectedValue='<%# Bind("SectionID") %>' Enabled='<%# !(bool)Eval("Blocked") %>'>
</asp:DropDownList>

which posts the value back.

I think there is a bug in that some value is being sent back if the CascadingDropDown's enabled property is set to false and is overriding the value in the hidden field.

Hi here's a fix which creates a new property called EnabledOverride and works like the Enabled property for the standard controls such as the TextBox.

Edit CascadingDropDownExtender.cs:
============================

Add
-----
private const string stringEnabledOverride = "EnabledOverride";
-----

Add
-----
[DefaultValue("")]
[ExtenderControlProperty()]
public bool EnabledOverride
{
get
{
return GetPropertyValue(stringEnabledOverride, true);
}
set
{
SetPropertyValue(stringEnabledOverride, value);
}
}
-----

Edit CascadingDropDownBehaviour.js:
============================

Add
-----
this._enabledOverride = null;
-----

Add
-----
get_EnabledOverride : function() {
/// <value type="String">
/// Whether the drop down is enabled
/// </value>
return this._enabledOverride;
},
set_EnabledOverride : function(value) {
if (this._enabledOverride != value) {
this._enabledOverride = value;
this.raisePropertyChanged('EnabledOverride');
}
},
-----

Add (at the bottom of _setOptions function)
-----
_setOptions function (at the bottom):

// Disable the control if not enabled
if (!this._enabledOverride) {
e.disabled = true;
}
-----

Hope this helps you as much as it has me :).


You can try enclosing dropdown and cascadingdropdown in a server Div:





           <div runat="server" id="divEstado">



                                <asp:DropDownList ID="ddlEstado" runat="server" ></asp:DropDownList>



                                <cc1:CascadingDropDown ID="cddEstado" runat="server" TargetControlID="ddlEstado"



                                Category="Estado" PromptText="[Select value...]" ServicePath="Services.asmx"



                                ServiceMethod="FillData" UseContextKey="true" ParentControlID="ddlPais" /> 



          </div>



Disabling in code behind:



divEstado.Disabled = true;



Disabling in javascript:



$get('<%=divtrEstado.ClientID%>').disabled = 'disabled';


You can try enclosing dropdown and cascadingdropdown in a server Div:





           <div runat="server" id="divEstado">



                                <asp:DropDownList ID="ddlEstado" runat="server" ></asp:DropDownList>



                                <cc1:CascadingDropDown ID="cddEstado" runat="server" TargetControlID="ddlEstado"



                                Category="Estado" PromptText="[Select value...]" ServicePath="Services.asmx"



                                ServiceMethod="FillData" UseContextKey="true" ParentControlID="ddlPais" /> 



          </div>



Disabling in code behind:



divEstado.Disabled = true;



Disabling in javascript:



$get('<%=divtrEstado.ClientID%>').disabled = 'disabled';