Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
382 views
Hi,

I have a column field in SQL Server database which is a string file, which contain phone number (11 digits, for example: 12223334444). In RadGrid, I used following code to format the number to display in RadGrid as a proper telephone number:

 

protected void RadGridResult_ItemDataBound(object sender, GridItemEventArgs e)

{

    //Format string to phone number.

    if (e.Item is GridDataItem)

     {

 

         GridDataItem item = (GridDataItem) e.Item;

        Object ob = item["ConfirmationLogPhone"].Text;

        if (!Convert.IsDBNull(ob))

         {

 

                Int64 iParsedValue = 0;

                if (Int64.TryParse(ob.ToString(), out iParsedValue))

                 {

                        TableCell cell = item["ConfirmationLogPhone"];

                         cell.Text =

                String.Format(System.Globalization.CultureInfo.CurrentCulture, "{0:#-(###) ###-####}", new object[] { iParsedValue });

                 }

         }

     }

}

 

However, when I export the grid to excel, the number is display merely just a string (Ex: 12223334444). MS Excel even report error that "Number stored as text field" on every cell in the column.

Would you please tell me how to format and export string of telephone number to excel properly?

Thanks

LamK
Daniel
Telerik team
 answered on 01 Jul 2011
1 answer
135 views
I have an aspx page with 2 RadListBox controls.  AllowTransfer = true for RadListBox1.  RadListBox1 gets populated from a database and is also tied to a TextBox used as a filter. 

After transfering items from RadListBox1 to RadListBox2 by clicking the client-side arrow button that gets displayed with RadListBox1 I can see the items on the client side of RadListBox2. but these items are not accessible on the server side. 

I need to get server-side access the new items in RadListbox2 during a postback in order to pass them to another method ... but the server-side items colleciton is empty.

Setting a breakpont I do see a value in RadListBox2.ClientChanges ... and an array like this:

>? RadListBox2.ClientChanges

Count = 2

[0]: {Telerik.Web.UI.ClientOperation<Telerik.Web.UI.RadListBoxItem>}

[1]: {Telerik.Web.UI.ClientOperation<Telerik.Web.UI.RadListBoxItem>}

Is there a way to access these items in a server side postback?  Thanks

Steve
Top achievements
Rank 1
 answered on 01 Jul 2011
2 answers
88 views
Is it possible to keep the word being spell checked visible when going to the Changed Manually option textbox when using the spellchecker?  This would make it so the user can see the original word, while also being able to change it in the Changed Manually textbox.

Thank you for your help.

Aaron
Aaron
Top achievements
Rank 1
 answered on 01 Jul 2011
6 answers
1.3K+ views
Hi,

I am trying to disable a submit button from the client side. I am using the following code:
function OkClicked(sender, args) {
 
           document.getElementById("<%=btnConfirm.ClientID %>").set_enabled(false);
 
        }

This is the markup for the button:
<telerik:RadButton ID="btnConfirm" runat="server" OnClick="btnConfirm_Click" Enabled="true">
<Icon SecondaryIconCssClass="rbOk" SecondaryIconRight="4" SecondaryIconTop="4" />
</telerik:RadButton>

When the button gets clicked it deosn't get disabled, but does a postback.I also tried the following script:
document.getElementById("<%=btnConfirm.ClientID %>").disabled = true;

In this case the button APPEARS disabled, but still responds to clicks and any other events (like hover).

What's going on here?

v
Viktor Takacs
Top achievements
Rank 2
 answered on 01 Jul 2011
3 answers
70 views
I've followed the example at http://demos.telerik.com/aspnet-ajax/panelbar/examples/populatingwithdata/databindings/defaultvb.aspx to add a RadPanelBar and RadPanelItems to a SharePoint 2010 page without any success. The RadPanelBar doesn't show on the page when I give values to DataFieldID & DataFieldParentID. No error given. When I leave those properties blank and set DataTextField="Title" then I get the menu but only the 1st level.

Instead of an SQLDataSource I'm using an SPDataSource. The spdatasource does work however, with an asp:DropDownList control.

