Showing posts with label contains. Show all posts
Showing posts with label contains. Show all posts

Wednesday, March 28, 2012

Change Tab Panel on Validation Failed.

Hai Guys,

I have 4 tab panels. The first panel contains all required fields. The other tabs having optional fields. My problem is, if some of the required fields are empty then the first tab is not shown, Its shows only currently selected tab. SetFocusOnError property is set to true in Required Field Validator. Tab container is placed inside UpdatePanel control. Please help me on this issue. Thanks in advance

Hi pbarunkumar,

The behavior you are expierencing is not the default behavior.

Could you please post a working code example which replicates this behavior? This way I can easily look into the problem!

Kind regards,
Wim


Hi Pbarunkumar,

The key to your problem is how to hide a Tab , so you should see my reply onthis thread. I have shown how to do it on the client and server side. Please be careful about the ActiveTabIndex property. When you hide the first tab, ActiveTabIndex must not be 0.

Best regards,

Jonathan

Change event in Ajax Update Panel

Dear All

If any event contains inside of the update panelthen after post back focus is lost. More clearly, LetTextbox1 and TextBox2 inside of the update panel.TextBox1 containsTextChanged event andthis event contains TextBox2.Focus(). But after post back it lost the focus.


Thanks

Aminul Bari

It should work just fine. Let me see if I understand what you are saying:

You've got an updatepanel.


Try to use SetFocus of ScriptManager

http://www.asp.net/AJAX/Documentation/Live/mref/O_T_System_Web_UI_ScriptManager_SetFocus.aspx


Thanks. Its working fine.

Change CollapsiblePanelExtender properties programatically within a DataList

I'm currently using CollapsiblePanelExtender within a DataList. The DataList contains a Label where the user will select to expand/contract theCollapsiblePanelExtender. TheCollapsedproperty withinCollapsiblePanelPropertiesis set tofalse. I would like to expandonly the first panel in the DataList when the page loads while the remaining panels remain collapsed.

I am intending to set theCollapsiblePanelPropertiesto true for the first item in the DataList within the DataList1_ItemDataBound event. How do I reference theCollapsiblePanelProperties as it does not contain an ID likeCollapsiblePanelExtender as I can not perform the following?

CollapsiblePanelProperties cpp =newCollapsiblePanelProperties();

cpp = (CollapsiblePanelProperties)e.Item.FindControl("CollapsiblePanelProperties");

Is there a different approach? Thanks in advance.

This has come up a couple of times in the past few days. A good solution when it works is something like "Extender1.GetTargetProperties(Control1)". I think that will work here, so please give it a try!

Thanks David. Extender1.GetTargetProperties(Control1) works!

Control1 being the TargetControlID of the CollapsiblePanelProperties. In my sample, Control1 is Panel1. Here is the code within the DataList1_ItemDataBound event for everyone...

if

(e.Item.ItemType ==ListItemType.Item){ CollapsiblePanelExtender ce =newCollapsiblePanelExtender();

ce = (

CollapsiblePanelExtender)e.Item.FindControl("CollapsiblePanelExtender1"); Panel pan =newPanel();

pan = (

Panel)e.Item.FindControl("Panel1"); if (e.Item.ItemIndex == 0){ CollapsiblePanelProperties cpp;

cpp = ce.GetTargetProperties(pan);

cpp.Collapsed =

false;

}

}

Saturday, March 24, 2012

CascadingDropDownList and ModalPopupExtender

I have created a ModalPopupExtender that contains 3 CascadingDropDownLists. The dropdowns work and are populated normally if I don't try and set a value. If I try and set a value for the first dropdown I get an ArgumentOutOfRangeException error. It seems like the value is trying to be set before the dropdown is populated. Does anyone know how I can fix this?

Thanks.

Nevermind. I got it.

CascadingDropDown: Fire an Event

I have created a custom control that contains 3 CascadingDropDown boxes.

I would like to have the control fire a custom event when each of the "TextChanged" or "SelectedIndexChanged" events from the Drop Down items change.

I have added the appropriate "events" into my code behind, but they do not seem to fire. Does the JavaScript intercept them?

Any help would be greatly appreciated.

Thanks,
Bryan

The Changed events you rever to are server-side events that only fire when there's a postback. By design, CascadingDropDown doesn't do postbacks. So you don't get those events when using it. You could force a postback, but doing so would seem to negate many of the benefits of the CDD.

Mr. Anson,

Perhaps you could point me in a better direction for my needs.

The Custom Control that I have created consists of 3 CascadingDropDowns that allow the user to select a Location, Skill, and Supervisor (basically this is like the Make/Model/Color sample for the car.).

My control works fine when I incorporate a button to run a report on a different page. My Button_OnClick event can see what values are in my control, and it will send them to the new page.

I would like to incorporate my current control on a page to help narrow down yet another Drop Down List.

In the CDD example, after the user selects the Make/Model/Color, I would like to pull a list of Vehicles by Year to select.

How would I go about hooking up a new CDD that requires the control to have filled in the Make/Model/Color before it can go out and find it's data?

I thought that I could do something like placing the control and drop down list inside an update panel, but I am a little fuzzy on how to continue from there.

Would I need to set up an Atlas Trigger?

Any help that you can provide would be greatly appreciated. It would even help if you could point me in a better direction.

Thanks, Bryan


Could you add a ByYear CDD that has the Color CDD as its parent? That way it automatically populates when the Make/Model/Color are filled in. And it's welcome to call a completely different web service, so it can get whatever data it wants.

If my Make/Model/Color are in a seperate control, how will I be able to give my Year CDD the parent that is inside the control? Can I just expose the CDD as a public member?

I don't want to add the Year CDD into my control. A different page may want to populate a different CDD from the data that the control provides.


You could manually hook some script up to the "onchanged" event on the client-side select element, but it's probably ultimately the same problem as above with respect to how the Year can see into the control to get the right elements.

CascadingDropDown With more then one parameter?

I am trying to use the CascadingDropDown drop down extender in a DataView.

I have three drop-downs where ddl1 contains the main lookup value. When I select ddl1, the second dropdown ddl2 populates perfectly. The problem that I have however is that the 3rd drop down is dependent on both the selected value in ddl1 and another value/column in the row. Does anyone know whether this is achievable with the CascadinDropDown extender at all? I guess i need a way to make the web service have more parameters and a way to pass the parameters to the webservice.

Any help would be highly appreciated!!

Does anyone know how I can get the Cascading DropDowns to have more then one parent id. I really need to figure out how to make the third drop down populate based on the value selected in the 1st drop down and another value from the grid... this must be acheivable.. I can't be the only one trying to do this...


Sorry, this scenario is not currently supproted by CDD.