Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
268 views
Hi all
In the detailView control'd template, I am using a RadComboBox with its SelectedValue binded.
When the binded column in the dataSource returns NULL it throws an exception. Is there a way to setup the RadCombo so to display nothing (empty string) when the binded value is NULL (Database null or .NET nullable type)?
Veselin Vasilev
Telerik team
 answered on 22 May 2008
1 answer
152 views
Hi

I'm hoping that someone might be able to assist. Basically i'm using the dock control on my home page with 3 coloumn (each column being a dockingzone). the columns on  the LHS and RHS are set to a width of 280px and the middle is set to a width of 100%.

In one of my docks, for example (see code below) i basically have blocks(panels) in divs which text wrap when moving the doc from eg the middle zone to the RHS or LHS zone, this basically allows the block to align horizontaly when in the middle and verticaly when on RHS or LHS.

Now what my problem is that i want to be able to center the divs in the dock control even though i using the float : left property as i require it to produce the "text wrap" functionality of each block. So when the dock is in the center column the blocks center correct and don't go to left is this possible?

<

div id="divInbox" runat="server" style="float: left; width: 250px;">
<
asp:Panel ID="pnlInbox" runat="server" Visible="True">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td align="center" style="width: 74px" valign="middle">
<asp:ImageButton ID="btnInbox" runat="server" ImageUrl="/cop/portal/images/gfx_myInbox.gif"  />
</
td>
<td>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td style="height: 25px">
<asp:LinkButton ID="lnkInbox" runat="server" CssClass="midLink"> Inbox</asp:LinkButton>
</
td>
</tr>
<tr>
<td class="homeLabelnotBold">
View messages you have received.</td>
</tr>
</table>
</td>
</tr>
</table>
</asp:Panel>
</
div>

<div id="divOutbox" runat="server" style="float: left; width: 250px;">
<
asp:Panel ID="pnlOutbox" runat="server" Visible="True">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td align="center" style="width: 74px" valign="middle">
<asp:ImageButton ID="btnOutbox" runat="server" ImageUrl="/cop/portal/images/gfx_myOutbox.gif"  />
</
td>
<
td>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td style="height: 25px">
<asp:LinkButton ID="lnkOutbox" runat="server" CssClass="midLink">Outbox</asp:LinkButton>
</
td>
</tr>
<tr>
<td class="homeLabelnotBold">
View messages you have sent to recipients.</td>
</tr>
</table>
</td>
</tr>
<
/table>
</asp:Panel>
</
div>

Sophy
Telerik team
 answered on 22 May 2008
3 answers
333 views

Hi,

I have one default page (default.aspx) inside that i have one user control containing rad grid.
On click of the link button (which is one column in grid) i am opening the rad window.
On click of update button (which is inside rad window ) i want to close the rad window and refresh the calling page (default.aspx).

It closes the rad window but could not refresh the calling Page(Default.aspx).
Please assist.

Code in rad window.
<script type="text/javascript">
   function CloseAndbind(status) 
        { 
                   
            var obj = GetRadWindow();
            obj.CallBack(status);
        } 
         
        function GetRadWindow() 
        { 
            var oWindow = null; 
            if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog 
              else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;//IE (and Moz az well) 
            return oWindow; 
        } 
    </script>

code in calling page (default.aspx)

<script type="text/javascript">

        function CallBackFunction(radWindow,returnValue1)
        {            
            callButtonClick();          
        }
        function callButtonClick()
        {
         var _btn = document.getElementById('<%= Button1.ClientID%>');     
   _btn.click(); 
   
        }
</script>

        
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behaviors="Close,Move,Reload"
          Modal="true" Animation="None" ClientCallBackFunction="CallBackFunction" ShowContentDuringLoad="true" VisibleStatusbar="true"
               Skin="WebBlue">
           <Windows>
                <telerik:RadWindow Width="910px" Height="640px" ClientCallBackFunction="CallBackFunction"
                 Runat="server" Id="Radwindow1"
                            VisibleStatusbar="false" >              
                </telerik:RadWindow>
           </Windows> 
</telerik:RadWindowManager>

Rahul Khinvasara
Top achievements
Rank 1
 answered on 22 May 2008
7 answers
192 views
hi team
how can i add a link button on the radockable object title bar

thanx in advance
sam
Top achievements
Rank 1
 answered on 22 May 2008
10 answers
408 views
I am collecting feedback from other users of RadScheduler to find out how far beyond the examples you take database access to create and edit appointments.  In the telerik demos they are heavily dependent on the Radscheduler control and providers.  Has anyone gone outside of this and done a large amount of schedule and resource manipulation directly with the database tables not using the control but having pages that employ it for GUI purposes?  Has anyone found joy or pitfalls in this approach?  Code examples are still minimal so I'm curious what other users are doing.

I am using MS SQL 2005 and ASP.NET with C#.

Thanks in advance.
Doug
Peter
Telerik team
 answered on 22 May 2008
1 answer
205 views
Hello Sir,

I call tree client-side object on "window.onload" event.
However, it return null...( I think the reason is the tree object is not initialized yet )

Therefore, I put my code on "pageLoad" event, and it works well.

My question is where is the best place that my code will be executed after the tree client-side object is  initialized?? 

Moreover, I have read the document of asp.net ajax.  It say

"Raised after all scripts have been loaded and all objects in the application that are created by using $create are initialized. The load event is raised for all postbacks to the server, which includes asynchronous postbacks."

