Showing posts with label headers. Show all posts
Showing posts with label headers. Show all posts

Wednesday, March 28, 2012

Accordian and Gaps between headers

Im sure that this issue has probably been addressed before, but if it has, could someone point me to the relevant post.

I have got an Accordian which is placed within a tablecell, and I have gap between the headers when first viewed. These gaps disappear when the accordian is used, or when I place the accordian outsde the table.

The accordian sample says "If you place the Accordion inside a <table> tag and have FadeTransitions set to true in Internet Explorer 6, it will affect the spacing between Accordion Panes."but I am viewing it in IE7 and have FadeTransitions set to false.

How can I get round this without removing the accordian from the table?

Thanks

Any ideas anyone?

Thanks


Sorry, this is not post with a solution, but a further gripe.

If an accordion is placed in web part (which renders eventually as a <table>), the same problem occurs. Its just taken several hours to zero in on identifying the conditions under which it happens.

The effect I see is that 10 pixels high spaces are suddenly added to the gaps between closed accordion panels when the mouse moves outside the accordions area. (Even a right click will do it). This always happens when the accordion is inside a <table>. I've searched everywhere for a surreptitious 10px padding (or two 5px ones) in the AjaxControlToolkit, in case it was being sneaked in somehow, to no avail.

Using the IE Developer Toolbar allows the space to be accurately measured and outlines the area in question quite nicely, but offers no clue as to why the gap appears.

The accordion works beautifully if there is no <table> in sight.


I know in html if there are white spaces between the table cells and an image a gap appears, which is rather annoying

ie:

<td>
<img>
</td
will have a gap, but

<td><img></td>

there is no gap, so I am assuming that this is what is happening when the Accordian is put into a table.Crying


I had this problem also. Just use nested tables. Eaxmple:

<table>

<tr><td><img src="http://pics.10026.com/?src=whatEver"></td></tr> <------- This gives you the white gap!

<tr><td><table><tr><td><img src="http://pics.10026.com/?src=whatEver"></td></tr></table><td><</td></tr> <---Should solve the problem

<table>

This only happens when using an image in the accordian. See if this helps!


I just switched over to the new release of the toolkit version 10301 released March 1. Although it is not listed as an issue that was corrected, this strange spacing problem between the according panes has gone away for me. Unfortunately now the accordion only works in IE7. When I use IE6 the accordion is visible as the page is loading, but once the page finishes loading, the entire accordion disappears.

Here is the link for the new release... (if you dare)...

http://www.codeplex.com/AtlasControlToolkit/Release/ProjectReleases.aspx?ReleaseId=1425

Billy

Accordian (indicators like collapsible panel)

I am sure this has come up - is there a way to add indicators on the accordian panel headers link we have on the collapse panel ?

Hi Codegalaxy,

