Showing posts with label display. Show all posts
Showing posts with label display. Show all posts

Wednesday, March 28, 2012

Dynamic display behaviors for dragDropList

I'm using the drag drop list to allow my users to reposition report elements. The problem that I am having is that different zones have different sizes and we would like our draggable elements to resize to fill the zone in which they are dropped. Unfortunately, the controls are retaining their original sizes when moved to a different drop zone.

Furthermore, we have implemented som cascading styles to allow the controls to change appearance depending on which zone they have been places. This is not working either, the controls always retaing the style of the zone in which they were originally placed.

Any suggestions?

Yeah, you should build a behavior that implements the IDropTarget interface, and assign that behavior to whatever Divs you've go tthat are going to be the drop zones for your parts. The custom behavior you build has to implement this.drop() , among others, and that funciton will define what happens when something's dropped on it. My guess is that you'd build logic into the drop() method that tells the div that was dropped to resize / restyle itself, possibly by just changing the cssClass . Check out this article: http://www.codeproject.com/Ajax/AtlasDragNDrop.asp for more info.

Dynamic Change Between 100 Text Labels

Hello there..

I want to use AJAX dynamic lets get started..

I have 100 Quots that i want AJAX to Random select one and display and after 10 Sec. i want i to select another...

Is that possible? and if yes how??

Hope someone know how to do that..

/MJ Out

Please look at the timer control.

http://ajax.asp.net/docs/tutorials/IntroToTimerControl.aspx

Cheers



BenRush:

Please look at the timer control.

http://ajax.asp.net/docs/tutorials/IntroToTimerControl.aspx

Cheers


Ive tried that.. but how do i define more labels?? and make it random select one? sry for asking but im a noob :)


Anyone? :D Come on.. there is many smart heads in here.. one of them have to know how...

*Bump*

anyone? or isnt it possible

Monday, March 26, 2012

DropShadowExtender display issue

Im jsut playing about with the drop shadow extender and when i come to use it for the first time i have hit a major snag.

I have bound it to a panel which contains some text, when i run the page, i get the rounded corners of the panel, but the shadow (or I shoud say a black image the same size of the panel) appears about an inch lower down on the screen and not even remotely connected to the panel, let alone behind it to give a shadow effect.

Anyone else run into this?

I am having the same issue. Is there a solution to this?



...Have you tested this in both IE7 and FireFox?

If it displays properly in one but not the other it's probably due to HTML rendering.

You can resolve this behavior by removing HTML tags, especially tags like HTML header tags.
Replace them with ASP.NET CSS, then they should render properly in the toolkit div sections.


Yes, it's hosed the same in Firefox.

Surely someone, somewhere is using this thing somehow got it working outside of the samples.

I've recreated this page four times now and it's still not working correctly.

Wednesday, March 21, 2012

dropdownlist in a tabpanel to display data from previous tabpanel

Hello All,

I have a DropDownList in one of my tab panels. The data to this dropdown is provided by a datasource. The data to this datasource is filled in one of the other tab panels. Since the contents of the other tab panel are inside an update panel, a full postback doesnt take place and hence my dropdown does not show any data that was added in the previous tab(unless you do a refresh on the page). Can anyone help me solve this issue with any suggestions? (I tried using the OnPreRender of the dropdownlist to bind the datasource but still it wouldnt display the most recently added data)

Any help will be greatly appreciated.

Thanks,

Nicky

Hi Nicky, Can you provide a small sample to illustrate it?

Raymond Wen - MSFT:

Hi Nicky, Can you provide a small sample to illustrate it?

Hello Raymond,

Sure. Here are the two Tab Panels that I amtalking about. The 'DetailsView' with ID "SpecializationCodeView1" onthe first tab panel inserts data and the 'DropDown' with ID"DropDownList2" on the second tab panel should display the inserteddata.

I could not use the same DataSourceID for these twocontrols since I am using "<%# Bind("specializationCode") %>" forthe dropdown andby doing so it gives me an error "Functions like Eval(), Bind() etc. can be used only with databound objects" while inserting data.

Can you please help?

Thanks,

Nicky