I have put some code inside the pageLoad event, but it doesn't be executed after loading new nodes (load-on-demand, with webservice)
Why? I thought it should be executed after asynchronous postbacks.

Thank you


Atanas Korchev
Telerik team
 answered on 22 May 2008
1 answer
172 views
Is it possible to not apply the format string to column when in edit more.

I am trying to edit a column that has monetary values. I want it to display with the $ in regular view, but since I am updating into a decimal field, I do not want it displayed in edit mode.

Or

If there is a way to change the value before it gets submitted to the datasource so I don't get an error saying the field has the wrong type

Thanks!
Konstantin Petkov
Telerik team
 answered on 22 May 2008
1 answer
258 views

I am trying to upload files to a database and then let the user download them again.

But when I upload a small file, it seems like only few kB actually make it into the database. The progress bar shows up for a split second only and then disappears. The entry is written is to the database but the binary content is too small.

When I upload a large file (e.g. 10 MB), I get a "page cannot be displayed" error.

Any idea? Thanks so much! s.


Here's some code:

aspx:

<

telerik:RadUpload ID="RadUpload" runat="server" Skin="Telerik" InitialFileInputsCount="1" Width="620px" ControlObjectsVisibility="None" InputSize="100" OverwriteExistingFiles="True" />


cs:

protected void SaveButton_Click(object sender, EventArgs e)  
    {  
        if (RadUpload.UploadedFiles.Count > 0)  
        {  
            // Obtain the USER ID from the Session  
            this.userid = HttpContext.Current.Session["USERID"].ToString();  
            if (String.IsNullOrEmpty(this.userid))  
                this.userid = SATConfiguration.LocalUser;  
 
            // Obtain the description and clear it of "junk"  
            this.description = Regex.Replace(this.DescriptionTextBox.Text, "[\t\r\n\v\a\b\f\0\\\'\"]", String.Empty, RegexOptions.Compiled);  
 
            // Get the file and its name  
            file = RadUpload.UploadedFiles[0];  
            filefilename = file.GetName();  
 
            //Read the file  
            bytes = new byte[file.InputStream.Length];  
            file.InputStream.Read(bytes, 0, (int)file.InputStream.Length);  
 
            // Call the stored procedure AddAttachment with its parameters  
            using (SqlConnection conn = new SqlConnection(SATConfiguration.SatConnectionString))  
            {  
                try  
                {  
                    // Open a new connection  
                    conn.Open();  
 
                    // Create a command object identifying the stored procedure  
                    SqlCommand cmd = new SqlCommand("AddAttachment", conn);  
 
                    // Set the command object so it knows to execute a stored procedure  
                    cmd.CommandType = CommandType.StoredProcedure;  
 
                    // Add parameters to command, which will be passed to the stored procedure  
                    cmd.Parameters.AddWithValue("@userid", this.userid);  
                    cmd.Parameters.AddWithValue("@caseid", this.caseid);  
                    cmd.Parameters.AddWithValue("@filename", this.filename);  
                    cmd.Parameters.AddWithValue("@description", this.description);  
                    cmd.Parameters.AddWithValue("@attachment", this.bytes);  
 
                    cmd.ExecuteNonQuery();  
                    cmd.Dispose();  
                }  
                catch (Exception ex)  
                {  
                    log.Error("Exception while writing attachment to database", ex);  
                }  
                finally  
                {  
                    // close the connection  
                    conn.Close();  
                }  
            }  
 

 

Erjan Gavalji
Telerik team
 answered on 22 May 2008
1 answer
227 views
 Hello !

I have 2 tabs and 2 radPageView's, each other with a textBox,

a requiredFieldValidator and a button. When I press first

button, it take in consideration both validators and I don't

agree that. Could you help me. please ?

Have a nice day !

<telerik:RadTabStrip ID="RadTabStrip1" runat="server"

SelectedIndex="0" MultiPageID="RadMultiPage1"

CausesValidation="false">
        <Tabs>
            <telerik:RadTab runat="server" Text="Root

RadTab1" Selected="true" PageViewID="rpv1">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Root

RadTab2" PageViewID="rpv2">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server"

SelectedIndex="0" >
        <telerik:RadPageView ID="rpv1" runat="server">
            <asp:TextBox ID="TextBox1"

runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator

ID="RequiredFieldValidator1" runat="server"

ErrorMessage="RequiredFieldValidator"

ControlToValidate="TextBox1">*</asp:RequiredFieldValidator>
            <br /><asp:Button ID="Button1" runat="server"

Text="Button1"
                onclick="Button1_Click" />
        </telerik:RadPageView>
        <telerik:RadPageView ID="rpv2" runat="server">
            <asp:TextBox ID="TextBox2"

runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator

ID="RequiredFieldValidator2" runat="server"

ErrorMessage="RequiredFieldValidator"

ControlToValidate="TextBox2">**</asp:RequiredFieldValidator>
            <br /><asp:Button ID="Button2" runat="server"

Text="Button2"
                onclick="Button2_Click" />
        </telerik:RadPageView>
    </telerik:RadMultiPage>


And C# code :

protected void Button1_Click(object sender, EventArgs e)
    {
        Response.Write("button1");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Write("button2");
    } 

Paul
Telerik team
 answered on 22 May 2008
1 answer
42 views
I have chosen one of the standardskins for mig Panelbar, and when I try to add pictures to each item, nothing happens. any suggestions?

Best regards
Søren, Denmark.
Paul
Telerik team
 answered on 22 May 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?