Are there issues with RadpanelBar and SPDataSource?
Kalina
Telerik team
 answered on 01 Jul 2011
9 answers
268 views
Hello,

I have a tab strip of five tabs, each has a user control dynamically loaded into a corresponding multi page.  Each of the user control's has it's own validation, and when I click a button that causes validation, I only want it to validate that particular user control, with javascript.  Everything is set up properly as far as the validation controls, but every tab validates when I only want the currently selected tab to validate.  Can anyone help me on this?
Rory
Top achievements
Rank 1
 answered on 01 Jul 2011
3 answers
116 views
Hey guys...hope you can help with this one.

I've got a RadTreeView control inside a fieldset. For the purposes of this request I cannot change how the project is organized :)  The problem is, in IE only of course, the TreeView overlaps content below the fieldset as it is expanded (image attached).

This problem goes away if I remove the fieldset! Is there any redraw or refresh events that I can trigger on the TreeView that will solve this issue?

Occurs in IE8 in both regular and compatibility modes. 

Ivan Zhekov
Telerik team
 answered on 01 Jul 2011
2 answers
35 views

Hello,

I've added 9900 + words to the default .TDF dictionary file using the Dictionary Configurator downloaded from another forum here at Telerik.

While testing some of the words, all medical in nature, I don't seem to have consistent suggestions.

For example I enter
zygapophy and I should get zygapophyseal, zygapophyses, and zygapophysis as suggestions but I only receive the last two. In my dictionary I have the following entries:

zygapophyses:SKPF:SKPF
zygapophysis:SKPF:SKPF
zygapophyseal:SKPF:SKPF

I have a total of 159,596 words in the default .TDF file. Using the Custom Dictionary is not an option because of my security/network set up.

I loaded a list of words into a word document with a .TXT extension then used the Dictionary Configurator to load all of them to the existing .TDF list - this was successful. I used the DC to test this same scenario and it works perfectly but in my application I'm experiencing the issue I stated above - missing zygapophyseal from the suggestion list.

I assume the spell checker uses the second and third columns to help group words for the suggestion list, but in this case it seems not to work correctly.

Have any ideas/suggestions?

Thanks in advance,

Dan

PS. I'm using VS.Net 2008 and C#

Dan
Top achievements
Rank 1
 answered on 01 Jul 2011
1 answer
69 views
Hi All

I was looking for a way to loop the entire grid and count all checked fields,
i came up with the following fucntion and i thought i would post it here in case anyone could use it.

Regards

Cush

Private Function Get_CountGridCheckBox(ByVal SelGrid As RadGrid, ByVal ColName As String, ByVal ChkBoxVal As Boolean) As Integer
        Dim RtnVal As Integer
        Dim currentPageIndex As Integer = SelGrid.CurrentPageIndex
        'Set initial value to zero
        RtnVal = 0
  
        For i As Integer = 0 To SelGrid.PageCount - 1
  
            ' Loop current page and count check box values
  
            For Each item As GridDataItem In SelGrid.Items
                Dim CheckBx As CheckBox = DirectCast(item(ColName).Controls(0), CheckBox)
                Dim CheckBxVal As Boolean = CheckBx.Checked
  
                If CheckBxVal = ChkBoxVal Then
                    RtnVal += 1
                End If
  
            Next
  
  
            ' Go to next Grid page
            currentPageIndex += 1
            If currentPageIndex >= SelGrid.PageCount Then
                currentPageIndex = 0
            End If
  
            SelGrid.CurrentPageIndex = currentPageIndex
            SelGrid.Rebind()
  
        Next
  
        'Return Result
        Return RtnVal
    End Function
Genti
Telerik team
 answered on 01 Jul 2011
2 answers
71 views
Hi all,

Currently, when user clicks on one row of RadGrid, it will be selected.
I don't want that function, just want to use the Checkbox only
Are there any ways to eliminate it?

Thanks.

Andy.
Andy
Top achievements
Rank 1
 answered on 01 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?