Yes , as far as I know, we can do it by using Javascript. Here is my sample with shows how to hide a Panel when click on the Button.

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> </script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Accordion</title> <style> .accordionHeader { border: 1px solid #2F4F4F; color: white; background-color: #2E4d7B; font-family: Arial, Sans-Serif; font-size: 12px; font-weight: bold; padding: 5px; margin-top: 5px; cursor: pointer; } .accordionContent { background-color: #D3DEEF; border: 1px dashed #2F4F4F; border-top: none; padding: 5px; padding-top: 10px; } .accordionLink { background-color: #D3DEEF; color: white: } </style></head><body> <form id="form1" runat="server"> <ajaxToolkit:ToolkitScriptManager runat="server" ID="ScriptManager1" /> <div> <asp:RadioButton ID="RadioButton1" runat="server" GroupName="Acc" Text="Accord1" onclick="chageAccordion()"/><asp:RadioButton ID="RadioButton2" runat="server" GroupName="Acc" Text="Accord2" onclick="chageAccordion()"/> <ajaxToolkit:Accordion ID="MyAccordion" runat="server" HeaderCssClass="accordionHeader" ContentCssClass="accordionContent" FramesPerSecond="40" TransitionDuration="250" AutoSize="None" SelectedIndex="0" RequireOpenedPane="false" SuppressHeaderPostbacks="true" > <Panes> <ajaxToolkit:AccordionPane ID="AccordionPane1" runat="server" > <Header> Panel1</Header> <Content> PanelContent1</Content> </ajaxToolkit:AccordionPane> <ajaxToolkit:AccordionPane ID="AccordionPane2" runat="server"> <Header> Panel2</Header> <Content> PanelContent2</Content> </ajaxToolkit:AccordionPane> <ajaxToolkit:AccordionPane ID="AccordionPane3" runat="server"> <Header> Panel3</Header> <Content> PanelContent3</Content> </ajaxToolkit:AccordionPane> </Panes> </ajaxToolkit:Accordion> <input id="Button1" type="button" value="button" onclick="hidePanel()"/> <script type="text/javascript" language="javascript"> var accordion; function chageAccordion(){ if(accordion==null) accordion = $find('MyAccordion_AccordionExtender'); if($get("<%= RadioButton1.ClientID%>").checked){ accordion.set_SelectedIndex(0); } else{ accordion.set_SelectedIndex(1); } } function hidePanel(){$find('MyAccordion_AccordionExtender').get_Pane(0).header.style.display="none"; //add your HTML Code here. $find('MyAccordion_AccordionExtender').get_Pane(0).content.style.display="none"; $find('MyAccordion_AccordionExtender').set_SelectedIndex(1); } </script> </div> </form></body></html>

Please pay your attention to the Bold part. You can do some similar things here.

I hope this help.

Best regards,

Jonathan

Accessing Request headers from asp.net web service, invoked using Ajax

I need a small help.

I have a web service, in which I have a web method, which detects the browser locale using asp.net request object.

If I invoke the web service directly from the browser, I am able to get the browser language from Request object'sHTTP_ACCEPT_LANGUAGEheader.

But If I invoke the same web method from some aspx using javascript XMLHttpRequest, I always get the request headerHTTP_ACCEPT_LANGUAGE null.

Is this the behavior of the web services.

Then how can I access the browser language setting for the current request in the web service.

Is there a way to invoke the web service with the same request settings as that of aspx page while using xmlhttp.

Thanks in Advance

Hi,

I saw that you got this issue answered byJohn Saunders athttp://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2341086&SiteID=1, Here is quotation:

You are unlikely to receive a browser language setting if the web service is not called from a browser.

Wednesday, March 21, 2012

A premium AutoComplete for AJAX?

Is there anyway to emulate the complete functionality of the comboBox control in MS Access that includes Autocomplete, column headers etc? I've seen some 3rd party ones, but am not at liberty at my company to acquire them.

I've used the autocomplete extender but I really need the column headers and "not-in-list" event. I was thinking I could use a datagrid or datalist to emulate this.

hi,

check this

http://ajax.asp.net/ajaxtoolkit/AutoComplete/AutoComplete.aspx


I'm sorry. I guess I should have mentioned thathttp://ajax.asp.net/ajaxtoolkit/AutoComplete/AutoComplete.aspx was mystarting point.
Presently, I am showing Cost Center numbers in one column. What I would like to do is have an additional column that displays a name description. If I were to add yet a third column, which is a possibility, it would just be nice to be able to display the column headers just as you do in Microsoft Access.


Here's what I have so far in the autocomplete.asmx (ONE column) , please help me adjust this for additional columns.

<%@.WebServiceLanguage="VB"Class="autocomplete" %>

Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections.Generic

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<System.Web.Script.Services.ScriptService()> _

PublicClass autocomplete
Inherits System.Web.Services.WebService

<WebMethod()> _

PublicFunction GetSuggestionsFromDataset(ByVal prefixTextAsString,ByVal countAsInteger)AsString()

' Define data set

Dim dsAsNew DataSet()
Dim dtAsNew DataTable()
Dim drAs SqlDataReader = PurchasingBLL.GetCostCenters
Dim daAsNew PurchasingTableAdapters.tbl_CostCenterTableAdapter ds.Tables.Add(dt)
dt.Columns.Add(New DataColumn("Word",GetType(String)))
dt.Rows.Add("Cost Center")

DoWhile dr.Read
dt.Rows.Add(New ListItem(dr("FullCCNum")))
Loop

Dim suggestionsAsNew List(OfString)()
Dim wordsAs DataRow() = dt.[Select]("Word LIKE '" + prefixText +"%'")
Dim numAsInteger = IIf((words.Length < count), words.Length, count)

For iAsInteger = 0To num - 1
suggestions.Add(DirectCast(words(i)("Word"),String))
Next

Return suggestions.ToArray()

EndFunction

EndClass

I suppose I could put a "label" or something underneath the textbox, but I notice that the extender attaches exactly "Flushed" at the bottom, so I probably have to do some trickery to make that happen. Any suggestions?


This is not currently supported. We do want to allow users to set custom datatypes in the autocomplete flyouts bound to item templates but we are still investigating that approach.


Ok, then what about something less daunting like perhaps just helping me add another column in the web service?
I'm confused of the exact useage of the array ("suggestions") that was provided in the example.

I tried this, but it still only returns one column, - and as you can see, I haven't touched the "Suggestions" array.
Or -- is adding column headers specifically what is not supported?

dt.Columns.Add(New DataColumn("Word",GetType(String)))
dt.Columns.Add(New DataColumn("Descr",GetType(String)))

dt.Rows.Add("Cost Center")
DoWhile dr.Read
dt.Rows.Add(New ListItem(dr("FullCCNum")))
Loop

dt.Rows.Add("Description")

DoWhile dr.Read
dt.Rows.Add(New ListItem(dr("CC_Descr")))
Loop


Hi, may be you can consider returning a string array can represent the result in a well formated way?

For instance:

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
string[] words = prefixText.Split(new char[] { ';' });
string[] result = new string[16];
for (int i = 0; i < 16; i++)
{
result[i] = datarow["column1"] + "\t[ Use a tab to separate different columns ]" + datarow["column2"] ;
}
return result;
}


Would you mind translating to Visual Basic-- I have a translator, but it doesn't like that usage of datarow:

PublicSharedFunction GetCompletionList(ByVal prefixTextAsString,ByVal countAsInteger)AsString()
Dim wordsAsString() = prefixText.Split(NewChar() {";"c})
Dim resultAsString() =NewString(15) {}

For iAsInteger = 0To 15
result(i) = DataRow("column1") +"" & Chr(9) &"[ Use a tab to separate different columns ]" + DataRow("column2")
Next

Return result

EndFunction