<ajaxToolkit:TabPanel ID="TabPanel4" runat="server">
<HeaderTemplate>Specializations</HeaderTemplate>
<ContentTemplate>
<asp:UpdatePanel ID="SpecializationGridUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="SpecializationGrid" runat="server"DataKeyNames="id" DataSourceID="SpecializationDataSource2"
GridLines="Horizontal" Width="314px">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
<asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SpecializationCodeView1" EventName="ModeChanged" />
</Triggers>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="SpecializationViewUpdatePanel" runat="server">
<ContentTemplate>
<asp:DetailsView ID="SpecializationCodeView1" runat="server" AutoGenerateRows="False"
CellPadding="3" DataKeyNames="id" DataSourceID="SpecializationDataSource2" DefaultMode="Insert">
<Fields>
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" />
<asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
<asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>
</ajaxToolkit:TabPanel>

<ajaxToolkit:TabPanel ID="TabPanel5" runat="server" >
<HeaderTemplate>
Sub Specializations
</HeaderTemplate>
<ContentTemplate>
<br />
<asp:UpdatePanel ID="SubSpecializationGridUpdatePanel" runat="server">
<ContentTemplate>
<asp:GridView ID="SubSpecializationGrid"runat="server" DataKeyNames="id"DataSourceID="SubSpecializationDataSource"
GridLines="Horizontal">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" Visible="False" />
<asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
<asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
<asp:BoundFieldDataField="specializationCode" HeaderText="specializationCode"SortExpression="specializationCode" />
</Columns>
</asp:GridView>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="SubSpecializationsView" EventName="ModeChanged" />
</Triggers>
</asp:UpdatePanel>
<br />
<asp:UpdatePanel ID="SubSpecializationInsertUpdatePanel" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:DetailsView ID="SubSpecializationsView" runat="server" AutoGenerateRows="False"
DataKeyNames="id" DataSourceID="SubSpecializationDataSource"
DefaultMode="Insert" GridLines="Horizontal" Height="50px" Width="125px">
<Fields>
<asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" ReadOnly="True"
SortExpression="id" />
<asp:BoundField DataField="code" HeaderText="code" SortExpression="code" />
<asp:BoundField DataField="description" HeaderText="description" SortExpression="description" />
<asp:TemplateField HeaderText="specializationCode" SortExpression="specializationCode">
<EditItemTemplate>
<asp:Label ID="Label1"runat="server" Text='<%# Eval("specializationCode")%>'></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="SpecializationDataSource"
DataTextField="description"DataValueField="code" SelectedValue='<%# Bind("specializationCode")%>'>
</asp:DropDownList>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1"runat="server" Text='<%# Bind("specializationCode")%>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ShowInsertButton="True" />
</Fields>
</asp:DetailsView>
</ContentTemplate>
</asp:UpdatePanel>
</ContentTemplate>

</ajaxToolkit:TabPanel>

</ajaxToolkit:TabContainer>


I can't run the code directly.

But may be you can try to force the updatePanel that contains the DDL update in the ItemInserted event of the DetailsView?


protected void SpecializationCodeView1_ItemInserted(object sender, DetailsViewInsertedEventArgs e)
{
UpdatePanel up = tabContainer1.Tabs[1].Controls[0].FindControl("SubSpecializationInsertUpdatePanel") as UpdatePanel;
up.Update();
}


bvc xvbvx xvbcvcbcv cvb
bvc xvbvx xvbcvcbcv cvb

dropdownlist

Hello All,

I have three dropdownlists and a textbox on my web page. The dropdownlists display the Day/Month/Year respectively.

I set the dropdownlists to display today's date when the page loads and the textbox displays the values from the dropdownlists as a single string value.

How can i dynamically change the dates in the dropdownlist for example ( instead of december 2007 to december 2008)and have the new changes displayed in the textbox?

The easiest way is to put your textbox inside an update panel like this:

 

<asp:UpdatePanelID="updPanel"runat="server"UpdateMode="Conditional">

<ContentTemplate>

<asp:TextBoxID="txtDate"runat="server"/>

</ContentTemplate>

<Triggers>

<asp:AsyncPostBackTriggerControlID="DropDownList"EventName="SelectedIndexChanged"/>

</Triggers>

</asp:UpdatePanel>

Now in the SelectedIndexChanged event handler, just set the textbox to the new text. That's it!


Thanks oswaldorb,

It works but not as i want it to.

I would like the default date to be the current date for example 13/12/2007 when the page loads initially.

But when i try to do change the default date, i get an error

Please help!